From: Ben Harris Date: Sat, 4 Oct 2025 22:27:17 +0000 (+0100) Subject: Makefile cleanups for webstead X-Git-Tag: bedstead-3.261~50 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=0e23fc66583d6372cc54e00b297408b8adcf71a2;p=bedstead.git 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. --- 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