From 470cbd5f53070c10a0f920ae9a82f9a0e4f75a9d Mon Sep 17 00:00:00 2001 From: Kenneth Bell Date: Fri, 19 Nov 2021 15:40:39 +0000 Subject: [PATCH] housekeeping: wasm optional in smoketest and fix make clean --- .gitignore | 4 ++++ Makefile | 5 +++++ build/.gitignore | 2 -- 3 files changed, 9 insertions(+), 2 deletions(-) delete mode 100644 build/.gitignore diff --git a/.gitignore b/.gitignore index a5603ec7..623c6b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,12 @@ src/device/rp/*.s vendor llvm-build llvm-project +build/* # Ignore files generated by smoketest +test.bin +test.elf +test.exe test.gba test.hex test.nro diff --git a/Makefile b/Makefile index d4a1e82a..1a922f87 100644 --- a/Makefile +++ b/Makefile @@ -178,6 +178,7 @@ $(LLVM_BUILDDIR): $(LLVM_BUILDDIR)/build.ninja .PHONY: binaryen binaryen: build/wasm-opt$(EXE) build/wasm-opt$(EXE): + mkdir -p build cd lib/binaryen && cmake -G Ninja . -DBUILD_STATIC_LIB=ON $(BINARYEN_OPTION) && ninja bin/wasm-opt$(EXE) cp lib/binaryen/bin/wasm-opt$(EXE) build/wasm-opt$(EXE) @@ -273,6 +274,7 @@ smoketest: $(TINYGO) build -size short -o test.hex -target=pca10040 examples/test @$(MD5SUM) test.hex # test simulated boards on play.tinygo.org +ifneq ($(WASM), 0) $(TINYGO) build -size short -o test.wasm -tags=arduino examples/blinky1 @$(MD5SUM) test.wasm $(TINYGO) build -size short -o test.wasm -tags=hifive1b examples/blinky1 @@ -285,6 +287,7 @@ smoketest: @$(MD5SUM) test.wasm $(TINYGO) build -size short -o test.wasm -tags=circuitplay_express examples/blinky1 @$(MD5SUM) test.wasm +endif # test all targets/boards $(TINYGO) build -size short -o test.hex -target=pca10040-s132v6 examples/blinky1 @$(MD5SUM) test.hex @@ -471,8 +474,10 @@ endif @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=maixbit examples/blinky1 @$(MD5SUM) test.hex +ifneq ($(WASM), 0) $(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/export $(TINYGO) build -size short -o wasm.wasm -target=wasm examples/wasm/main +endif # test various compiler flags $(TINYGO) build -size short -o test.hex -target=pca10040 -gc=none -scheduler=none examples/blinky1 @$(MD5SUM) test.hex diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/build/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore