2017-03-23 23:37:47 +03:00
|
|
|
# Make a release with
|
|
|
|
# make -j4 release
|
|
|
|
|
|
|
|
VERSION=$(shell git describe)
|
2018-04-28 12:55:15 +03:00
|
|
|
LDFLAGS=-ldflags "-X main.version=${VERSION}"
|
2017-03-23 02:13:19 +03:00
|
|
|
|
|
|
|
.PHONY: build
|
2018-04-28 04:32:08 +03:00
|
|
|
build: server/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/*)
|
2018-04-28 04:32:08 +03:00
|
|
|
server/bindata.go: $(STATICFILES) $(TEMPLATES)
|
2018-05-28 03:25:30 +03:00
|
|
|
go-bindata -pkg server -tags '!debug' -o server/bindata.go static/... templates/...
|
2018-02-20 13:08:13 +03:00
|
|
|
go fmt
|
2018-02-16 02:52:06 +03:00
|
|
|
|
2018-04-28 04:32:08 +03:00
|
|
|
server/bindata-debug.go: $(STATICFILES) $(TEMPLATES)
|
2018-05-28 03:25:30 +03:00
|
|
|
go-bindata -pkg server -tags 'debug' -o server/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
|
2018-04-28 04:32:08 +03:00
|
|
|
devel: server/bindata-debug.go
|
2018-02-16 02:52:06 +03:00
|
|
|
go build -tags debug
|
|
|
|
|
2017-11-02 15:27:39 +03:00
|
|
|
.PHONY: quick
|
2018-04-28 04:32:08 +03:00
|
|
|
quick: server/bindata.go
|
2018-02-16 02:52:06 +03:00
|
|
|
go build
|
2017-11-02 15:27:39 +03:00
|
|
|
|
2017-03-23 23:37:47 +03:00
|
|
|
.PHONY: linuxarm
|
2018-04-28 04:32:08 +03:00
|
|
|
linuxarm: server/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-04-28 04:32:08 +03:00
|
|
|
linux32: server/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-04-28 04:32:08 +03:00
|
|
|
linux64: server/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-04-28 04:32:08 +03:00
|
|
|
windows: server/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-04-28 04:32:08 +03:00
|
|
|
osx: server/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
|