Skip to content

Commit

Permalink
Update makefile to use Glide. Add static linking with non CGO and non…
Browse files Browse the repository at this point in the history
… debug linking.
  • Loading branch information
Paul Otto committed Apr 25, 2018
1 parent 455f43d commit b17a937
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)

default: build

build: fmtcheck
go install
build: vendor fmtcheck
@rm -rf build/
@mkdir -p build/
CGO_ENABLED=0 go build -ldflags '-w -extldflags "-static"' -o build/terraform-provider-apigee

GLIDE := $(shell command -v glide 2> /dev/null)
ifndef GLIDE
$(error "glide is not available. Install using `curl https://glide.sh/get | sh`")
endif
vendor: glide.yaml ## Install vendor dependencies
glide update --no-recursive

test: fmtcheck
go test -i $(TEST) || exit 1
Expand Down Expand Up @@ -32,9 +41,6 @@ fmtcheck:
errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

vendor-status:
@govendor status

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
Expand All @@ -43,4 +49,4 @@ test-compile:
fi
go test -c $(TEST) $(TESTARGS)

.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile
.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile

0 comments on commit b17a937

Please sign in to comment.