-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
71 lines (52 loc) · 1.53 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
.SILENT :
.PHONY : shuttle fmt test dist-clean
TAG :=`git describe --tags`
VERSION = `git describe --tags 2>/dev/null || git rev-parse --short HEAD 2>/dev/null`
LDFLAGS = -X main.buildVersion=$(VERSION)
all: shuttle
deps:
glock sync github.com/litl/shuttle
shuttle:
echo "Building shuttle"
go install -x -ldflags "$(LDFLAGS)" github.com/litl/shuttle
fmt:
go fmt github.com/litl/shuttle/...
test:
go test -v github.com/litl/shuttle
dist-clean:
rm -rf dist
rm -f shuttle-*.tar.gz
dist-init:
mkdir -p dist/$$GOOS/$$GOARCH
dist-build: dist-init
echo "Compiling $$GOOS/$$GOARCH"
go build -a -ldflags "$(LDFLAGS)" -o dist/$$GOOS/$$GOARCH/shuttle github.com/litl/shuttle
dist-linux-amd64:
export GOOS="linux"; \
export GOARCH="amd64"; \
$(MAKE) dist-build
dist-linux-386:
export GOOS="linux"; \
export GOARCH="386"; \
$(MAKE) dist-build
dist-darwin-amd64:
export GOOS="darwin"; \
export GOARCH="amd64"; \
$(MAKE) dist-build
dist: dist-clean dist-init dist-linux-amd64 dist-linux-386 dist-darwin-amd64
release-tarball:
echo "Building $$GOOS-$$GOARCH-$(TAG).tar.gz"
GZIP=-9 tar -cvzf shuttle-$$GOOS-$$GOARCH-$(TAG).tar.gz -C dist/$$GOOS/$$GOARCH shuttle >/dev/null 2>&1
release-linux-amd64:
export GOOS="linux"; \
export GOARCH="amd64"; \
$(MAKE) release-tarball
release-linux-386:
export GOOS="linux"; \
export GOARCH="386"; \
$(MAKE) release-tarball
release-darwin-amd64:
export GOOS="darwin"; \
export GOARCH="amd64"; \
$(MAKE) release-tarball
release: deps dist release-linux-amd64 release-linux-386 release-darwin-amd64