From ad6e919107fb0bb38d01b1ed6e7ca1b56f9719ed Mon Sep 17 00:00:00 2001 From: James Haggerty Date: Wed, 2 Nov 2022 06:18:23 +1100 Subject: [PATCH] Separate emscripten build directory This avoids the need to 'make clean' before you do a simulator build (or vice-versa). --- README.md | 2 +- make.mk | 4 ++++ movement/make/make_alternate_fw.sh | 6 +++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90ce511..b2601da 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ You may want to test out changes in the emulator first. To do this, you'll need ``` cd movement/make emmake make -python3 -m http.server 8000 -d build +python3 -m http.server -d build-sim ``` Finally, visit [watch.html](http://localhost:8000/watch.html) to see your work. diff --git a/make.mk b/make.mk index 2fe89d7..446ad6f 100644 --- a/make.mk +++ b/make.mk @@ -1,5 +1,9 @@ ############################################################################## +ifndef EMSCRIPTEN BUILD = ./build +else +BUILD = ./build-sim +endif BIN = watch ifndef BOARD diff --git a/movement/make/make_alternate_fw.sh b/movement/make/make_alternate_fw.sh index 575c9e5..739c855 100755 --- a/movement/make/make_alternate_fw.sh +++ b/movement/make/make_alternate_fw.sh @@ -28,9 +28,9 @@ do make clean emmake make FIRMWARE=$VARIANT mkdir "$sim_dir/$variant/" - mv "build/watch.wasm" "$sim_dir/$variant/" - mv "build/watch.js" "$sim_dir/$variant/" - mv "build/watch.html" "$sim_dir/$variant/index.html" + mv "build-sim/watch.wasm" "$sim_dir/$variant/" + mv "build-sim/watch.js" "$sim_dir/$variant/" + mv "build-sim/watch.html" "$sim_dir/$variant/index.html" done echo "Done."