fix: Enforce custom LDFLAGS within makefile and add coverage command.

This commit is contained in:
Bo-Yi Wu
2017-01-17 10:44:33 +08:00
parent 9f87268dc0
commit cbbbc4eef0
3 changed files with 8 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ ARCHS ?= amd64 386
PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
SOURCES ?= $(shell find . -name "*.go" -type f)
TAGS ?=
LDFLAGS += -X 'main.Version=$(VERSION)'
LDFLAGS ?= -X 'main.Version=$(VERSION)'
ifneq ($(shell uname), Darwin)
EXTLDFLAGS = -extldflags "-static" $(null)
@@ -127,6 +127,11 @@ endif
docker tag $(DEPLOY_ACCOUNT)/$(EXECUTABLE):latest $(DEPLOY_ACCOUNT)/$(EXECUTABLE):$(tag)
docker push $(DEPLOY_ACCOUNT)/$(EXECUTABLE):$(tag)
coverage:
curl -s https://codecov.io/bash > .codecov && \
chmod +x .codecov && \
./.codecov -f .cover/coverage.txt
clean:
go clean -x -i ./...
find . -name coverage.txt -delete