From aa40084010b5453b3785a7e955df7efb9b91e5b9 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 26 Nov 2024 22:55:01 -0500 Subject: [PATCH] build: Redid this thing in sed to make it work on more platforms. --- GNUmakefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index a0d3956a..90c271ca 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,8 +7,8 @@ MAKEFLAGS += --no-builtin-rules ## ## This is a list of all supported build targets. ## -## Note: Consider passing -j$(nproc) or adding it to your $MAKEFLAGS to build -## in parallel (faster). +## Consider passing -j$(nproc) or adding it to your $MAKEFLAGS to build in +## parallel (faster). ## ## Useful variables to override: ## CC Compiler. @@ -1245,12 +1245,10 @@ clean: ## Clean all generated files from the out/ directory. ## Documentation: ## help: ## Display this help message. - @gawk -vG=$$(tput setaf 2) -vR=$$(tput sgr0) ' \ - match($$0, "^(([^#:]*[^ :]) *:)?([^#]*)##([^#].+|)$$",a) { \ - if (a[2] != "") { printf " make %s%-22s%s %s\n", G, a[2], R, a[4]; next }\ - if (a[3] == "") { print a[4]; next }\ - printf "\n%-36s %s\n","",a[4]\ - }' $(filter-out %.d,$(MAKEFILE_LIST)) + @awk -F: ' \ + /^##/ { sub(/^##\s?/, ""); print $$0 } \ + /^\w+: .*##/ { sub(/^/, ""); sub(/:.*##\s?/, ":"); printf "%-32s %s\n", $$1, $$2 } \ + ' < $(filter-out %.d,$(MAKEFILE_LIST)) @echo "" # Blank line. .PHONY: help .DEFAULT_GOAL := help