From 6e95440f531b162aac81196834fd261210fa3c59 Mon Sep 17 00:00:00 2001 From: Arjun Raja Yogidas Date: Wed, 30 Oct 2024 20:59:51 +0000 Subject: [PATCH] ci: simplify build target Signed-off-by: Arjun Raja Yogidas --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 45cb607..c9da55e 100644 --- a/Makefile +++ b/Makefile @@ -27,16 +27,17 @@ LDFLAGS_BASE := -X $(PACKAGE)/version.Version=$(VERSION) -X $(PACKAGE)/version.G build: ifeq ($(STATIC),) @echo "Building Dynamic Binary" - $(eval LDFLAGS := $(LDFLAGS_BASE)) + CGO_ENABLED=1 GOOS=linux go build \ + -ldflags "$(LDFLAGS_BASE)" \ + -v -o $(BINARY) $(PACKAGE)/cmd/finch-daemon else @echo "Building Static Binary" - $(eval GO_BUILDTAGS := osusergo netgo) - $(eval LDFLAGS := $(LDFLAGS_BASE) -extldflags '-static') -endif - GOOS=linux go build \ - $(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)") \ - -ldflags "$(LDFLAGS)" \ + CGO_ENABLED=0 GOOS=linux go build \ + -tags netgo \ + -ldflags "$(LDFLAGS_BASE) -extldflags '-static'" \ -v -o $(BINARY) $(PACKAGE)/cmd/finch-daemon +endif + clean: @rm -f $(BINARIES) @rm -rf $(BIN) @@ -125,4 +126,4 @@ coverage: linux .PHONY: release release: linux @echo "$@" - @$(FINCH_DAEMON_PROJECT_ROOT)/scripts/create-releases.sh $(RELEASE_TAG) + @$(FINCH_DAEMON_PROJECT_ROOT)/scripts/create-releases.sh $(RELEASE_TAG) \ No newline at end of file