-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (31 loc) · 1.1 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
NAME=360tools
BINDIR=bin
SOURCES=$(wildcard *.go *.template)
BINARIES=${BINDIR}/${NAME}-darwin-amd64 ${BINDIR}/${NAME}-darwin-arm64 ${BINDIR}/${NAME}-darwin ${BINDIR}/${NAME}-linux-amd64 ${BINDIR}/${NAME}-linux-arm64 ${BINDIR}/${NAME}-linux-arm ${BINDIR}/${NAME}-windows.exe
all: test ${BINDIR} ${BINARIES}
test:
go test -v
cov:
go test -coverprofile=coverage.out
go tool cover -html=coverage.out
${BINDIR}:
mkdir -p ${BINDIR}
${BINDIR}/${NAME}-darwin-amd64: ${SOURCES}
GOARCH=amd64 GOOS=darwin go build -o $@
${BINDIR}/${NAME}-darwin-arm64: ${SOURCES}
GOARCH=arm64 GOOS=darwin go build -o $@
${BINDIR}/${NAME}-darwin: ${BINDIR}/${NAME}-darwin-amd64 ${BINDIR}/${NAME}-darwin-arm64
-makefat $@ $^
${BINDIR}/${NAME}-linux-amd64: ${SOURCES}
GOARCH=amd64 GOOS=linux go build -o $@
${BINDIR}/${NAME}-linux-arm64: ${SOURCES}
GOARCH=arm64 GOOS=linux go build -o $@
${BINDIR}/${NAME}-linux-arm: ${SOURCES}
GOARCH=arm GOOS=linux go build -o $@
${BINDIR}/${NAME}-windows.exe: ${SOURCES}
GOARCH=amd64 GOOS=windows go build -o $@
run:
go run ${SOURCES}
clean:
@go clean
-@rm -rf ${BINDIR} 2>/dev/null || true