Skip to content

Instantly share code, notes, and snippets.

@rocknrollMarc
Created March 2, 2015 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rocknrollMarc/547136d61b360c2b6b46 to your computer and use it in GitHub Desktop.
Save rocknrollMarc/547136d61b360c2b6b46 to your computer and use it in GitHub Desktop.
.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