improve build support
This commit is contained in:
parent
06bec467f1
commit
5b39aa365e
|
@ -25,7 +25,8 @@ _testmain.go
|
|||
|
||||
*.swp
|
||||
|
||||
bin/
|
||||
bin/*
|
||||
!bin/.gitkeep
|
||||
|
||||
www/public/
|
||||
www/data/
|
||||
|
|
26
Makefile
26
Makefile
|
@ -8,12 +8,14 @@ endif
|
|||
test \
|
||||
docs \
|
||||
readme \
|
||||
release
|
||||
release \
|
||||
release-linux \
|
||||
release-darwin
|
||||
|
||||
all: bin/pomo
|
||||
|
||||
clean:
|
||||
-rm -fv bin/* docs/*
|
||||
-rm -rfv bin/* docs/*
|
||||
|
||||
bindata.go: tomato-icon.png
|
||||
go-bindata -pkg main -o $@ $^
|
||||
|
@ -22,15 +24,27 @@ test:
|
|||
go test ./...
|
||||
go vet ./...
|
||||
|
||||
release-linux: bin bindata.go
|
||||
go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo-$(VERSION)-linux-amd64
|
||||
bin/pomo-$(VERSION)-linux-amd64: bin bindata.go
|
||||
go build -ldflags "-X main.Version=$(VERSION)" -o $@
|
||||
|
||||
release-osx: bin bindata.go
|
||||
bin/pomo-$(VERSION)-linux-amd64.md5:
|
||||
md5sum bin/pomo-$(VERSION)-linux-amd64 > $@
|
||||
|
||||
bin/pomo-$(VERSION)-darwin-amd64: bin bindata.go
|
||||
# This is used to cross-compile a Darwin compatible Mach-O executable
|
||||
# on Linux for OSX, you need to install https://github.com/tpoechtrager/osxcross
|
||||
PATH="$$PATH:/usr/local/osx-ndk-x86/bin" GOOS=darwin GOARCH=amd64 CC=/usr/local/osx-ndk-x86/bin/x86_64-apple-darwin15-cc CGO_ENABLED=1 go build $(FLAGS) -o bin/pomo-$(VERSION)-darwin-amd64
|
||||
PATH="$$PATH:/usr/local/osx-ndk-x86/bin" GOOS=darwin GOARCH=amd64 CC=/usr/local/osx-ndk-x86/bin/x86_64-apple-darwin15-cc CGO_ENABLED=1 go build $(FLAGS) -o $@
|
||||
|
||||
|
||||
bin/pomo-$(VERSION)-darwin-amd64.md5:
|
||||
md5sum bin/pomo-$(VERSION)-darwin-amd64 > $@
|
||||
|
||||
release-linux: bin/pomo-$(VERSION)-linux-amd64 bin/pomo-$(VERSION)-linux-amd64
|
||||
|
||||
release-darwin: bin/pomo-$(VERSION)-darwin-amd64 bin/pomo-$(VERSION)-darwin-amd64
|
||||
|
||||
release: release-linux release-darwin
|
||||
|
||||
docs: readme
|
||||
cd www && hugo -d ../docs
|
||||
|
||||
|
|
Loading…
Reference in New Issue