Created
August 5, 2015 20:09
-
-
Save madhums/45efcb78d5d0d654191f to your computer and use it in GitHub Desktop.
Makefile for golang projects
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 dev test vet godep install bench | |
PKG_NAME=$(shell basename `pwd`) | |
install: | |
go get -t -v ./... | |
build: vet \ | |
test \ | |
go build -v -o ./bin/$(PKG_NAME) | |
doc: | |
godoc -http=:6060 | |
fmt: | |
go fmt ./... | |
# https://github.com/golang/lint | |
# go get github.com/golang/lint/golint | |
lint: | |
golint ./... | |
dev: | |
DEBUG=* go get && go install && gin -p 8911 -i | |
test: | |
go test ./... | |
# Runs benchmarks | |
bench: | |
go test ./... -bench=. | |
# https://godoc.org/golang.org/x/tools/cmd/vet | |
vet: | |
go vet ./... | |
godep: | |
godep save ./... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment