mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
4af9b87519
Former-commit-id: d640f0b7b9eec46a415858619558157db8d33353
36 lines
833 B
Makefile
36 lines
833 B
Makefile
# Make a release with
|
|
# make -j4 release
|
|
|
|
VERSION=$(shell git describe)
|
|
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION}"
|
|
|
|
.PHONY: build
|
|
build:
|
|
go-bindata static/... templates/...
|
|
go build ${LDFLAGS}
|
|
|
|
.PHONY: linuxarm
|
|
linuxarm:
|
|
env GOOS=linux GOARCH=arm go build ${LDFLAGS} -o dist/cowyo_linux_arm
|
|
cd dist && upx --brute cowyo_linux_arm
|
|
|
|
.PHONY: linux64
|
|
linux64:
|
|
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_linux_amd64
|
|
cd dist && upx --brute cowyo_linux_amd64
|
|
|
|
.PHONY: windows
|
|
windows:
|
|
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:
|
|
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 linuxarm
|
|
|
|
|