From ab18cf8327ca5b093f65d7e864e7706d75846a54 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sat, 4 Jun 2016 18:30:47 +0200 Subject: [PATCH] core/pkg-generic: add support for package-defined help Add a package-variable to store the package-specific make rules. Although this variable would be seldom used, we still document it. However, we make sure the documentation explicitly states that this variable should not be used (if it needs to be, the submitter of a package will be told so during reviews). Signed-off-by: "Yann E. MORIN" Cc: Arnout Vandecappelle Cc: Thomas Petazzoni Signed-off-by: Thomas Petazzoni --- Makefile | 1 + docs/manual/adding-packages-generic.txt | 6 ++++++ package/pkg-generic.mk | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 21d63f6ef7..d77b5396cf 100644 --- a/Makefile +++ b/Makefile @@ -937,6 +937,7 @@ help: @echo ' -dirclean - Remove build directory' @echo ' -reconfigure - Restart the build from the configure step' @echo ' -rebuild - Restart the build from the build step' + $(foreach p,$(HELP_PACKAGES),$($(p)_HELP_CMDS)$(sep)) ifeq ($(BR2_PACKAGE_BUSYBOX),y) @echo ' busybox-menuconfig - Run BusyBox menuconfig' endif diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index 8ed7fe8ee2..de8aca20b5 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -497,6 +497,12 @@ different steps of the build process. systemd is selected as the init system in the configuration, only +LIBFOO_INSTALL_INIT_SYSTEMD+ will be run). +* +LIBFOO_HELP_CMDS+ lists the actions to print the package help, which + is included to the main +make help+ output. These commands can print + anything in any format. + This is seldom used, as packages rarely have custom rules. *Do not use + this variable*, unless you really know that you need to print help. + The preferred way to define these variables is: ---------------------- diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index b03187956e..374d9d56c9 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -914,6 +914,10 @@ ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR) $$(error $(2)_SITE ($$($(2)_SITE)) cannot have a trailing slash) endif +ifneq ($$($(2)_HELP_CMDS),) +HELP_PACKAGES += $(2) +endif + endif # $(2)_KCONFIG_VAR endef # inner-generic-package