improve build support
This commit is contained in:
parent
06bec467f1
commit
5b39aa365e
|
@ -25,7 +25,8 @@ _testmain.go
|
||||||
|
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
bin/
|
bin/*
|
||||||
|
!bin/.gitkeep
|
||||||
|
|
||||||
www/public/
|
www/public/
|
||||||
www/data/
|
www/data/
|
||||||
|
|
26
Makefile
26
Makefile
|
@ -8,12 +8,14 @@ endif
|
||||||
test \
|
test \
|
||||||
docs \
|
docs \
|
||||||
readme \
|
readme \
|
||||||
release
|
release \
|
||||||
|
release-linux \
|
||||||
|
release-darwin
|
||||||
|
|
||||||
all: bin/pomo
|
all: bin/pomo
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -fv bin/* docs/*
|
-rm -rfv bin/* docs/*
|
||||||
|
|
||||||
bindata.go: tomato-icon.png
|
bindata.go: tomato-icon.png
|
||||||
go-bindata -pkg main -o $@ $^
|
go-bindata -pkg main -o $@ $^
|
||||||
|
@ -22,15 +24,27 @@ test:
|
||||||
go test ./...
|
go test ./...
|
||||||
go vet ./...
|
go vet ./...
|
||||||
|
|
||||||
release-linux: bin bindata.go
|
bin/pomo-$(VERSION)-linux-amd64: bin bindata.go
|
||||||
go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo-$(VERSION)-linux-amd64
|
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
|
# 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
|
# 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
|
docs: readme
|
||||||
cd www && hugo -d ../docs
|
cd www && hugo -d ../docs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue