From 6b4a84628475c24947e9c61a7dc1f53ee2060ee8 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sun, 9 Feb 2025 22:20:16 +0100 Subject: [PATCH] note makefile help --- system/Makefiles.md | 2 ++ system/Makefiles/help.md | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 system/Makefiles/help.md diff --git a/system/Makefiles.md b/system/Makefiles.md index 22057a8..30f0c61 100644 --- a/system/Makefiles.md +++ b/system/Makefiles.md @@ -183,3 +183,5 @@ In this case, the makefile can see that `backup` depends on the current backup f - [File patterns](Makefiles/patterns.md) - [Makefile graphs](Makefiles/graph-easy.md) +- [In-build help](Makefiles/help.md) +- [Makefile graphs](Makefiles/graph-easy.md) diff --git a/system/Makefiles/help.md b/system/Makefiles/help.md new file mode 100644 index 0000000..028634a --- /dev/null +++ b/system/Makefiles/help.md @@ -0,0 +1,18 @@ +--- +title: "Makefiles" +tags: [ "system", "makefiles", "help" ] +--- + +Make your first target 'help' to give an overview of the main targets. +Running `make help` will search for text which starts with `## ` and show what that target does. + +```make +help: ## Print the help message + @awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \ + sort | \ + column -s ':' -t + +clean: ## Remove generated files + $(RM) $(defaults) +``` +