2017-03-23 23:37:47 +03:00
|
|
|
# Make a release with
|
|
|
|
# make -j4 release
|
|
|
|
|
|
|
|
VERSION=$(shell git describe)
|
2018-02-16 02:52:06 +03:00
|
|
|
LDFLAGS=-ldflags "-X main.version=${VERSION}"
|
2017-03-23 02:13:19 +03:00
|
|
|
|
|
|
|
.PHONY: build
|
2018-02-16 02:52:06 +03:00
|
|
|
build: bindata.go
|
2017-03-28 17:08:29 +03:00
|
|
|
go build ${LDFLAGS}
|
2017-03-23 02:13:19 +03:00
|
|
|
|
2018-02-16 02:52:06 +03:00
|
|
|
STATICFILES := $(wildcard static/*)
|
|
|
|
TEMPLATES := $(wildcard templates/*)
|
|
|
|
bindata.go: $(STATICFILES) $(TEMPLATES)
|
|
|
|
go-bindata -tags '!debug' static/... templates/...
|
2018-02-20 13:08:13 +03:00
|
|
|
go fmt
|
2018-02-16 02:52:06 +03:00
|
|
|
|
|
|
|
bindata-debug.go: $(STATICFILES) $(TEMPLATES)
|
|
|
|
go-bindata -tags 'debug' -o bindata-debug.go -debug static/... templates/...
|
2018-02-20 13:08:13 +03:00
|
|
|
go fmt
|
|
|
|
|
2018-02-16 02:52:06 +03:00
|
|
|
|
|
|
|
.PHONY: devel
|
|
|
|
devel: bindata-debug.go
|
|
|
|
go build -tags debug
|
|
|
|
|
2017-11-02 15:27:39 +03:00
|
|
|
.PHONY: quick
|
2018-02-16 02:52:06 +03:00
|
|
|
quick: bindata.go
|
|
|
|
go build
|
2017-11-02 15:27:39 +03:00
|
|
|
|
2017-03-23 23:37:47 +03:00
|
|
|
.PHONY: linuxarm
|
2018-02-16 02:52:06 +03:00
|
|
|
linuxarm: bindata.go
|
2017-03-23 16:33:46 +03:00
|
|
|
env GOOS=linux GOARCH=arm go build ${LDFLAGS} -o dist/cowyo_linux_arm
|
2017-08-18 17:05:10 +03:00
|
|
|
#cd dist && upx --brute cowyo_linux_arm
|
2017-03-23 23:37:47 +03:00
|
|
|
|
2017-11-05 16:35:11 +03:00
|
|
|
.PHONY: linux32
|
2018-02-16 02:52:06 +03:00
|
|
|
linux32: bindata.go
|
2017-11-05 16:35:11 +03:00
|
|
|
env GOOS=linux GOARCH=386 go build ${LDFLAGS} -o dist/cowyo_linux_32bit
|
2018-01-27 12:27:33 +03:00
|
|
|
#cd dist && upx --brute cowyo_linux_32bit
|
2017-11-05 16:35:11 +03:00
|
|
|
|
2017-03-23 23:37:47 +03:00
|
|
|
.PHONY: linux64
|
2018-02-16 02:52:06 +03:00
|
|
|
linux64: bindata.go
|
2017-03-23 02:13:19 +03:00
|
|
|
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_linux_amd64
|
2017-03-23 23:37:47 +03:00
|
|
|
|
|
|
|
.PHONY: windows
|
2018-02-16 02:52:06 +03:00
|
|
|
windows: bindata.go
|
2017-03-23 02:13:19 +03:00
|
|
|
env GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_windows_amd64.exe
|
2017-08-18 17:05:10 +03:00
|
|
|
#cd dist && upx --brute cowyo_windows_amd64.exe
|
2017-03-23 23:37:47 +03:00
|
|
|
|
|
|
|
.PHONY: osx
|
2018-02-16 02:52:06 +03:00
|
|
|
osx: bindata.go
|
2017-03-23 02:13:19 +03:00
|
|
|
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_osx_amd64
|
2017-08-18 17:05:10 +03:00
|
|
|
#cd dist && upx --brute cowyo_osx_amd64
|
2017-03-23 02:13:19 +03:00
|
|
|
|
2017-03-23 23:37:47 +03:00
|
|
|
.PHONY: release
|
2017-11-05 16:35:11 +03:00
|
|
|
release: osx windows linux64 linux32 linuxarm
|