add ldflags to test builds
This commit is contained in:
parent
cd146dc643
commit
5fa031c802
5
Makefile
5
Makefile
@ -1,16 +1,17 @@
|
|||||||
BIN_NAME=gotest
|
BIN_NAME=gotest
|
||||||
PACKAGE_NAME=git.bloy.org/mike/gotest
|
PACKAGE_NAME=git.bloy.org/mike/gotest
|
||||||
GIT_DESCRIBE=$(shell git describe --always --long --dirty)
|
GIT_DESCRIBE=$(shell git describe --always --long --dirty)
|
||||||
|
LDFLAGS="-X ${PACKAGE_NAME}/version.gitDescribe=${GIT_DESCRIBE}"
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
all: test build
|
all: test build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -ldflags "-X ${PACKAGE_NAME}/version.gitDescribe=${GIT_DESCRIBE}"
|
go build -ldflags ${LDFLAGS}
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test ./...
|
go test ./... -ldflags ${LDFLAGS}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
go clean
|
go clean
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user