-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (18 loc) · 878 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
VERSION := $(shell git describe --tags --always)
GIT_COMMIT := $(shell git rev-parse --short HEAD)
GO_BUILD_COMMAND := go build -a -ldflags '-s -w -extldflags "-static" -X "github.com/PWZER/govm/cmd.Version=$(VERSION)" -X "github.com/PWZER/govm/cmd.GitCommit=$(GIT_COMMIT)"'
all: darwin linux
compress:
upx --best bin/* || true
darwin-amd64:
GOOS=darwin GOARCH=amd64 $(GO_BUILD_COMMAND) -o bin/govm-darwin-amd64 .
darwin-arm64:
GOOS=darwin GOARCH=arm64 $(GO_BUILD_COMMAND) -o bin/govm-darwin-arm64 .
darwin: darwin-amd64 darwin-arm64
linux-amd64:
GOOS=linux GOARCH=amd64 $(GO_BUILD_COMMAND) -o bin/govm-linux-amd64 .
linux-arm64:
GOOS=linux GOARCH=arm64 $(GO_BUILD_COMMAND) -o bin/govm-linux-arm64 .
linux: linux-amd64 linux-arm64
install:
GOOS=$(shell uname | tr '[:upper:]' '[:lower:]') GOARCH=$(shell go env GOARCH) $(GO_BUILD_COMMAND) -o ~/.local/bin/govm .