summaryrefslogtreecommitdiff
path: root/Build/Makefile
blob: 5126c48ca5fc28df7a72ec1d750d482982b044a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
EMCC=emcc
CC=gcc
SOURCEDIR=../WasmAudio
LDFLAGS=-lSDL2 -lSDL2_ttf -lm
EM_LDFALGS=-s USE_SDL=2  -s MAX_WEBGL_VERSION=2 -s MIN_WEBGL_VERSION=2 -s LLD_REPORT_UNDEFINED -s USE_GLFW=3

make:
	$(CC) -c $(SOURCEDIR)/../FIR/firmath.c -g3
	$(CC) -c $(SOURCEDIR)/main.c -g3
	$(CC) main.o firmath.o -o WasmAudio $(LDFLAGS)

emcc:
	$(EMCC) $(SOURCEDIR)/main.c ../FIR/firmath.c -s WASM=1 -O3 -o index.js $(EM_LDFALGS) -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'


deploy:
	scp index.html fam@main.lv:/srv/http/wasm.main.lv/wasmfir
	scp index.js fam@main.lv:/srv/http/wasm.main.lv/wasmfir
	scp index.wasm fam@main.lv:/srv/http/wasm.main.lv/wasmfir
	
web:
	darkhttpd ./ --port 12345