-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (55 loc) · 1.2 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
67
68
69
70
71
72
.PHONY: wasm all important clean
all: wasm
WASM_MAIN = wasm_main.cpp
HPP_FILES = \
vcd_parser.h \
wasm_main.hpp \
CPP_FILES = \
vcd_parser.c \
vcd_spans.c \
EXPORT_STRING = \
"_execute", \
"_init", \
"_setTrigger", \
"_getTime", \
# warning and error flags
CLANG_WARN_FLAGS = \
-fno-exceptions \
CLANG_OTHER_FLAGS = \
-DVCDWASM \
CLANG_O_FLAG = '-Os'
ifdef NOOPT
CLANG_O_FLAG = ' '
endif
ifdef OPT3
CLANG_O_FLAG = '-O3'
endif
wasm: $(WASM_MAIN) $(CPP_FILES) $(HPP_FILES) Makefile
mkdir -p out
emcc \
$(WASM_MAIN) \
$(CPP_FILES) \
-o out/vcd.js \
-s DISABLE_EXCEPTION_CATCHING=1 \
-s WASM_BIGINT \
-s ALLOW_MEMORY_GROWTH=1 \
-s INITIAL_MEMORY=1GB \
-s MAXIMUM_MEMORY=2GB \
-s ALLOW_TABLE_GROWTH=1 \
-s MODULARIZE=1 \
-s EXPORTED_FUNCTIONS='[$(EXPORT_STRING) "_main"]' \
-s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap", "addOnPostRun", "addFunction", "setValue", "getValue"]' \
$(CLANG_O_FLAG) $(CLANG_WARN_FLAGS) $(CLANG_OTHER_FLAGS)
.PHONY: patchlib patchlib1 patchlib2
.PHONY: all build watch dev start test pretest lint jestc copydist cleandist prepare
.PHONY: test testonly
watch:
npm run watch
test:
npm run test
testonly:
npm run testonly
prepare:
npm run prepare
clean:
rm -rf out/*