]> git.earman.xyz Git - sensor-watch.git/commitdiff
Separate emscripten build directory
authorJames Haggerty <james@gruemail.com>
Tue, 1 Nov 2022 19:18:23 +0000 (06:18 +1100)
committerJames Haggerty <james@gruemail.com>
Tue, 1 Nov 2022 19:18:34 +0000 (06:18 +1100)
This avoids the need to 'make clean' before you do a simulator build
(or vice-versa).

README.md
make.mk
movement/make/make_alternate_fw.sh

index 90ce511970b3ae2368fc8d74245f3c7e9db22b22..b2601da3bdab6276441a2cbf50e89e1005180343 100644 (file)
--- 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 2fe89d75e0774101b6c49f6169526c400f51b8b3..446ad6fe3bdfcb22e73841b48ba99a6746d78698 100644 (file)
--- a/make.mk
+++ b/make.mk
@@ -1,5 +1,9 @@
 ##############################################################################
+ifndef EMSCRIPTEN
 BUILD = ./build
+else
+BUILD = ./build-sim
+endif
 BIN = watch
 
 ifndef BOARD
index 575c9e52cdf9b7a30c984242b5c89d612c6b704b..739c85574acff9aecb6ec6e3216adc0c05fb6554 100755 (executable)
@@ -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."