diff --git a/.circleci/config.yml b/.circleci/config.yml index 6fb2329e..33f3bc82 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -87,7 +87,7 @@ commands: - go-cache-{{ checksum "Gopkg.lock" }} - dep - run: go install . - - run: make test + - run: go test -v - run: make gen-device -j4 - smoketest - save_cache: @@ -162,7 +162,7 @@ commands: - dep - run: name: "Test TinyGo" - command: make static-test + command: make test - run: name: "Build TinyGo release" command: | @@ -227,7 +227,7 @@ commands: command: dep ensure --vendor-only - run: name: "Test TinyGo" - command: make static-test + command: make test - run: name: "Build TinyGo release" command: | diff --git a/BUILDING.md b/BUILDING.md index 144e2c52..ad80e6b0 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -92,7 +92,7 @@ Now that you have a working version of LLVM, build TinyGo using it. You need to specify the directories to the LLVM build directory and to the Clang and LLD source. cd $HOME/go/src/github.com/tinygo-org/tinygo - make static LLVM_BUILDDIR=$HOME/src/llvm-build CLANG_SRC=$HOME/src/llvm/tools/clang LLD_SRC=$HOME/src/llvm/tools/lld + make LLVM_BUILDDIR=$HOME/src/llvm-build CLANG_SRC=$HOME/src/llvm/tools/clang LLD_SRC=$HOME/src/llvm/tools/lld ## Verify TinyGo diff --git a/Makefile b/Makefile index 9df9ae9f..e5145b8a 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ all: tinygo tinygo: build/tinygo -.PHONY: all tinygo llvm-build llvm-source static run-test clean fmt gen-device gen-device-nrf gen-device-avr +.PHONY: all tinygo build/tinygo test llvm-build llvm-source clean fmt gen-device gen-device-nrf gen-device-avr # Default build and source directories, as created by `make llvm-build`. LLVM_BUILDDIR ?= llvm-build @@ -38,9 +38,6 @@ fmt: fmt-check: @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1 -test: - @go test -v . - gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-stm32 gen-device-avr: @@ -81,17 +78,13 @@ llvm-build: llvm-build/build.ninja # Build the Go compiler. build/tinygo: - @mkdir -p build - go build -o build/tinygo . - -static: @if [ ! -f llvm-build/bin/llvm-config ]; then echo "Fetch and build LLVM first by running:\n make llvm-source\n make llvm-build"; exit 1; fi CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o build/tinygo -tags byollvm . -static-test: +test: CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test -v -tags byollvm . -release: static gen-device +release: build/tinygo gen-device @mkdir -p build/release/tinygo/bin @mkdir -p build/release/tinygo/lib/CMSIS/CMSIS @mkdir -p build/release/tinygo/lib/compiler-rt/lib