From ea2fcdd338b9a9a545c119a7d86de1b8caf77314 Mon Sep 17 00:00:00 2001 From: Wolf Vollprecht Date: Sun, 10 Feb 2019 16:29:25 +0100 Subject: javascript: Fix Emscripten async load, and to compile with modern clang. --- ports/javascript/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ports/javascript/Makefile') diff --git a/ports/javascript/Makefile b/ports/javascript/Makefile index 3ce698f10..9b0f4d89c 100644 --- a/ports/javascript/Makefile +++ b/ports/javascript/Makefile @@ -14,7 +14,12 @@ INC += -I$(TOP) INC += -I$(BUILD) CPP = clang -E -CFLAGS = -m32 $(INC) -Wall -Werror -std=c99 $(COPT) + +ifdef EMSCRIPTEN + CPP += -isystem $(EMSCRIPTEN)/system/include/libc -cxx-isystem $(EMSCRIPTEN)/system/include/libcxx +endif + +CFLAGS = -m32 -Wall -Werror $(INC) -std=c99 $(COPT) LDFLAGS = -m32 -Wl,-Map=$@.map,--cref -Wl,--gc-sections CFLAGS += -O0 -DNDEBUG @@ -46,8 +51,7 @@ all: $(BUILD)/micropython.js $(BUILD)/micropython.js: $(OBJ) library.js wrapper.js $(ECHO) "LINK $(BUILD)/firmware.js" $(Q)emcc $(LDFLAGS) -o $(BUILD)/firmware.js $(OBJ) $(JSFLAGS) - cat $(BUILD)/firmware.js > $@ - cat wrapper.js >> $@ + cat wrapper.js $(BUILD)/firmware.js > $@ min: $(BUILD)/micropython.js uglifyjs $< -c -o $(BUILD)/micropython.min.js -- cgit v1.2.3