Subject: bug#12411: 24.2.50; No `make help' target?

From: Stefan Kangas <[email-masked]>
Date: Wed, 21 Aug 2019 01:09:32 +0200

Stefan Monnier <[email-masked]> writes:

>> sed -n 's/^\([a-z]*\):.*/\1/p' Makefile  # plus uniq...
>> They are all pretty much standard targets, and documented at the top of
>> the Makefile.
>
> It's not always easy to find the doc corresponding to a given target, so
> I think it would indeed be a good idea to make "make help" return some
> useful info.
> I also think it would be a valuable addition to the GNU coding standards.
> Just like all commands should accept a "--help", it would make sense for
> the main Makefile to do something useful with "make help".

How about something like the attached patch?

I'm not a Makefile expert, so I couldn't find a way to skip the
configure step and immediately echo.

Thanks,
Stefan Kangas
From dc823516bc8085bfbab97d90395a33c884a24738 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Wed, 21 Aug 2019 01:02:43 +0200
Subject: [PATCH] Add new "make help" target

* Makefile.in: Add new "help" target with a brief summary of the
available targets.  (Bug#12411)
* INSTALL: Announce it.
---
 INSTALL     |  3 +++
 Makefile.in | 24 ++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/INSTALL b/INSTALL
index 6934022c4e..e9caff1501 100644
--- a/INSTALL
+++ b/INSTALL
@@ -109,6 +109,9 @@ sections if you need to.
   (provided you have the 'gzip' program) those installed Lisp source (.el)
   files that have corresponding .elc versions, as well as the Info files.
 
+  You can read a brief summary about other common make targets:
+
+                make help
 
 ADDITIONAL DISTRIBUTION FILES
 
diff --git a/Makefile.in b/Makefile.in
index aa11e6b0b7..afdb86b518 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1178,6 +1178,30 @@ check-declare:
 	$(MAKE) -C lisp $@
 	$(MAKE) -C test $@
 
+.PHONY: help
+
+help:
+	@echo ""
+	@echo "NOTE:  This is a brief summary of some common make targets."
+	@echo "For more detailed information, please read the files INSTALL,"
+	@echo "INSTALL.REPO, Makefile or visit this URL:"
+	@echo "http://www.gnu.org/prep/standards/html_node/Standard-Targets.html"
+	@echo ""
+	@echo "make all              -- compile and build Emacs"
+	@echo "make install          -- install it"
+	@echo "make TAGS             -- update tags tables"
+	@echo "make clean            -- delete files from build"
+	@echo "make mostlyclean      -- delete most files from build"
+	@echo "make distclean        -- delete files from build and configure"
+	@echo "make maintainer-clean -- delete almost everything that can be regenerated"
+	@echo "make bootstrap        -- delete all files and force a new bootstrap"
+	@echo "make uninstall        -- delete all installed files"
+	@echo "make check            -- run the Emacs test suite"
+	@echo "make docs             -- generate Emacs documentation"
+	@echo "make html             -- generate html documentation"
+	@echo "make ps               -- generate ps documentation"
+	@echo "make pdf              -- generate pdf documentation"
+
 .PHONY: gitmerge
 
 GITMERGE_EMACS = ./src/emacs${EXEEXT}
-- 
2.20.1