From f228816300a40a6f8cd90293a629fffad952c6ce Mon Sep 17 00:00:00 2001 From: Jan Mercl <0xjnml@gmail.com> Date: Sun, 13 Sep 2020 15:31:23 +0200 Subject: support linux/arm{,64} --- Makefile | 52 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 11 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 14eb30d..429dae1 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,16 @@ grep=--include=*.go --include=*.l --include=*.y --include=*.yy ngrep='TODOOK\|internal\/vfs\|internal\/bin\|internal\/mptest\|.*stringer.*\.go' -log=log-$(shell go env GOOS)-$(shell go env GOARCH) +host=$(shell go env GOOS)-$(shell go env GOARCH) +testlog=testdata/testlog-$(shell echo $$GOOS)-$(shell echo $$GOARCH)$(shell echo $$SQLITE_TEST_SUFFIX) all: editor date - go version 2>&1 | tee $(log) + go version 2>&1 | tee log ./unconvert.sh gofmt -l -s -w *.go go test -i - go test -v 2>&1 -timeout 24h | tee -a $(log) + go test -v 2>&1 -timeout 24h | tee -a log go run speedtest1/main_$(shell go env GOOS)_$(shell go env GOARCH).go #TODO GOOS=linux GOARCH=arm go build -v ./... #TODO GOOS=linux GOARCH=arm64 go build -v ./... @@ -27,19 +28,48 @@ all: editor staticcheck || true maligned || true git diff --unified=0 testdata *.golden - grep -n --color=always 'FAIL\|PASS' $(log) + grep -n --color=always 'FAIL\|PASS' log go version - date 2>&1 | tee -a $(log) + date 2>&1 | tee -a log + +linux_amd64: + TARGET_GOOS=linux TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-amd64 + GOOS=linux GOARCH=amd64 go build -v ./... linux_386: - CCGO_CPP=i686-linux-gnu-cpp TARGET_GOARCH=386 TARGET_GOOS=linux \ - go generate 2>&1 | tee /tmp/log-generate-tcl-linux-386 + CCGO_CPP=i686-linux-gnu-cpp TARGET_GOARCH=386 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-tcl-linux-386 GOOS=linux GOARCH=386 go build -v ./... -linux_amd64: - TARGET_GOOS=linux TARGET_GOARCH=amd64 \ - go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-amd64 - GOOS=linux GOARCH=amd64 go build -v ./... +linux_arm: + CCGO_CPP=arm-linux-gnueabi-cpp-8 TARGET_GOARCH=arm TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-tcl-linux-arm + GOOS=linux GOARCH=arm go build -v ./... + +linux_arm64: + CCGO_CPP=aarch64-linux-gnu-cpp-8 TARGET_GOARCH=arm64 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-tcl-linux-arm64 + GOOS=linux GOARCH=arm64 go build -v ./... + +test: + go version | tee $(testlog) + uname -a | tee -a $(testlog) + go test -v -timeout 24h | tee -a $(testlog) + grep -ni fail $(testlog) | tee -a $(testlog) || true + LC_ALL=C date | tee -a $(testlog) + grep -ni --color=always fail $(testlog) || true + +test_linux_amd64: + GOOS=linux GOARCH=amd64 make test + +test_linux_386: + GOOS=linux GOARCH=386 make test + +test_linux_386_hosted: + GOOS=linux GOARCH=386 SQLITE_TEST_SUFFIX=-hosted-$(host) make test + +test_linux_arm: + GOOS=linux GOARCH=arm make test + +test_linux_arm64: + GOOS=linux GOARCH=arm64 make test extraquick: go test -timeout 24h -v -run Tcl -suite extraquick -maxerror 1 2>&1 | tee log-extraquick -- cgit v1.2.3-70-g09d2