mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-26 07:13:36 +01:00
19 lines
777 B
Makefile
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) |