From 5fa031c802c064689143657e26feef3092771814 Mon Sep 17 00:00:00 2001 From: Mike Bloy Date: Sun, 25 Aug 2019 09:50:17 -0500 Subject: [PATCH] add ldflags to test builds --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8831987..d47d2a4 100644 --- a/Makefile +++ b/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