From 5cf4b3a79fef86dce790f4173fa1cd1f58ebf42e Mon Sep 17 00:00:00 2001
From: Mark Polesky <markpolesky@yahoo.com>
Date: Tue, 19 Jan 2010 19:21:56 -0800
Subject: [PATCH] Clean up `make help' output.

* Reformat output to fit 80-column terminals.
* Replace "@echo -e" with multiple lines of "@echo"
    (distros implement the -e option differently).
---
 Documentation/GNUmakefile               | 45 +++++++++++++----------
 GNUmakefile.in                          | 17 +++++----
 stepmake/stepmake/generic-targets.make  | 49 +++++++++++++------------
 stepmake/stepmake/texinfo-targets.make  |  9 +++--
 stepmake/stepmake/toplevel-targets.make | 45 +++++++++++++----------
 5 files changed, 90 insertions(+), 75 deletions(-)

diff --git a/Documentation/GNUmakefile b/Documentation/GNUmakefile
index 50f3ff672f..9592e548c5 100644
--- a/Documentation/GNUmakefile
+++ b/Documentation/GNUmakefile
@@ -56,7 +56,7 @@ TEXI_FILES_FROM_TELY = $(outdir)/internals.texi
 
 PDF_FILES = $(TEXINFO_MANUALS:%=$(outdir)/%.pdf)
 
-TOPDIR_HTML_MANUALS = 
+TOPDIR_HTML_MANUALS =
 UNSPLITTED_HTML_MANUALS =
 SPLITTED_HTML_MANUALS = $(foreach manual, $(TEXINFO_MANUALS),\
  $(if $(findstring $(manual), $(UNSPLITTED_HTML_MANUALS)),,$(manual)))
@@ -78,7 +78,7 @@ INFO_DOCS = lilypond-usage lilypond-changes lilypond-contributor lilypond-intern
  lilypond-essay lilypond-learning lilypond-notation music-glossary \
  lilypond-web lilypond-extending
 ifeq ($(out),www)
-INFO_DOCS += lilypond-snippets 
+INFO_DOCS += lilypond-snippets
 endif
 INFO_FILES = $(INFO_DOCS:%=$(outdir)/%.info)
 
@@ -109,23 +109,30 @@ default: local-txt-doc
 local-help: extra-local-help
 
 extra-local-help:
-	@echo -e "\
-  check-xrefs [ISOLANG=LL] validate Texinfo cross-references\n\
-  fix-xrefs [ISOLANG=LL]   interactively fix Texinfo cross-references (use with caution)\n\
-  info        update info pages\n\
-  xml	      update Docbook xml documentation\n\
-\n\
-Translations specific targets (see TRANSLATION for details):\n\
-  new-lang ISOLANG=LL  create and initialize subdirectory \'LL' for language \'LL\n\
-(if \'LL exists, update missing file)\n\
-  po-update            update and replace PO files for documentation with msgmerged versions\n\
-  check-translation ISOLANG=LL   show changes in English docs since last translation update\n\
-  update-translation ISOLANG=LL  call $$$$EDITOR to help updating the translation\n\
-  skeleton-update ISOLANG=LL     update Texinfo skeleton files\n\
-  snippet-update ISOLANG=LL      update ly snippets in Texinfo translation according to\n\
-                              docs in English (use with caution)\n\
-\n\
-LL refers to the desired locale (most often only the ISO 639 language code).\n"
+	@echo "  check-xrefs [ISOLANG=LL] validate Texinfo cross-references"
+	@echo "  fix-xrefs [ISOLANG=LL]   interactively fix Texinfo cross-references"
+	@echo "                             (use with caution)"
+	@echo "  info                     update info pages"
+	@echo "  xml                      update Docbook xml documentation"
+	@echo
+	@echo "Translations specific targets (see TRANSLATION for details):"
+	@echo "  new-lang ISOLANG=LL           create and initialize"
+	@echo "                                  subdirectory \'LL' for language \'LL"
+	@echo "                                  (if \'LL exists, update missing file)"
+	@echo "  po-update                     update and replace PO files for"
+	@echo "                                  documentation with msgmerged versions"
+	@echo "  check-translation ISOLANG=LL  show changes in English docs since"
+	@echo "                                  last translation update"
+	@echo "  update-translation ISOLANG=LL call $$$$EDITOR to help updating"
+	@echo "                                  the translation"
+	@echo "  skeleton-update ISOLANG=LL    update Texinfo skeleton files"
+	@echo "  snippet-update ISOLANG=LL     update ly snippets in Texinfo translation"
+	@echo "                                  according to docs in English"
+	@echo "                                  (use with caution)"
+	@echo
+	@echo "  LL refers to the desired locale"
+	@echo "    (most often only the ISO 639 language code)."
+	@echo
 
 info: $(INFO_FILES)
 	@echo export LILYPOND_DATADIR=$(LILYPOND_DATADIR)
diff --git a/GNUmakefile.in b/GNUmakefile.in
index ca98bf838c..ef32c0080f 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -39,7 +39,7 @@ LOCALSTEPMAKE_TEMPLATES=lilypond
 include $(depth)/make/stepmake.make
 
 
-local-dist: refresh-release-files dist-toplevel-txt-files 
+local-dist: refresh-release-files dist-toplevel-txt-files
 
 all: $(outdir)/VERSION
 
@@ -156,9 +156,9 @@ build-dir-setup: $(tree-share-prefix)/lilypond-force
 
 PO_FILES = $(call src-wildcard,$(src-depth)/po/*.po)
 HELP_CATALOGS = $(PO_FILES:po/%.po=%)
-CATALOGS = $(HELP_CATALOGS:lilypond=) 
+CATALOGS = $(HELP_CATALOGS:lilypond=)
 
-$(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION 
+$(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
 # Preparing LilyPond tree for build-dir exec
 	cd $(top-build-dir)/$(outbase) && rm -rf bin lib share
 	mkdir -p $(tree-bin)
@@ -247,18 +247,19 @@ RESULT_DIR=$(top-build-dir)/out/test-results
 
 
 test:
-	@echo -en 'For tracking crashes: use\n\n\t'
-	@echo 'grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
+	@echo 'For tracking crashes: use'
+	@echo
+	@echo '        grep sourcefilename `grep -L systems.texi out/lybook-db/*/*log|sed s/log/ly/g`'
 	@echo
 	$(MAKE) -C input/regression/ out=test local-test
 	$(MAKE) -C input/regression/musicxml out=test local-test
 	$(MAKE) -C input/regression/abc2ly out=test local-test
 
-test-baseline: 
+test-baseline:
 	@if test -d .git ; then \
 		$(if $(shell git diff), echo "commit before base lining" && false,true) ; \
 	fi
-	$(MAKE) 
+	$(MAKE)
 	$(MAKE) test
 	$(MAKE) out=test -C input/regression/ local-test-baseline
 	$(MAKE) out=test -C input/regression/musicxml local-test-baseline
@@ -270,7 +271,7 @@ local-check: test
 	rm -rf $(RESULT_DIR)
 	mkdir -p $(RESULT_DIR)
 	$(buildscript-dir)/output-distance --create-images --output-dir $(RESULT_DIR) input/regression/out-test-baseline input/regression/out-test/
-	@find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g' 
+	@find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs grep '\\version' -L | grep -v "standard input" |sed 's/^/**** Missing version: /g'
 
 
 test-redo:
diff --git a/stepmake/stepmake/generic-targets.make b/stepmake/stepmake/generic-targets.make
index eddf25a671..dcb196c4dc 100644
--- a/stepmake/stepmake/generic-targets.make
+++ b/stepmake/stepmake/generic-targets.make
@@ -47,32 +47,33 @@ config:
 
 
 generic-help:
-	@echo -e "\
-Makefile for $(PACKAGE_NAME) $(TOPLEVEL_VERSION)\n\
-Usage: make ["VARIABLE=value"]... [TARGET]\n\
-\n\
-Targets specific to current directory:\n"
+	@echo "Makefile for $(PACKAGE_NAME) $(TOPLEVEL_VERSION)"
+	@echo "Usage: make ["VARIABLE=value"]... [TARGET]"
+	@echo
+	@echo "Targets specific to current directory:"
 
 help: generic-help local-help
-	@echo -e "Generic targets:\n\
-  all *       update everything except documentation with images\n\
-  clean *     remove all generated stuff in $(outdir)\n\
-  bin-clean * same as clean, except that mf/out is preserved\n\
-  default     same as the empty target\n\
-  doc *       update documentation with images in directory \`out-www'\n\
-  doc-stage-1 * update only PDF and Info documentation in directory \`out-www'\n\
-  doc-clean * clean \`out-www' directory\n\
-  exe         update all executables\n\
-  help        this help\n\
-  install *   install programs and data (prefix=$(prefix))\n\
-  lib         update all libraries\n\
-  uninstall*  uninstall programs and data\n\
-  TAGS        generate tagfiles\n\
-\n\
-\`make' may be invoked from any subdirectory.\n\
-Note that all commands marked with a star (*) recurse into subdirectories;\n\
-prepend \`local-' to restrict operation to the current directory.\n\
-Example: \`local-clean'."
+	@echo "Generic targets that recurse into subdirectories*:"
+	@echo "  all          update everything except documentation with images"
+	@echo "  clean        remove all generated stuff in $(outdir)"
+	@echo "  bin-clean    same as clean, except that mf/out is preserved"
+	@echo "  doc          update documentation with images in directory \`out-www'"
+	@echo "  doc-stage-1  update only PDF and Info documentation in directory \`out-www'"
+	@echo "  doc-clean    clean \`out-www' directory"
+	@echo "  install      install programs and data (prefix=$(prefix))"
+	@echo "  uninstall    uninstall programs and data"
+	@echo
+	@echo "  *Note: Prepend \`local-' (eg. \`local-clean') to restrict"
+	@echo "         any of the above commands to the current directory."
+	@echo
+	@echo "Other generic targets:"
+	@echo "  default      same as the empty target"
+	@echo "  exe          update all executables"
+	@echo "  help         this help"
+	@echo "  lib          update all libraries"
+	@echo "  TAGS         generate tagfiles"
+	@echo
+	@echo "\`make' may be invoked from any subdirectory."
 
 local-help:
 
diff --git a/stepmake/stepmake/texinfo-targets.make b/stepmake/stepmake/texinfo-targets.make
index 36a2e92da5..df3fe8347e 100644
--- a/stepmake/stepmake/texinfo-targets.make
+++ b/stepmake/stepmake/texinfo-targets.make
@@ -163,8 +163,9 @@ texinfo-all-menus-update:
 local-help: local-texinfo-help
 
 local-texinfo-help:
-	@echo -e "\
-  info [out=www]  update Info documentation (use \`out=www' for having images)\n\
-  install-info [out=www]   install Info documentation (idem)\n\
-  texinfo-all-menus-update update node menus in Texinfo source files (use with caution)\n"
+	@echo "  info [out=www]           update Info documentation"
+	@echo "                             (use \`out=www' for having images)"
+	@echo "  install-info [out=www]   install Info documentation (idem)"
+	@echo "  texinfo-all-menus-update update node menus in Texinfo source files"
+	@echo "                             (use with caution)"
 
diff --git a/stepmake/stepmake/toplevel-targets.make b/stepmake/stepmake/toplevel-targets.make
index 1c590b0447..d07d80f0d1 100644
--- a/stepmake/stepmake/toplevel-targets.make
+++ b/stepmake/stepmake/toplevel-targets.make
@@ -56,24 +56,29 @@ dist:
 	rm -rf $(distdir)/
 
 local-help:
-	@echo -e "\
-  config      rerun configure\n\
-  dist        roll tarball: $(depth)/$(outdir)/$(distname).tar.gz\n\
-  distclean   also remove configure output\n\
-  cvs-clean   also remove out directories and generated files\n\
-  maintainerclean also remove distributed generated files\n\
-  po          make new translation Portable Object database\n\
-  po-replace  do po-update and replace catalogs with msgmerged versions\n\
-  po-update   update translation Portable Object database\n\
-\n\
-  install-doc install website documentation in (webdir=$(webdir))\n\
-              and Info documentation with images\n\
-  uninstall-doc remove installed documentation with images\n\
-  info        build Info documentation with images\n\
-  install-info  install Info documentation with images\n\
-\n\
-Some more targets are available for testing changes:\n\
-  test-baseline  check  test-redo  test-clean\n\
-For more information on these targets, see Testing LilyPond\n\
-in Application Usage documentation.\n"
+	@echo "  config          rerun configure"
+	@echo "  dist            roll tarball: $(depth)/$(outdir)/$(distname).tar.gz"
+	@echo "  distclean       also remove configure output"
+	@echo "  cvs-clean       also remove out directories and generated files"
+	@echo "  maintainerclean also remove distributed generated files"
+	@echo "  po              make new translation Portable Object database"
+	@echo "  po-replace      do po-update and replace catalogs with msgmerged versions"
+	@echo "  po-update       update translation Portable Object database"
+	@echo
+	@echo "  install-doc     install website documentation in"
+	@echo "                    (webdir=$(webdir))"
+	@echo "                    and Info documentation with images"
+	@echo "  uninstall-doc   remove installed documentation with images"
+	@echo "  info            build Info documentation with images"
+	@echo "  install-info    install Info documentation with images"
+	@echo
+	@echo "Some more targets are available for testing changes:"
+	@echo "  test-baseline"
+	@echo "  check"
+	@echo "  test-redo"
+	@echo "  test-clean"
+	@echo
+	@echo "  For more information on these targets, see"
+	@echo "    \`Testing LilyPond' in the Contributor's Guide."
+	@echo
 
-- 
2.39.5