Merge pull request #873 from justincormack/make-flags
Allow adding additional ldflags and other build flags
This commit is contained in:
commit
eef22d77b4
4
Makefile
4
Makefile
@ -38,7 +38,7 @@ ifeq ("$(GOOS)", "windows")
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
|
GO_TAGS=$(if $(BUILDTAGS),-tags "$(BUILDTAGS)",)
|
||||||
GO_LDFLAGS=-ldflags "-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG)"
|
GO_LDFLAGS=-ldflags "-X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)"
|
||||||
|
|
||||||
# Flags passed to `go test`
|
# Flags passed to `go test`
|
||||||
TESTFLAGS ?=-parallel 8 -race
|
TESTFLAGS ?=-parallel 8 -race
|
||||||
@ -115,7 +115,7 @@ ineffassign: ## run ineffassign
|
|||||||
|
|
||||||
build: ## build the go packages
|
build: ## build the go packages
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
@go build -i -v ${GO_LDFLAGS} ${GO_GCFLAGS} ${PACKAGES}
|
@go build -i -v ${EXTRA_FLAGS} ${GO_LDFLAGS} ${GO_GCFLAGS} ${PACKAGES}
|
||||||
|
|
||||||
test: ## run tests, except integration tests and tests that require root
|
test: ## run tests, except integration tests and tests that require root
|
||||||
@echo "$(WHALE) $@"
|
@echo "$(WHALE) $@"
|
||||||
|
Loading…
Reference in New Issue
Block a user