Skip to content

Commit 50d5b3e

Browse files
authored
Merge pull request #111 from mhdawson/fixup-config-options
fix: restore configuration through env variables
2 parents 1c7fe8b + 606ec5b commit 50d5b3e

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

build/Makefile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
# These flags depend on the system and may be overridden
2+
WASM_CC := clang
3+
WASM_CFLAGS := --sysroot=/usr/share/wasi-sysroot
4+
WASM_LDFLAGS := -nostartfiles
5+
6+
# These are project-specific and are expected to be kept intact
7+
WASM_TARGET := -target wasm32-unknown-wasi
8+
WASM_EXTRA_CFLAGS := -I include-wasm/ -Wno-logical-op-parentheses -Wno-parentheses -Oz
9+
WASM_EXTRA_LDFLAGS := -Wl,-z,stack-size=13312,--no-entry,--compress-relocations,--strip-all
10+
WASM_EXTRA_LDFLAGS += -Wl,--export=__heap_base,--export=parseCJS,--export=sa
11+
WASM_EXTRA_LDFLAGS += -Wl,--export=e,--export=re,--export=es,--export=ee
12+
WASM_EXTRA_LDFLAGS += -Wl,--export=rre,--export=ree,--export=res,--export=ru,--export=us,--export=ue
13+
114
lib/lexer.wasm: include-wasm/cjs-module-lexer.h src/lexer.c
215
@mkdir -p lib
3-
clang --sysroot=/usr/share/wasi-sysroot -target wasm32-unknown-wasi src/lexer.c -I include-wasm -o lib/lexer.wasm -nostartfiles \
4-
-Wl,-z,stack-size=13312,--no-entry,--compress-relocations,--strip-all,--export=__heap_base,\
5-
--export=parseCJS,--export=sa,--export=e,--export=re,--export=es,--export=ee,--export=rre,--export=ree,--export=res,--export=ru,--export=us,--export=ue \
6-
-Wno-logical-op-parentheses -Wno-parentheses \
7-
-Oz
16+
$(WASM_CC) $(WASM_CFLAGS) $(WASM_TARGET) $(WASM_EXTRA_CFLAGS) \
17+
src/lexer.c -o lib/lexer.wasm \
18+
$(WASM_LDFLAGS) $(WASM_EXTRA_LDFLAGS)
819

920
optimize: lib/lexer.wasm
1021
${WASM_OPT} -Oz lib/lexer.wasm -o lib/lexer.wasm

0 commit comments

Comments
 (0)