-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add -v and Makefile to build releases
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
VERSION=0.5.0 | ||
BUILD_DATE=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
GIT_HASH=$(shell git rev-parse HEAD) | ||
|
||
RELEASES=bin/vopher-$(VERSION).linux.amd64 \ | ||
bin/vopher-$(VERSION).linux.arm64 \ | ||
bin/vopher-$(VERSION).linux.mips64 \ | ||
bin/vopher-$(VERSION).windows.amd64.exe \ | ||
bin/vopher-$(VERSION).freebsd.amd64 \ | ||
bin/vopher-$(VERSION).darwin.amd64 | ||
|
||
|
||
LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildDate=$(BUILD_DATE) -X main.GitHash=$(GIT_HASH)" | ||
|
||
|
||
releases: $(RELEASES) | ||
|
||
bin/vopher-$(VERSION).linux.mips64: bin | ||
env GOOS=linux GOARCH=mips64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@ | ||
|
||
bin/vopher-$(VERSION).linux.amd64: bin | ||
env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@ | ||
|
||
bin/vopher-$(VERSION).linux.arm64: bin | ||
env GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@ | ||
|
||
bin/vopher-$(VERSION).windows.amd64.exe: bin | ||
env GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@ | ||
|
||
bin/vopher-$(VERSION).darwin.amd64: bin | ||
env GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@ | ||
|
||
bin/vopher-$(VERSION).freebsd.amd64: bin | ||
env GOOS=freebsd GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o $@ | ||
|
||
bin: | ||
mkdir $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters