Skip to content

Commit ee72d16

Browse files
vdemeestertekton-robot
authored andcommitted
Makefile: fix the all target 🎪
Running `make` should now succeed (and build all `cmd/*` 🙃) Signed-off-by: Vincent Demeester <[email protected]>
1 parent 204a403 commit ee72d16

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ M = $(shell printf "\033[34;1m🐱\033[0m")
2020

2121
export GO111MODULE=on
2222

23+
COMMANDS=$(patsubst cmd/%,%,$(wildcard cmd/*))
24+
BINARIES=$(addprefix bin/,$(COMMANDS))
25+
2326
.PHONY: all
24-
all: fmt lint | $(BIN) ; $(info $(M) building executable…) @ ## Build program binary
25-
$Q $(GO) build \
26-
-tags release \
27-
-ldflags '-X $(MODULE)/cmd.Version=$(VERSION) -X $(MODULE)/cmd.BuildDate=$(DATE)' \
28-
-o $(BIN)/$(basename $(MODULE)) main.go
27+
all: fmt $(BINARIES) | $(BIN) ; $(info $(M) building executable…) @ ## Build program binary
2928

3029
$(BIN):
3130
@mkdir -p $@
@@ -38,7 +37,7 @@ $(BIN)/%: | $(BIN) ; $(info $(M) building $(PACKAGE)…)
3837
FORCE:
3938

4039
bin/%: cmd/% FORCE
41-
$(GO) build -mod=vendor $(LDFLAGS) -v -o $@ ./$<
40+
$Q $(GO) build -mod=vendor $(LDFLAGS) -v -o $@ ./$<
4241

4342
.PHONY: cross
4443
cross: amd64 arm arm64 s390x ppc64le ## build cross platform binaries

0 commit comments

Comments
 (0)