git » kxd » commit 4492360

Makefile: Add $GOFLAGS support

author Alberto Bertogli
2024-08-15 21:35:47 UTC
committer Alberto Bertogli
2024-09-08 09:33:09 UTC
parent 32c43082d6b4d5a3b7bc4385c593b61105bc9991

Makefile: Add $GOFLAGS support

This patch allows the use of the $GOFLAGS environment variable when
building the binaries, to help with customization and scripting (e.g.
for coverage analysis).

Makefile +3 -3

diff --git a/Makefile b/Makefile
index 5c4ae18..6eb43f7 100644
--- a/Makefile
+++ b/Makefile
@@ -5,16 +5,16 @@ OUTDIR = ./out
 default: kxd kxc kxgencert
 
 kxd:
-	$(GO) build -o $(OUTDIR)/kxd ./kxd
+	$(GO) build ${GOFLAGS} -o $(OUTDIR)/kxd ./kxd
 
 kxgencert:
-	$(GO) build -o $(OUTDIR)/kxgencert ./kxgencert
+	$(GO) build ${GOFLAGS} -o $(OUTDIR)/kxgencert ./kxgencert
 
 # For the client, because it can be run in a very limited environment without
 # glibc (like initramfs), we build it using the native go networking so it can
 # work even when glibc's resolvers are missing.
 kxc:
-	$(GO) build --tags netgo -a -o $(OUTDIR)/kxc ./kxc
+	$(GO) build ${GOFLAGS} --tags netgo -a -o $(OUTDIR)/kxc ./kxc
 
 fmt:
 	gofmt -s -w .