Skip to content

Build debug information alongside non-debug builds. #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ COPT += -O3
CFLAGS += -g
else
COPT += -O3 -DNDEBUG
CFLAGS += -gsource-map --source-map-base=./
endif

JSFLAGS += -s ASYNCIFY
Expand All @@ -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 += \
Expand Down Expand Up @@ -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
.PHONY: simulator-js