forked from pinqy520/yoga-layout-wasm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (51 loc) · 1.63 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
CC=emcc
ARGS_COMMON=yoga/yoga/*.cpp yoga/yoga/*/*.cpp bindings/*.cc \
--bind -O0 --memory-init-file 0 --closure 1 --llvm-lto 1 \
-Iyoga \
--extern-post-js templates/external.post.js.txt \
-s EXPORT_ES6=0 \
-s ENVIRONMENT="web,webview,worker" \
-s BINARYEN=1 \
-s "BINARYEN_METHOD='native-wasm'" \
-s EXPORTED_RUNTIME_METHODS=[] \
-s NO_FILESYSTEM=1 \
-s SINGLE_FILE=1 \
-s WASM_ASYNC_COMPILATION=1 \
-s DISABLE_EXCEPTION_CATCHING=1 \
-s AGGRESSIVE_VARIABLE_ELIMINATION=1 \
-s NO_EXIT_RUNTIME=1 \
-s ASSERTIONS=0 \
-s ALLOW_MEMORY_GROWTH=1 \
-s MODULARIZE=1 \
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
-s "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=['memcpy','memset','malloc','free','strlen']"
ARGS_BROWSER=--extern-pre-js templates/external.pre.es6.js.txt
ARGS_NODE=--extern-pre-js templates/external.pre.commonjs.js.txt
ARGS_PROD=-O3 -g0
ARGS_DEBUG=-O0 -g3 -DDEBUG
ARGS_WASM=-s WASM=1 -o build/yoga.bundle.wasm.js
ARGS_ASM=-s WASM=0 -o build/yoga.bundle.asm.js
all: clean dir wasm asm
debug: clean dir wasm-debug asm-debug
tests: clean dir wasm-tests asm-tests
wasm:
$(CC) $(ARGS_COMMON) ${ARGS_BROWSER} $(ARGS_PROD) $(ARGS_WASM)
asm:
$(CC) $(ARGS_COMMON) ${ARGS_BROWSER} $(ARGS_PROD) $(ARGS_ASM)
wasm-debug:
$(CC) $(ARGS_COMMON) ${ARGS_BROWSER} $(ARGS_DEBUG) $(ARGS_WASM)
asm-debug:
$(CC) $(ARGS_COMMON) ${ARGS_BROWSER} $(ARGS_DEBUG) $(ARGS_ASM)
wasm-tests:
$(CC) $(ARGS_COMMON) ${ARGS_NODE} $(ARGS_DEBUG) $(ARGS_WASM)
asm-tests:
$(CC) $(ARGS_COMMON) ${ARGS_NODE} $(ARGS_DEBUG) $(ARGS_ASM)
clean:
rm -rf build
dir:
mkdir -p build
copy: copy-lib copy-tests
copy-lib:
cp build/* lib/
copy-tests:
cp build/* tests/lib/