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
|
||||
PACKAGE_NAME=git.bloy.org/mike/gotest
|
||||
GIT_DESCRIBE=$(shell git describe --always --long --dirty)
|
||||
LDFLAGS="-X ${PACKAGE_NAME}/version.gitDescribe=${GIT_DESCRIBE}"
|
||||
|
||||
default: all
|
||||
|
||||
all: test build
|
||||
|
||||
build:
|
||||
go build -ldflags "-X ${PACKAGE_NAME}/version.gitDescribe=${GIT_DESCRIBE}"
|
||||
go build -ldflags ${LDFLAGS}
|
||||
|
||||
test:
|
||||
go test ./...
|
||||
go test ./... -ldflags ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
go clean
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user