-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
23 lines (20 loc) · 1016 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
# generate version number
version=$(shell git describe --tags --long --always|sed 's/^v//')
binfile=dpp
all:
mkdir -p bin
-@go mod download
CGO_ENABLED=0 go build -ldflags "-X main.version=$(version)" -o bin/$(binfile) $(binfile).go
-@go fmt
static:
go build -ldflags "-X main.version=$(version) -extldflags \"-static\"" -o bin/$(binfile).static $(binfile).go
arch:
mkdir -p bin
-@go mod download
CGO_ENABLED=0 GOARCH=arm go build -ldflags "-X main.version=$(version) -extldflags \"-static\"" -o bin/$(binfile).arm $(binfile).go
CGO_ENABLED=0 GOARCH=arm64 go build -ldflags "-X main.version=$(version) -extldflags \"-static\"" -o bin/$(binfile).aarch64 $(binfile).go
CGO_ENABLED=0 GOARCH=amd64 go build -ldflags "-X main.version=$(version) -extldflags \"-static\"" -o bin/$(binfile).amd64 $(binfile).go
CGO_ENABLED=0 GOARCH=386 go build -ldflags "-X main.version=$(version) -extldflags \"-static\"" -o bin/$(binfile).386 $(binfile).go
sha256sum bin/dpp.* > bin/Checksum
version:
@echo $(version)