Update build logic

This commit is contained in:
Nick Gerleman
2022-12-22 03:06:42 -08:00
parent bf3af7eb90
commit d2effccfee
35 changed files with 1379 additions and 1874 deletions

View File

@@ -1,30 +1,66 @@
CC=emcc
CXX=em++
all: clean dir asm
SOURCES=\
sources/yoga/*.cpp \
sources/yoga/**/*.cpp \
sources/*.cc
CXXFLAGS=\
-Isources \
-DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \
-std=c++11 \
-g0 \
-Os \
-flto \
-fno-exceptions \
-fno-rtti \
EMCCFLAGS=\
--closure 1 \
--memory-init-file 0 \
--no-entry
EMCCOPTS=\
-s ALLOW_MEMORY_GROWTH=1 \
-s ASSERTIONS=0 \
-s DEFAULT_TO_CXX=1 \
-s DYNAMIC_EXECUTION=0 \
-s ENVIRONMENT="web,node" \
-s EXPORT_NAME="yoga" \
-s FETCH_SUPPORT_INDEXEDDB=0 \
-s FILESYSTEM=0 \
-s MALLOC="emmalloc" \
-s MODULARIZE=1 \
-s STRICT=1 \
-s TEXTDECODER=0 \
-s USE_ES6_IMPORT_META=0 \
-s WASM_ASYNC_COMPILATION=0
LDLIBS=\
-lembind
all: clean dir asm wasm
asm:
$(CC) sources/yoga/*.cpp sources/yoga/**/*.cpp sources/*.cc \
--bind \
-Isources \
-g0 \
-Os \
--closure 1 \
--memory-init-file 0 \
$(CXX) $(SOURCES) \
$(INCLUDE) \
$(CXXFLAGS) \
$(EMCCFLAGS) \
$(LDLIBS) \
$(EMCCOPTS) \
-s WASM=0 \
-s WASM_ASYNC_COMPILATION=0 \
-s USE_CLOSURE_COMPILER=1 \
-s USE_ES6_IMPORT_META=0 \
-s MODULARIZE=1 \
-s ASSERTIONS=0 \
-s ALLOW_MEMORY_GROWTH=1 \
-s DYNAMIC_EXECUTION=0 \
-s TEXTDECODER=0 \
-s ENVIRONMENT='web' \
-s FILESYSTEM=0 \
-s MALLOC="emmalloc" \
-s EXPORT_NAME="yoga" \
-o dist/asm.js
wasm:
$(CXX) $(SOURCES) \
$(INCLUDE) \
$(CXXFLAGS) \
$(EMCCFLAGS) \
$(LDLIBS) \
$(EMCCOPTS) \
-s WASM=1 \
-o dist/wasm.js
clean:
rm -rf dist