UNPKG

931 BPlain TextView Raw
1VERSION?=2.83.7
2
3build:
4 @curl -L -so source.tgz \
5 https://github.com/bulletphysics/bullet3/archive/$(VERSION).tar.gz
6 @tar -xzf source.tgz
7 @rm -fr source source.tgz
8 @mv bullet3-$(VERSION) source
9 @cd source && \
10 python $(EMSCRIPTEN_ROOT)/tools/webidl_binder.py ../ammo.idl glue && \
11 (cd src && \
12 find . -name '*.h' | grep -Ev 'Bullet3|gim_|clew' | \
13 sed 's/\.\//#include "/' | sed 's/$$/"/' > ../manifest.cpp) && \
14 echo '#include "glue.cpp"' >> manifest.cpp && \
15 emcc \
16 `find src -name '*.cpp' | grep -Ev 'Bullet3|gim_|clew'` \
17 manifest.cpp \
18 -s NO_EXIT_RUNTIME=1 \
19 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 \
20 -s NO_DYNAMIC_EXECUTION=1 \
21 -s NO_FILESYSTEM=1 \
22 -s TOTAL_MEMORY=67108864 \
23 -s EXPORT_NAME=\"Ammo\" \
24 -s MODULARIZE=1 \
25 -O3 \
26 --llvm-lto 1 \
27 --memory-init-file 0 \
28 -I src \
29 --post-js glue.js \
30 -o ammo.js
31 @cat ammo.js.start source/ammo.js ammo.js.end > ammo.js