diff --git a/Makefile b/Makefile index 60df0f9f..d111cc44 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ build: dist: build mkdir -p $(BUILD)/build cp -r $(SRC)/*.html $(SRC)/term.js src/examples $(BUILD) - cp $(SRC)/build/firmware.js $(SRC)/build/simulator.js $(SRC)/build/firmware.wasm $(BUILD)/build/ + cp $(SRC)/build/firmware.js $(SRC)/build/simulator.js $(SRC)/build/*.wasm $(BUILD)/build/ watch: dist fswatch -o -e src/build src | while read _; do $(MAKE) dist; done diff --git a/src/Makefile b/src/Makefile index a9f0512a..3b26f3ac 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,6 +41,7 @@ COPT += -O3 CFLAGS += -g else COPT += -O3 -DNDEBUG +CFLAGS += -gsource-map --source-map-base=./ endif JSFLAGS += -s ASYNCIFY @@ -52,6 +53,8 @@ JSFLAGS += -s EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap']" --js-library jshal.j ifdef DEBUG JSFLAGS += -g +else +JSFLAGS += -gsource-map --source-map-base=./ endif SRC_C += \ @@ -144,8 +147,8 @@ $(BUILD)/micropython.js: $(OBJ) jshal.js simulator-js $(Q)emcc $(LDFLAGS) -o $(BUILD)/firmware.js $(OBJ) $(JSFLAGS) simulator-js: - npx esbuild ./simulator.ts --bundle --outfile=$(BUILD)/simulator.js --loader:.svg=text + npx esbuild ./simulator.ts --sourcemap --minify --bundle --outfile=$(BUILD)/simulator.js --loader:.svg=text --target=es2020 include $(TOP)/py/mkrules.mk -.PHONY: simulator-js \ No newline at end of file +.PHONY: simulator-js