add ldflags to test builds

This commit is contained in:
Mike Bloy 2019-08-25 09:50:17 -05:00
parent cd146dc643
commit 5fa031c802

View File

@ -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