-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (28 loc) · 953 Bytes
/
Makefile
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
30
31
32
33
34
35
36
CC= emcc
CFLAGS= -Oz -Wall -Ilua-5.4.6/src -Icephes -Lcephes -Llua-5.4.6/src -lm -ldl
LLVMFLAGS= -s EXPORT_NAME="_arianaWASM"\
-s ALLOW_MEMORY_GROWTH=1\
-s EXPORTED_FUNCTIONS="['_run_lua']"\
-s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'\
--js-library js/libs.js
all: docs/main.js
docs/main-raw.js: cephes lua c/main.c
$(CC) $(CFLAGS) c/tfunc.c c/plot.c c/canvas.c c/main.c -o docs/main.js $(LLVMFLAGS) lua-5.4.6/src/liblua.a cephes/cephes.bc --preload-file modules/@/ --no-heap-copy
mv docs/main.js docs/main-raw.js
docs/main.js: js/shell-pre.js docs/main-raw.js js/shell-post.js
cat $^ > $@
rm -f docs/main-raw.js
cephes:
cd cephes && make all
lua:
cd lua-5.4.6/src && make generic CC='emcc'
clean:
cd lua-5.4.6/src && make clean
rm -f cephes/cephes.bc
rm -f cephes/*.o
rm -f docs/main.wasm
rm -f docs/main.wast
rm -f docs/main.wasm.map
rm -f docs/main.js
rm -f docs/main.data
.PHONY: all clean cephes