From e42fbbbe9f36cbcf15cab5eb1d128b843e8ba28a Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Sun, 16 Oct 2022 19:14:02 +0400 Subject: [PATCH] [#725] Fix help Signed-off-by: Angira Kekteeva --- Makefile | 7 +++++-- help.mk | 13 ++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e79e1aa7..42a46bd7 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,7 @@ dep: @CGO_ENABLED=0 \ go mod tidy -v && echo OK +# Run `make %` in Golang container, for more information run `make help.docker/%` docker/%: $(if $(filter $*,all $(BINS)), \ @echo "=> Running 'make $*' in clean Docker environment" && \ @@ -111,16 +112,18 @@ docker/lint: version: @echo $(VERSION) -# Clean up +# Clean up files clean: rm -rf .cache rm -rf $(BINDIR) +# Generate code from .proto files protoc: - # Protoc generate @for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \ echo "⇒ Processing $$f "; \ protoc \ --go_out=paths=source_relative:. $$f; \ done rm -rf vendor + +include help.mk diff --git a/help.mk b/help.mk index c065ec86..b5fbbc93 100644 --- a/help.mk +++ b/help.mk @@ -8,4 +8,15 @@ help: @echo '' @echo ' Targets:' @echo '' - @awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq + @awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9.%_/-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq + +# Show help for docker/% IGNORE +help.docker/%: + $(eval TARGETS:=$(notdir all lint) ${BINS}) + @echo ' Usage:' + @echo '' + @echo ' make docker/% -- Run `make %` in Golang container' + @echo '' + @echo ' Supported docker targets:' + @echo '' + @$(foreach bin, $(TARGETS), echo ' ' $(bin);)