diff mbox series

[3/3] Makefile: Improve 'make help'

Message ID 20240104211935.1438103-4-petr.vorel@gmail.com
State Changes Requested
Headers show
Series Improve make | expand

Commit Message

Petr Vorel Jan. 4, 2024, 9:19 p.m. UTC
From: Petr Vorel <pvorel@suse.cz>

Describe most useful targets.
Exit 0 (it's not a failure to see help).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 Makefile | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

Comments

Cyril Hrubis March 18, 2024, 4:06 p.m. UTC | #1
Hi!
> index 49d91f4d5..7c9d1217a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -216,8 +216,36 @@ test-metadata: metadata-all
>  ## Help
>  .PHONY: help
>  help:
> -	@echo "Please read the Configuration section in $(top_srcdir)/INSTALL"
> -	@exit 1
> +	@echo 'Cleaning:'
> +	@echo '  clean              - delete all files created by build'
> +	@echo '  distclean          - delete all non-source files'
> +	@echo '  lib-clean          - delete all files created by build in lib directory (C API library and tests)'
> +	@echo '  libs-clean         - delete all files created by build in libs directory (other libraries)'
> +	@echo '  testcases-clean    - delete all files created by build in testcases directory (tests)'
> +	@echo
> +	@echo 'Build:'
> +	@echo '  all                - build everything'
> +	@echo '  autotools          - preparation for configure'
> +	@echo '  lib-all            - build lib directory (C API library and tests)'
> +	@echo '  libs-all           - build libs directory (other libraries)'
> +	@echo '  testcases-all      - build testcases and their dependencies'
> +	@echo
> +	@echo 'Install:'
> +	@echo '  install            - install all files created by build'
> +	@echo '  install-lib        - install files in lib directory (C API library and tests)'
> +	@echo '  install-libs       - install files in libs directory (other libraries)'
> +	@echo '  install-testcases  - install testcases'

I'm not sure if the sub-targets should be described in make help. I
would say to stick to a simple set of clean, distclean, autotools, all,
install, doc, check and be done with it.

> +	@echo 'Documentation:'
> +	@echo '  doc                - create test documentation (HTML and/or PDF, based on configuration)'
> +	@echo
> +	@echo 'Testing:'
> +	@echo '  test               - run all tests'
> +	@echo '  test-c             - run C API tests'
> +	@echo '  test-metadata      - run documentation tests'
> +	@echo '  test-shell         - run shell API tests'

This is way to confusing, we shouldn't mention the internal testsuite
here users will confuse that with actually running LTP tests.

We should instead probably mention the make check.

> +	@echo 'For more info please read the Configuration section in $(top_srcdir)/INSTALL'

That file should be probably updated too.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 49d91f4d5..7c9d1217a 100644
--- a/Makefile
+++ b/Makefile
@@ -216,8 +216,36 @@  test-metadata: metadata-all
 ## Help
 .PHONY: help
 help:
-	@echo "Please read the Configuration section in $(top_srcdir)/INSTALL"
-	@exit 1
+	@echo 'Cleaning:'
+	@echo '  clean              - delete all files created by build'
+	@echo '  distclean          - delete all non-source files'
+	@echo '  lib-clean          - delete all files created by build in lib directory (C API library and tests)'
+	@echo '  libs-clean         - delete all files created by build in libs directory (other libraries)'
+	@echo '  testcases-clean    - delete all files created by build in testcases directory (tests)'
+	@echo
+	@echo 'Build:'
+	@echo '  all                - build everything'
+	@echo '  autotools          - preparation for configure'
+	@echo '  lib-all            - build lib directory (C API library and tests)'
+	@echo '  libs-all           - build libs directory (other libraries)'
+	@echo '  testcases-all      - build testcases and their dependencies'
+	@echo
+	@echo 'Install:'
+	@echo '  install            - install all files created by build'
+	@echo '  install-lib        - install files in lib directory (C API library and tests)'
+	@echo '  install-libs       - install files in libs directory (other libraries)'
+	@echo '  install-testcases  - install testcases'
+	@echo
+	@echo 'Documentation:'
+	@echo '  doc                - create test documentation (HTML and/or PDF, based on configuration)'
+	@echo
+	@echo 'Testing:'
+	@echo '  test               - run all tests'
+	@echo '  test-c             - run C API tests'
+	@echo '  test-metadata      - run documentation tests'
+	@echo '  test-shell         - run shell API tests'
+	@echo
+	@echo 'For more info please read the Configuration section in $(top_srcdir)/INSTALL'
 
 ## Menuconfig
 menuconfig: