github.com/kardianos/nomad@v0.1.3-0.20151022182107-b13df73ee850/Makefile (about) 1 PACKAGES = $(shell go list ./...) 2 VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \ 3 -nilfunc -printf -rangeloops -shift -structtags -unsafeptr 4 EXTERNAL_TOOLS=\ 5 github.com/tools/godep \ 6 github.com/mitchellh/gox \ 7 golang.org/x/tools/cmd/cover \ 8 golang.org/x/tools/cmd/vet 9 10 all: test 11 12 dev: deps format 13 @NOMAD_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" 14 15 bin: 16 @sh -c "'$(CURDIR)/scripts/build.sh'" 17 18 release: updatedeps 19 @$(MAKE) bin 20 21 cov: 22 gocov test ./... | gocov-html > /tmp/coverage.html 23 open /tmp/coverage.html 24 25 deps: 26 @echo "--> Installing build dependencies" 27 @DEP_ARGS="-d -v" sh -c "'$(CURDIR)/scripts/deps.sh'" 28 29 updatedeps: deps 30 @echo "--> Updating build dependencies" 31 @DEP_ARGS="-d -f -u" sh -c "'$(CURDIR)/scripts/deps.sh'" 32 33 test: deps 34 @sh -c "'$(CURDIR)/scripts/test.sh'" 35 @$(MAKE) vet 36 37 cover: deps 38 go list ./... | xargs -n1 go test --cover 39 40 format: deps 41 @echo "--> Running go fmt" 42 @go fmt $(PACKAGES) 43 44 vet: 45 @go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \ 46 go get golang.org/x/tools/cmd/vet; \ 47 fi 48 @echo "--> Running go tool vet $(VETARGS) ." 49 @go tool vet $(VETARGS) . ; if [ $$? -eq 1 ]; then \ 50 echo ""; \ 51 echo "Vet found suspicious constructs. Please check the reported constructs"; \ 52 echo "and fix them if necessary before submitting the code for reviewal."; \ 53 fi 54 55 web: 56 ./scripts/website_run.sh 57 58 web-push: 59 ./scripts/website_push.sh 60 61 # bootstrap the build by downloading additional tools 62 bootstrap: 63 @for tool in $(EXTERNAL_TOOLS) ; do \ 64 echo "Installing $$tool" ; \ 65 go get $$tool; \ 66 done 67 68 .PHONY: all bin cov deps integ test vet web web-push test-nodep