Makefile: make cross-building more flexible [skip ci]
This commit is contained in:
19
Makefile
19
Makefile
@ -1,12 +1,19 @@
|
||||
VERSION=`git describe --tags --dirty --always`
|
||||
VERSION := $(shell git describe --tags --dirty --always)
|
||||
|
||||
GOFLAGS=-ldflags "-X main.version=${VERSION}" -gcflags=all=-trimpath=$(PWD) -asmflags=all=-trimpath=$(PWD)
|
||||
GOFLAGS := -ldflags "-X main.version=$(VERSION)" -gcflags=all=-trimpath=$(PWD) -asmflags=all=-trimpath=$(PWD)
|
||||
|
||||
GOARCHES := $(shell go env GOARCH)
|
||||
|
||||
build:
|
||||
GOARCH=amd64 go build ${GOFLAGS} -o wesher-amd64 ${OPTS}
|
||||
GOARCH=arm go build ${GOFLAGS} -o wesher-arm ${OPTS}
|
||||
GOARCH=arm64 go build ${GOFLAGS} -o wesher-arm64 ${OPTS}
|
||||
$(foreach GOARCH,$(GOARCHES),GOARCH=$(GOARCH) go build ${GOFLAGS} -o wesher$(if $(filter-out $(GOARCH), $(GOARCHES)),-$(GOARCH));)
|
||||
|
||||
release: build
|
||||
sha256sum wesher-* > wesher.sha256sums
|
||||
|
||||
e2e:
|
||||
tests/e2e.sh
|
||||
tests/e2e.sh
|
||||
|
||||
clean:
|
||||
rm -f wesher wesher-* wesher.sha256sums
|
||||
|
||||
.PHONY: build release e2e clean
|
Reference in New Issue
Block a user