-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (35 loc) · 1.09 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export CGO_ENABLED=0
PACKAGE=github.com/jinliming2/secure-dns
VERSION=`git describe --tags --abbrev=0`
HASH=`git rev-parse --short HEAD`
DATE=`date +%Y%m%d%H%M%S`
LDFLAGS="-X '${PACKAGE}/versions.VERSION=${VERSION} (${DATE})' -X '${PACKAGE}/versions.BUILDHASH=${HASH}' -s -w"
.PHONY: all build clean
all: clean build
build: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64 windows_386 windows_amd64
linux_amd64:
GOOS=linux \
GOARCH=amd64 \
go build -v -ldflags ${LDFLAGS} -o build/secure-dns-linux-amd64
linux_arm64:
GOOS=linux \
GOARCH=arm64 \
go build -v -ldflags ${LDFLAGS} -o build/secure-dns-linux-arm64
darwin_amd64:
GOOS=darwin \
GOARCH=amd64 \
go build -v -ldflags ${LDFLAGS} -o build/secure-dns-darwin-amd64
darwin_arm64:
GOOS=darwin \
GOARCH=arm64 \
go build -v -ldflags ${LDFLAGS} -o build/secure-dns-darwin-arm64
windows_386:
GOOS=windows \
GOARCH=386 \
go build -v -ldflags ${LDFLAGS} -o build/secure-dns-windows-386.exe
windows_amd64:
GOOS=windows \
GOARCH=amd64 \
go build -v -ldflags ${LDFLAGS} -o build/secure-dns-windows-amd64.exe
clean:
rm build/secure-dns-* || true