-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
117 lines (93 loc) · 2.16 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
106
107
108
109
110
111
112
113
114
115
116
117
default: build
all: package
export GOPATH=$(CURDIR)/
export GOBIN=$(CURDIR)/.temp/
init: clean
go get ./...
build: init
go build -o ./.output/wisk .
test:
go test
go test -bench=.
integrate: build
@./.output/wisk -a ./samples/helloworld_ruby/
./.output/wisk helloworld_ruby ./.populatedSample
clean:
@rm -rf ./.output/
dist: build test
export GOOS=linux; \
export GOARCH=amd64; \
go build -o ./.output/wisk64 .
export GOOS=linux; \
export GOARCH=386; \
go build -o ./.output/wisk32 .
export GOOS=darwin; \
export GOARCH=amd64; \
go build -o ./.output/wisk_osx .
export GOOS=windows; \
export GOARCH=amd64; \
go build -o ./.output/wisk.exe .
package: dist
ifeq ($(shell which fpm), )
@echo "FPM is not installed, no packages will be made."
@echo "https://github.com/jordansissel/fpm"
@exit 1
endif
ifeq ($(WISK_VERSION), )
@echo "No 'WISK_VERSION' was specified."
@echo "Export a 'WISK_VERSION' environment variable to perform a package"
@exit 1
endif
fpm \
--log error \
-s dir \
-t deb \
-v $(WISK_VERSION) \
-n wisk \
./.output/wisk64=/usr/local/bin/wisk \
./docs/wisk.7=/usr/share/man/man7/wisk.7 \
./autocomplete/wisk=/etc/bash_completion.d/wisk
fpm \
--log error \
-s dir \
-t deb \
-v $(WISK_VERSION) \
-n wisk \
-a i686 \
./.output/wisk32=/usr/local/bin/wisk \
./docs/wisk.7=/usr/share/man/man7/wisk.7 \
./autocomplete/wisk=/etc/bash_completion.d/wisk
@mv ./*.deb ./.output/
fpm \
--log error \
-s dir \
-t rpm \
-v $(WISK_VERSION) \
-n wisk \
./.output/wisk64=/usr/local/bin/wisk \
./docs/wisk.7=/usr/share/man/man7/wisk.7 \
./autocomplete/wisk=/etc/bash_completion.d/wisk
fpm \
--log error \
-s dir \
-t rpm \
-v $(WISK_VERSION) \
-n wisk \
-a i686 \
./.output/wisk32=/usr/local/bin/wisk \
./docs/wisk.7=/usr/share/man/man7/wisk.7 \
./autocomplete/wisk=/etc/bash_completion.d/wisk
@mv ./*.rpm ./.output/
dockerTest:
ifeq ($(shell which docker), )
@echo "Docker is not installed."
@exit 1
endif
containerized_build: dockerTest
docker run \
--rm \
-v "$(CURDIR)":"/srv/build":rw \
-e ALT_VERSION=$(SEEDSTATS_VERSION) \
golang:1.13 \
bash -c \
"cd /srv/build; make build"