From 36c1d315bb9ea2ff509b3b5bf92ebe1e67279800 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Fri, 11 Sep 2020 08:33:07 +0100 Subject: [PATCH] =?UTF-8?q?Makefile:=20fix=20the=20all=20target=20?= =?UTF-8?q?=F0=9F=8E=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running `make` should now succeed (and build all `cmd/*` 🙃) Signed-off-by: Vincent Demeester --- Makefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4117589d92b..2560208f697 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,11 @@ M = $(shell printf "\033[34;1m🐱\033[0m") export GO111MODULE=on +COMMANDS=$(patsubst cmd/%,%,$(wildcard cmd/*)) +BINARIES=$(addprefix bin/,$(COMMANDS)) + .PHONY: all -all: fmt lint | $(BIN) ; $(info $(M) building executable…) @ ## Build program binary - $Q $(GO) build \ - -tags release \ - -ldflags '-X $(MODULE)/cmd.Version=$(VERSION) -X $(MODULE)/cmd.BuildDate=$(DATE)' \ - -o $(BIN)/$(basename $(MODULE)) main.go +all: fmt $(BINARIES) | $(BIN) ; $(info $(M) building executable…) @ ## Build program binary $(BIN): @mkdir -p $@ @@ -38,7 +37,7 @@ $(BIN)/%: | $(BIN) ; $(info $(M) building $(PACKAGE)…) FORCE: bin/%: cmd/% FORCE - $(GO) build -mod=vendor $(LDFLAGS) -v -o $@ ./$< + $Q $(GO) build -mod=vendor $(LDFLAGS) -v -o $@ ./$< .PHONY: cross cross: amd64 arm arm64 s390x ppc64le ## build cross platform binaries