Created
March 11, 2019 11:47
-
-
Save tjstebbing/10820c758f28b9ac346939bd91dd902c to your computer and use it in GitHub Desktop.
golang makefile
This file contains hidden or 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
VERSION ?=0.0.1 | |
BUILD_TIME :=$(date -u '+%Y-%m-%d_%I:%M:%S%p') | |
BRANCH :=`git rev-parse --abbrev-ref HEAD` | |
COMMIT :=`git rev-parse HEAD` | |
LDFLAGS=-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILD_TIME} -X main.COMMIT=${COMMIT} -X main.BRANCH=${BRANCH}" | |
BINARY :="surge" | |
default: build/sitemap.xml | |
surge: vendor | |
go build ${LDFLAGS} -o $(BINARY) cmd/surge/main.go | |
vendor: | |
dep ensure | |
build/sitemap.xml: ./surge build | |
./sh/buildmaps.sh $(VERSION) | |
build: | |
mkdir -p build/sitemap | |
clean: | |
rm -rf ./build* | |
rm ./surge | |
reallyclean: clean | |
rm -f ./surge | |
rm -rf ./vendor | |
deploy: build/sitemap.xml | |
./sh/deploy.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment