-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
23 lines (18 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
all:
cd cmd/reto && go build -o ../../bin/reto
# This sets the build parameters in the binary at build time
version := $(shell bin/reto version)
commit := $(shell bin/reto hash)
name := $(shell bin/reto hashname)
build_time := $(shell date +"%Y-%m-%dT%H:%M")
ldflags := -X github.com/ExploratoryEngineering/reto/pkg/version.Number=$(version) \
-X github.com/ExploratoryEngineering/reto/pkg/version.Name=$(name) \
-X github.com/ExploratoryEngineering/reto/pkg/version.CommitHash=$(commit) \
-X github.com/ExploratoryEngineering/reto/pkg/version.BuildTime=$(build_time)
local-rel:
cd cmd/reto && go build -ldflags "$(ldflags)" -o ../../bin/reto
builds: local-rel
cd cmd/reto && GOOS=darwin GOARCH=amd64 go build -ldflags "$(ldflags)" -o ../../bin/reto.darwin-amd64
cd cmd/reto && GOOS=linux GOARCH=amd64 go build -ldflags "$(ldflags)" -o ../../bin/reto.linux-amd64
cd cmd/reto && GOOS=windows GOARCH=amd64 go build -ldflags "$(ldflags)" -o ../../bin/reto.windows-amd64
cd cmd/reto && GOOS=linux GOARCH=arm go build -ldflags "$(ldflags)" -o ../../bin/reto.linux-arm