diff options
author | Ayke van Laethem <[email protected]> | 2019-04-16 15:08:40 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-04-17 23:15:37 +0200 |
commit | 6c63a0d6e7a3686b93cf251c21c021516549cc66 (patch) | |
tree | 8876c90b4de03b20725e585090716879bf30a995 /Makefile | |
parent | 2a0a7722f90183d98c26078a5bd63cc88247971d (diff) | |
download | tinygo-6c63a0d6e7a3686b93cf251c21c021516549cc66.tar.gz tinygo-6c63a0d6e7a3686b93cf251c21c021516549cc66.zip |
Makefile: build static binaries only
This replaces the older way which just does the following:
go install .
and
go test -v .
Instead, `make` and `make test` will now build TinyGo statically linked
against LLVM, so that `go install` and `go test -v` should be used
manually.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -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 |