-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
43 lines (30 loc) · 961 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
VERSION=`git rev-parse --short HEAD`
flags=-ldflags="-s -w -X main.version=${VERSION}"
# flags=-ldflags="-s -w -extldflags -static"
all: build
build:
GODEBUG=netdns=go CGO_ENABLED=0 go clean; rm -rf pkg; go build ${flags}
build_debug:
go clean; rm -rf pkg; go build ${flags} -gcflags="-m -m"
build_all: build_osx build_linux build
build_osx:
go clean; rm -rf pkg das2go_osx; GOOS=darwin go build ${flags}
mv das2go das2go_osx
build_linux:
go clean; rm -rf pkg das2go_linux; GOOS=linux go build ${flags}
mv das2go das2go_linux
build_power8:
go clean; rm -rf pkg das2go_power8; GOARCH=ppc64le GOOS=linux go build ${flags}
mv das2go das2go_power8
build_arm64:
go clean; rm -rf pkg das2go_arm64; GOARCH=arm64 GOOS=linux go build ${flags}
mv das2go das2go_arm64
build_windows:
go clean; rm -rf pkg das2go.exe; GOARCH=amd64 GOOS=windows go build ${flags}
install:
go install
clean:
go clean; rm -rf pkg
test : test1
test1:
cd test; go test