Files
sablier/Makefile
Alexis Couvreur 235c939771 build: remove "build" target from Makefile
You can invoke directly "make linux/arm"
2022-10-06 23:50:21 -04:00

19 lines
777 B
Makefile

PLATFORMS := linux/amd64 linux/arm64 linux/arm/v7 linux/arm
temp = $(subst /, ,$@)
os = $(word 1, $(temp))
arch = $(word 2, $(temp))
version = draft
# Version info for binaries
GIT_REVISION := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
VPREFIX := github.com/acouvreur/sablier/version
GO_LDFLAGS := -X $(VPREFIX).Branch=$(GIT_BRANCH) -X $(VPREFIX).Version=$(version) -X $(VPREFIX).Revision=$(GIT_REVISION) -X $(VPREFIX).BuildUser=$(shell whoami)@$(shell hostname) -X $(VPREFIX).BuildDate=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
$(PLATFORMS):
CGO_ENABLED=0 GOOS=$(os) GOARCH=$(arch) go build -tags=nomsgpack -v -ldflags="${GO_LDFLAGS}" -o 'sablier_$(version)_$(os)-$(arch)' .
release: $(PLATFORMS)
.PHONY: release $(PLATFORMS)