From 6bbba84914df6f9527c464ec2755aaa5f86791c4 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 13 Apr 2015 15:10:57 -0700 Subject: [PATCH] adding makefile for easy running of lint, vet, etc... --- Makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..02c6d4d1b3 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +# Set an output prefix, which is the local directory if not specified +PREFIX?=$(shell pwd) + +vet: + @echo "+ $@" + @go vet ./... + +fmt: + @echo "+ $@" + @test -z "$$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" || \ + echo "+ please format Go code with 'gofmt -s'" + +lint: + @echo "+ $@" + @test -z "$$(golint ./... | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" + +build: + @echo "+ $@" + @go build -v ${GO_LDFLAGS} ./... + +test: + @echo "+ $@" + @go test -test.short ./... + +test-full: + @echo "+ $@" + @go test ./... + +binaries: ${PREFIX}/bin/registry ${PREFIX}/bin/registry-api-descriptor-template ${PREFIX}/bin/dist + @echo "+ $@" + +clean: + @echo "+ $@" + @rm -rf "${PREFIX}/bin/registry" "${PREFIX}/bin/registry-api-descriptor-template"