1
1
mirror of https://github.com/wader/fq.git synced 2024-11-25 23:13:19 +03:00

make: Move build flags to vars

This commit is contained in:
Mattias Wadman 2021-10-05 12:36:06 +02:00
parent ac106d9ca5
commit b0694f55cd

View File

@ -1,9 +1,12 @@
GO_BUILD_FLAGS=-trimpath
GO_BUILD_LDFLAGS=-s -w
all: test fq
.PHONY: fq
fq: VERSION=$(shell git describe --all --long --dirty 2>/dev/null || echo nogit)
fq:
CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=${VERSION}" -trimpath -o fq .
CGO_ENABLED=0 go build -o fq -ldflags "${GO_BUILD_LDFLAGS} -X main.version=${VERSION}" "${GO_BUILD_FLAGS}" .
.PHONY: test
test: testgo testjq testcli