summaryrefslogtreecommitdiff
path: root/Makefile
blob: c36b454d83bcd3df363a37cf7eee6a19e937326e (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
24
25
26
27
28
29
#source "/home/fam/downloads/source/wasm/emsdk/emsdk_env.sh"
#EMCC=/usr/lib/emscripten/emcc
#ENV=LLVM=/usr/bin NODE_JS=node EMSCRIPTEN_ROOT=/usr/lib/emscripten
EMCC=emcc
CC=gcc
LDFLAGS=-lSDL2 -lSDL2_ttf -lGLESv2 -lGL
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 koh.c -g3
	$(CC) -c fractal.c -g3
	#$(CC) -c fractal2.c
	$(CC) koh.o fractal.o -o fractal $(LDFLAGS) -g3 
	#$(CC) koh.o fractal2.o -o fractal2 $(LDFLAGS)

emcc:
	$(EMCC) fractal.c koh.c -s WASM=1 -O3 -o index.js $(EM_LDFALGS) -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'
	#$(EMCC) fractal2.c koh.c -s WASM=1 -O3 -o index.js $(EM_LDFALGS) -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'

deploy:
	#scp index.html segfault:~/public_html/draw.html
	#scp index.js segfault:~/public_html/index.js
	#scp index.wasm segfault:~/public_html/index.wasm
	scp index.html fam@do2:/srv/http/wasm.main.lv/fractal
	scp index.js fam@do2:/srv/http/wasm.main.lv/fractal
	scp index.wasm fam@do2:/srv/http/wasm.main.lv/fractal

web:
	darkhttpd ./ --port 12345