--- Makefile.orig 2020-04-13 15:48:30 UTC +++ Makefile @@ -40,7 +40,7 @@ MD5SUM = md5sum TINYGO ?= tinygo # Use CCACHE for LLVM if possible -ifneq (, $(shell command -v ccache 2> /dev/null)) +ifneq (, $(CCACHE_DIR)) LLVM_OPTION += '-DLLVM_CCACHE_BUILD=ON' endif @@ -121,13 +121,13 @@ fmt-check: gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive gen-device-stm32 gen-device-avr: - $(GO) build -o ./build/gen-device-avr ./tools/gen-device-avr/ + $(GO) build -mod=vendor -o ./build/gen-device-avr ./tools/gen-device-avr/ ./build/gen-device-avr lib/avr/packs/atmega src/device/avr/ ./build/gen-device-avr lib/avr/packs/tiny src/device/avr/ @GO111MODULE=off $(GO) fmt ./src/device/avr build/gen-device-svd: ./tools/gen-device-svd/*.go - $(GO) build -o $@ ./tools/gen-device-svd/ + $(GO) build -mod=vendor -o $@ ./tools/gen-device-svd/ gen-device-nrf: build/gen-device-svd ./build/gen-device-svd -source=https://github.com/NordicSemiconductor/nrfx/tree/master/mdk lib/nrfx/mdk/ src/device/nrf/ @@ -165,16 +165,16 @@ $(LLVM_BUILDDIR): $(LLVM_BUILDDIR)/build.ninja .PHONY: wasi-libc wasi-libc: lib/wasi-libc/sysroot/lib/wasm32-wasi/libc.a lib/wasi-libc/sysroot/lib/wasm32-wasi/libc.a: - cd lib/wasi-libc && make -j4 WASM_CC=$(CLANG) WASM_AR=$(LLVM_AR) WASM_NM=$(LLVM_NM) + cd lib/wasi-libc && gmake WASM_CC=$(CLANG) WASM_AR=$(LLVM_AR) WASM_NM=$(LLVM_NM) # Build the Go compiler. tinygo: @if [ ! -f "$(LLVM_BUILDDIR)/bin/llvm-config" ]; then echo "Fetch and build LLVM first by running:"; echo " make llvm-source"; echo " make $(LLVM_BUILDDIR)"; exit 1; fi - CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) build -buildmode exe -o build/tinygo$(EXE) -tags byollvm . + CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) build -buildmode exe -o build/tinygo$(EXE) -tags byollvm -mod=vendor . test: wasi-libc - CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test -v -buildmode exe -tags byollvm ./cgo ./compileopts ./interp ./transform . + CGO_CPPFLAGS="$(CGO_CPPFLAGS)" CGO_CXXFLAGS="$(CGO_CXXFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) test -v -buildmode exe -tags byollvm -mod=vendor ./cgo ./compileopts ./interp ./transform . tinygo-test: cd tests/tinygotest && tinygo test @@ -345,4 +345,3 @@ release: tinygo gen-device wasi-libc ./build/tinygo build-library -target=armv6m-none-eabi -o build/release/tinygo/pkg/armv6m-none-eabi/picolibc.a picolibc ./build/tinygo build-library -target=armv7m-none-eabi -o build/release/tinygo/pkg/armv7m-none-eabi/picolibc.a picolibc ./build/tinygo build-library -target=armv7em-none-eabi -o build/release/tinygo/pkg/armv7em-none-eabi/picolibc.a picolibc - tar -czf build/release.tar.gz -C build/release tinygo