Created
March 2, 2015 10:54
-
-
Save rocknrollMarc/547136d61b360c2b6b46 to your computer and use it in GitHub Desktop.
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
.PHONY: build doc fmt lint run test vendor_clean vendor_get vendor_update vet | |
# Prepend our _vendor directory to the system GOPATH | |
# so that import path resolution will prioritize | |
# our third party snapshots. | |
GOPATH := ${PWD}/_vendor:${GOPATH} | |
export GOPATH | |
default: build | |
build: vet | |
go build -v -o ./bin/main_app ./src/main_app | |
doc: | |
godoc --http=:6060 -index | |
# http://golang.org/cmd/go/#hdr-Run_gofmt_on_package_sources | |
fmt: | |
go fmt ./src/... | |
# https://github.com/golang/lint | |
# go get github.com/golang/lint/golint | |
lint: | |
golint ./src | |
test: | |
go test ./src/... | |
vendor_clean: | |
rm -dRf ./_vendor/src | |
# We have to set GOPATH to just the _vendor | |
# directory to ensure that `go get` doesn't | |
# update packages in our primary GOPATH instead. | |
# This will happen if you already have the package | |
# installed in GOPATH since `go get` will use | |
# that existing location as the destination. | |
vendor_get: vendor_clean | |
GOPATH=${PWD}/_vendor go get -d -u -v \ | |
github.com/jpoehls/gophermail \ | |
github.com/codegangsta/martini | |
vendor_update: vendor_get | |
rm -rf `find ./_vendor/src -type d -name .git` \ | |
&& rm -rf `find ./_vendor/src -type d -name .hg` \ | |
&& rm -rf `find ./_vendor/src -type d -name .bzr` \ | |
&& rm -rf `find ./_vendor/src -type d -name .svn` | |
# http://godoc.org/code.google.com/p/go.tools/cmd/vet | |
# go get code.google.com/p/go.tools/cmd/vet | |
run: | |
hugo server -w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment