Skip to content

Commit 233d424

Browse files
committed
ci: simplify build target
Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent f4c7019 commit 233d424

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ LDFLAGS_BASE := -X $(PACKAGE)/version.Version=$(VERSION) -X $(PACKAGE)/version.G
2727
build:
2828
ifeq ($(STATIC),)
2929
@echo "Building Dynamic Binary"
30-
$(eval LDFLAGS := $(LDFLAGS_BASE))
30+
CGO_ENABLED=1 GOOS=linux go build \
31+
-ldflags "$(LDFLAGS_BASE)" \
32+
-v -o $(BINARY) $(PACKAGE)/cmd/finch-daemon
3133
else
3234
@echo "Building Static Binary"
33-
$(eval GO_BUILDTAGS := osusergo netgo)
34-
$(eval LDFLAGS := $(LDFLAGS_BASE) -extldflags '-static')
35-
endif
36-
GOOS=linux go build \
37-
$(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)") \
38-
-ldflags "$(LDFLAGS)" \
35+
CGO_ENABLED=0 GOOS=linux go build \
36+
-tags netgo \
37+
-ldflags "$(LDFLAGS_BASE) -extldflags '-static'" \
3938
-v -o $(BINARY) $(PACKAGE)/cmd/finch-daemon
39+
endif
40+
4041
clean:
4142
@rm -f $(BINARIES)
4243
@rm -rf $(BIN)

0 commit comments

Comments
 (0)