From 878cc5cacffdf58f387a5b24c4085b40b48038c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=BCller?= Date: Thu, 16 Jan 2025 17:21:18 +0100 Subject: [PATCH] Makefile: Enhance and improve help Enhance help for undocumented targets and improve developer usability by leveraging inline comments, like in the other repos. --- Makefile | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 4bf4acd..ca48e59 100644 --- a/Makefile +++ b/Makefile @@ -74,18 +74,13 @@ PACKAGE_NAME_COMMIT = image-builder-cli-$(COMMIT) # .PHONY: help -help: +help: ## Print this usage information @echo "make [TARGETS...]" @echo @echo "This is the maintenance makefile of image-builder. The following" @echo "targets are available:" @echo - @echo " help: Print this usage information." - @echo " rpm: Build the RPM" - @echo " srpm: Build the source RPM" - @echo " scratch: Quick scratch build of RPM" - @echo " clean: Remove all built binaries" - @echo " lint: Run all known linters" + @awk 'match($$0, /^([a-zA-Z_\/-]+):.*? ## (.*)$$/, m) {printf " \033[36m%-30s\033[0m %s\n", m[1], m[2]}' $(MAKEFILE_LIST) | sort $(BUILDDIR)/: mkdir -p "$@" @@ -102,11 +97,11 @@ $(BUILDDIR)/%/: # .PHONY: build -build: $(BUILDDIR)/bin/ +build: $(BUILDDIR)/bin/ ## build the binary from source go build -o $