-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
105 lines (84 loc) · 1.91 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
default: build
all: package
export GOPATH=$(CURDIR)/
export GOBIN=$(CURDIR)/.temp/
init: clean
go get ./...
build: init
go build -o ./.output/atau .
test:
go test
go test -bench=.
clean:
@rm -rf ./.output/
fmt:
@go fmt .
@go fmt ./src/atau
install: build
@cp ./.output/atau /usr/local/bin/atau
dist: build test
export GOOS=linux; \
export GOARCH=amd64; \
go build -o ./.output/atau64 .
export GOOS=linux; \
export GOARCH=386; \
go build -o ./.output/atau32 .
export GOOS=darwin; \
export GOARCH=amd64; \
go build -o ./.output/atau_osx .
export GOOS=windows; \
export GOARCH=amd64; \
go build -o ./.output/atau.exe .
package: versionTest fpmTest dist
fpm \
--log error \
-s dir \
-t deb \
-v $(ATAU_VERSION) \
-n atau \
./.output/atau64=/usr/local/bin/atau \
./docs/atau.7=/usr/share/man/man7/atau.7 \
./autocomplete/atau=/etc/bash_completion.d/atau
fpm \
--log error \
-s dir \
-t deb \
-v $(ATAU_VERSION) \
-n atau \
-a i686 \
./.output/atau32=/usr/local/bin/atau \
./docs/atau.7=/usr/share/man/man7/atau.7 \
./autocomplete/atau=/etc/bash_completion.d/atau
@mv ./*.deb ./.output/
fpm \
--log error \
-s dir \
-t rpm \
-v $(ATAU_VERSION) \
-n atau \
./.output/atau64=/usr/local/bin/atau \
./docs/atau.7=/usr/share/man/man7/atau.7 \
./autocomplete/atau=/etc/bash_completion.d/atau
fpm \
--log error \
-s dir \
-t rpm \
-v $(ATAU_VERSION) \
-n atau \
-a i686 \
./.output/atau32=/usr/local/bin/atau \
./docs/atau.7=/usr/share/man/man7/atau.7 \
./autocomplete/atau=/etc/bash_completion.d/atau
@mv ./*.rpm ./.output/
fpmTest:
ifeq ($(shell which fpm), )
@echo "FPM is not installed, no packages will be made."
@echo "https://github.com/jordansissel/fpm"
@exit 1
endif
versionTest:
ifeq ($(ATAU_VERSION), )
@echo "No 'ATAU_VERSION' was specified."
@echo "Export a 'ATAU_VERSION' environment variable to perform a package"
@exit 1
endif