-
Notifications
You must be signed in to change notification settings - Fork 124
/
Makefile
77 lines (61 loc) · 2.19 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PWD=$(shell bash -c 'pwd')
BIN_NAME=local-persist
coverage:
GO_ENV=test go test -v -coverprofile=coverage.out ./... && sed -i '' 's|'_$(PWD)'|.|g' coverage.out && go tool cover -html=coverage.out
test: export GO15VENDOREXPERIMENT=1
test: export GO_ENV=test
test:
go test -v .
run:
sudo -E go run main.go driver.go
docker-run:
./scripts/docker-run.sh
docker-build:
docker-build: clean-bin
./scripts/docker-build.sh
release:
release: docker-build
./scripts/release.sh
# build for current architecture
binary: export GO15VENDOREXPERIMENT=1
binary:
go build -o bin/$(BIN_NAME) -v
# build all the binaries
binaries: clean-bin binary-linux-amd64 binary-linux-arm64 # binary-linux-386 binary-linux-arm binary-freebsd-amd64 binary-freebsd-386
clean-bin:
rm -Rf bin/*
# build a specific binary
binary-linux-amd64: export GOOS=linux
binary-linux-amd64: export GOARCH=amd64
binary-linux-amd64: export GO15VENDOREXPERIMENT=1
binary-linux-amd64:
go build -o bin/$(GOOS)/$(GOARCH)/$(BIN_NAME) -v
binary-linux-arm64: export GOOS=linux
binary-linux-arm64: export GOARCH=arm64
binary-linux-arm64: export GO15VENDOREXPERIMENT=1
binary-linux-arm64:
go build -o bin/$(GOOS)/$(GOARCH)/$(BIN_NAME) -v
# docker doesn't currently support x32 architecture
# binary-linux-386: export GOOS=linux
# binary-linux-386: export GOARCH=386
# binary-linux-386: export GO15VENDOREXPERIMENT=1
# binary-linux-386:
# go build -o bin/$(GOOS)/$(GOARCH)/$(BIN_NAME) -v
# docker doesn't currently support arm architecture
# binary-linux-arm: export GOOS=linux
# binary-linux-arm: export GOARCH=arm
# binary-linux-arm: export GO15VENDOREXPERIMENT=1
# binary-linux-arm:
# go build -o bin/$(GOOS)/$(GOARCH)/$(BIN_NAME) -v
# cowardly unwilling to support other architectures for now
# binary-freebsd-amd64: export GOOS=freebsd
# binary-freebsd-amd64: export GOARCH=amd64
# binary-freebsd-amd64: export GO15VENDOREXPERIMENT=1
# binary-freebsd-amd64:
# go build -o bin/$(GOOS)/$(GOARCH)/$(BIN_NAME) -v
# docker doesn't currently support x32 architecture
# binary-freebsd-386: export GOOS=freebsd
# binary-freebsd-386: export GOARCH=386
# binary-freebsd-386: export GO15VENDOREXPERIMENT=1
# binary-freebsd-386:
# go build -o bin/$(GOOS)/$(GOARCH)/$(BIN_NAME) -v