Comment Makefile

This commit is contained in:
Mitchell Hashimoto 2015-01-26 18:19:22 -08:00
parent 918ba4c3be
commit 703a11ed7e
1 changed files with 12 additions and 0 deletions

View File

@ -3,16 +3,21 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf
default: test default: test
# bin generates the releaseable binaries for Terraform
bin: generate bin: generate
@sh -c "'$(CURDIR)/scripts/build.sh'" @sh -c "'$(CURDIR)/scripts/build.sh'"
# dev creates binaries for testing Terraform locally. These are put
# into ./bin/ as well as $GOPATH/bin
dev: generate dev: generate
@TF_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" @TF_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'"
# test runs the unit tests and vets the code
test: generate test: generate
TF_ACC= go test $(TEST) $(TESTARGS) -timeout=30s -parallel=4 TF_ACC= go test $(TEST) $(TESTARGS) -timeout=30s -parallel=4
@$(MAKE) vet @$(MAKE) vet
# testacc runs acceptance tests
testacc: generate testacc: generate
@if [ "$(TEST)" = "./..." ]; then \ @if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package"; \ echo "ERROR: Set TEST to a specific package"; \
@ -20,9 +25,12 @@ testacc: generate
fi fi
TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
# testrace runs the race checker
testrace: generate testrace: generate
TF_ACC= go test -race $(TEST) $(TESTARGS) TF_ACC= go test -race $(TEST) $(TESTARGS)
# updatedeps installs all the dependencies that Terraform needs to run
# and build.
updatedeps: updatedeps:
$(eval REF := $(shell sh -c "\ $(eval REF := $(shell sh -c "\
git symbolic-ref --short HEAD 2>/dev/null \ git symbolic-ref --short HEAD 2>/dev/null \
@ -33,6 +41,8 @@ updatedeps:
go get -f -u -v ./... go get -f -u -v ./...
git checkout $(REF) git checkout $(REF)
# vet runs the Go source code static analysis tool `vet` to find
# any common errors.
vet: vet:
@go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \ @go tool vet 2>/dev/null ; if [ $$? -eq 3 ]; then \
go get golang.org/x/tools/cmd/vet; \ go get golang.org/x/tools/cmd/vet; \
@ -44,6 +54,8 @@ vet:
echo "and fix them if necessary before submitting the code for reviewal."; \ echo "and fix them if necessary before submitting the code for reviewal."; \
fi fi
# generate runs `go generate` to build the dynamically generated
# source files.
generate: generate:
go generate ./... go generate ./...