Skip to content

Commit e44eac8

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

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Makefile

Lines changed: 7 additions & 6 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 := netgo)
34-
$(eval LDFLAGS := $(LDFLAGS_BASE) -extldflags '-static')
35-
endif
3635
CGO_ENABLED=0 GOOS=linux go build \
37-
$(if $(GO_BUILDTAGS),-tags "$(GO_BUILDTAGS)") \
38-
-ldflags "$(LDFLAGS)" \
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)