forked from planetdecred/godcr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add makefile Using a makefile would enable building a binary with build flags & variables while targeting multiple os. * Update readme
- Loading branch information
Showing
5 changed files
with
72 additions
and
22 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
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
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,28 @@ | ||
# This how we want to name the binary output | ||
BINARY=godcr | ||
|
||
VERSION="0.0.1" | ||
BUILD=`date -u +"%Y-%m-%dT%H:%M:%SZ"` | ||
# dev or prod | ||
BuildEnv="prod" | ||
|
||
LDFLAGS=-ldflags "-w -s -X main.Version=${VERSION} -X main.BuildDate=${BUILD} -X main.BuildEnv=${BuildEnv}" | ||
|
||
export GOARCH=amd64 | ||
|
||
all: clean darwin windows | ||
|
||
freebsd: | ||
GOOS=freebsd go build -trimpath ${LDFLAGS} -o ${BINARY}-freebsd-${GOARCH} | ||
|
||
darwin: | ||
GOOS=darwin go build -trimpath ${LDFLAGS} -o ${BINARY}-darwin-${GOARCH} | ||
|
||
windows: | ||
GOOS=windows go build -trimpath ${LDFLAGS} -o ${BINARY}-windows-${GOARCH}.exe | ||
|
||
# Cleans our project: deletes old binaries | ||
clean: | ||
-rm -f ${BINARY}-* | ||
|
||
.PHONY: clean darwin windows |
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
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