From 0e23fc66583d6372cc54e00b297408b8adcf71a2 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 4 Oct 2025 23:27:17 +0100 Subject: [PATCH] Makefile cleanups for webstead Add -sINCOMING_MODULE_JS_API because in newer Emscripten -sSTRICT empties it. Remove -sMODULARIZE because -sEXPORT_ES6 implies it. Add -O2 since the compiled code will probably be run more than once. Pass standard compiler flags to emcc. Build bedstead.js in all-web, and remove it in clean. --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6e9d205..e26e904 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,8 @@ DISTFILES = bedstead.c Makefile CONTRIBUTING COPYING HACKING NEWS \ all: $(DISTFILES) .PHONY: all-web -all-web: all sample.png extended.png icon-16.png icon-32.png icon-64.png +all-web: all sample.png extended.png icon-16.png icon-32.png icon-64.png \ + bedstead.js .PHONY: experimental experimental: bedstead-chiseltip.otf bedstead-plotter-thin.otf \ @@ -111,12 +112,15 @@ bedstead-complement.ps: bedstead bedstead-complement.pdf: bedstead-complement.ps bedstead.otf Fontmap ps2pdf -P $< $@ +EMCCFLAGS = -O2 -sEXPORT_ES6 -sEXIT_RUNTIME -sSTRICT \ + -sINCOMING_MODULE_JS_API='["arguments","print"]' +EMCCFLAGS += $(CWARNFLAGS) %.js: %.c - emcc -sMODULARIZE -sEXPORT_ES6 -sEXIT_RUNTIME=1 -sSTRICT -o $@ $< + emcc $(EMCCFLAGS) -o $@ $< .PHONY: clean clean: - rm -f bedstead *.ttx *.otf *.bdf *.bdf.ps *.png *.pdf \ + rm -f bedstead *.ttx *.otf *.bdf *.bdf.ps *.png *.pdf *.js *.wasm \ bedstead-complement.ps .PHONY: install-user -- 2.30.2