-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Makefile
54 lines (42 loc) · 1.46 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
# Make a release with
# make -j4 release
VERSION=$(shell git describe)
LDFLAGS=-ldflags "-X main.version=${VERSION}"
.PHONY: build
build: server/bindata.go
go build ${LDFLAGS}
STATICFILES := $(wildcard static/*)
TEMPLATES := $(wildcard templates/*)
server/bindata.go: $(STATICFILES) $(TEMPLATES)
go-bindata -pkg server -tags '!debug' -o server/bindata.go static/... templates/...
go fmt
server/bindata-debug.go: $(STATICFILES) $(TEMPLATES)
go-bindata -pkg server -tags 'debug' -o server/bindata-debug.go -debug static/... templates/...
go fmt
.PHONY: devel
devel: server/bindata-debug.go
go build -tags debug
.PHONY: quick
quick: server/bindata.go
go build
.PHONY: linuxarm
linuxarm: server/bindata.go
env GOOS=linux GOARCH=arm go build ${LDFLAGS} -o dist/cowyo_linux_arm
#cd dist && upx --brute cowyo_linux_arm
.PHONY: linux32
linux32: server/bindata.go
env GOOS=linux GOARCH=386 go build ${LDFLAGS} -o dist/cowyo_linux_32bit
#cd dist && upx --brute cowyo_linux_32bit
.PHONY: linux64
linux64: server/bindata.go
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_linux_amd64
.PHONY: windows
windows: server/bindata.go
env GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_windows_amd64.exe
#cd dist && upx --brute cowyo_windows_amd64.exe
.PHONY: osx
osx: server/bindata.go
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_osx_amd64
#cd dist && upx --brute cowyo_osx_amd64
.PHONY: release
release: osx windows linux64 linux32 linuxarm