[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/22] maint: move man-related syntax checks in cfg.mk
From: |
Stefano Lattarini |
Subject: |
[PATCH 18/22] maint: move man-related syntax checks in cfg.mk |
Date: |
Wed, 29 Aug 2012 23:54:55 +0200 |
This is more natural, now that the top-level Makefile has access to
all the variables and rules once defined only in 'man/Makefile.am'
(that was before the previous commit).
* man/local.mk (all_programs, sc_option_desc_uppercase,
sc_man_file_correlation check-x-vs-1, check-programs-vs-x): Move
from here ...
* cfg.mk: ... to here. Adjust some comments in the process.
Signed-off-by: Stefano Lattarini <address@hidden>
---
cfg.mk | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
man/local.mk | 40 ----------------------------------------
2 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 5f7193e..9da6afa 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -166,16 +166,56 @@ sc_long_lines:
sed -e "s|^|$$file:|" -e '$(FILTER_LONG_LINES)'; \
done | grep . && { msg="$$halt" $(_sc_say_and_exit) } || :
-# Option descriptions should not start with a capital letter
+# Option descriptions should not start with a capital letter.
# One could grep source directly as follows:
# grep -E " {2,6}-.*[^.] [A-Z][a-z]" $$($(VC_LIST_EXCEPT) | grep '\.c$$')
# but that would miss descriptions not on the same line as the -option.
ALL_RECURSIVE_TARGETS += sc_option_desc_uppercase
-sc_option_desc_uppercase: all_programs
-
-# Ensure all man/*.[1x] files are present
+.PHONY: sc_option_desc_uppercase
+sc_option_desc_uppercase:
+ @grep '^\\fB\\-' -A1 *.1 | LC_ALL=C grep '\.1.[A-Z][a-z]' && \
+ { echo 1>&2 '$@: found initial capitals in --help'; \
+ exit 1; } || :;
+sc_option_desc_uppercase: $(dist_man1_MANS) \
+ $(NO_INSTALL_PROGS_DEFAULT:%=%.1) \
+ all_programs
+
+# Ensure all man/*.[1x] files are present.
ALL_RECURSIVE_TARGETS += sc_man_file_correlation
-sc_man_file_correlation: all_programs
+.PHONY: sc_man_file_correlation
+sc_man_file_correlation: check-x-vs-1 check-programs-vs-x
+
+# Ensure that for each .x file in the 'man/' subdirectory, there is a
+# corresponding .1 file in the definition of $(dist_man1_MANS).
+# But since that expansion usually lacks programs like arch and hostname,
+# add them here manually.
+.PHONY: check-x-vs-1
+check-x-vs-1:
+ @PATH=./src$(PATH_SEPARATOR)$$PATH; export PATH; \
+ t=$@-t; \
+ (cd $(srcdir)/man && ls -1 *.x) \
+ | sed 's/\.x$$//' | $(ASSORT) > $$t; \
+ (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \
+ | tr -s ' ' '\n' | sed 's/\.1$$//') \
+ | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \
+ rm $$t
+
+all_programs = \
+ (cd ./src && MAKEFLAGS= $(MAKE) -s all_programs.list) \
+ | grep -v '\['
+
+# Ensure that for each .x file in the 'man/' subdirectory, there is a
+# corresponding coreutils program.
+.PHONY: check-programs-vs-x
+check-programs-vs-x: all_programs
+ @status=0; \
+ for p in dummy `$(all_programs)`; do \
+ test $$p = dummy && continue; \
+ test $$p = ginstall && p=install || : ; \
+ test -f $(srcdir)/man/$$p.x \
+ || { echo missing $$p.x 1>&2; status=1; }; \
+ done; \
+ exit $$status
# Ensure that the end of each release's section is marked by two empty lines.
sc_NEWS_two_empty_lines:
diff --git a/man/local.mk b/man/local.mk
index 7ce4bff..25385eb 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -181,43 +181,3 @@ $(MAN): $(top_srcdir)/src/system.h
&& rm -rf $$t \
&& chmod -w $@-t \
&& mv $@-t $@
-
-# Option descriptions should not start with a capital letter
-.PHONY: sc_option_desc_uppercase
-sc_option_desc_uppercase: $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT:%=%.1)
- @grep '^\\fB\\-' -A1 *.1 | LC_ALL=C grep '\.1.[A-Z][a-z]' && \
- { echo 1>&2 '$@: found initial capitals in --help'; \
- exit 1; } || :;
-
-.PHONY: sc_man_file_correlation
-sc_man_file_correlation: check-x-vs-1 check-programs-vs-x
-
-# Ensure that for each .x file in this directory, there is a
-# corresponding .1 file in the definition of $(dist_man1_MANS) above.
-# But since that expansion usually lacks programs like arch and hostname,
-# add them here manually.
-.PHONY: check-x-vs-1
-check-x-vs-1:
- @PATH=./src$(PATH_SEPARATOR)$$PATH; export PATH; \
- t=$@-t; \
- (cd $(srcdir)/man && ls -1 *.x) \
- | sed 's/\.x$$//' | $(ASSORT) > $$t; \
- (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \
- | tr -s ' ' '\n' | sed 's/\.1$$//') \
- | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \
- rm $$t
-
-all_programs = \
- (cd ./src && MAKEFLAGS= $(MAKE) -s all_programs.list) \
- | grep -v '\['
-
-.PHONY: check-programs-vs-x
-check-programs-vs-x:
- @status=0; \
- for p in dummy `$(all_programs)`; do \
- test $$p = dummy && continue; \
- test $$p = ginstall && p=install || : ; \
- test -f $(srcdir)/man/$$p.x \
- || { echo missing $$p.x 1>&2; status=1; }; \
- done; \
- exit $$status
--
1.7.12
- [PATCH 09/22] build: add an explicative comment, (continued)
- [PATCH 09/22] build: add an explicative comment, Stefano Lattarini, 2012/08/29
- [PATCH 07/22] build: don't define $(SUFFIXES) explicitly, Stefano Lattarini, 2012/08/29
- [PATCH 08/22] maint: simplify definition of $MAN in configure.ac, Stefano Lattarini, 2012/08/29
- [PATCH 10/22] build: fix a stray usage of uninitialized $(ME), Stefano Lattarini, 2012/08/29
- [PATCH 12/22] maint: typofix: s/it's/its/, Stefano Lattarini, 2012/08/29
- [PATCH 11/22] build: rename common_dep -> mandep in man/Makefile, Stefano Lattarini, 2012/08/29
- [PATCH 14/22] build: make some rule less dependent of exact source tree layout, Stefano Lattarini, 2012/08/29
- [PATCH 13/22] build: rely on VPATH capabilities in man/Makefile, Stefano Lattarini, 2012/08/29
- [PATCH 15/22] build: convenience target 'all_programs' at top-level, Stefano Lattarini, 2012/08/29
- [PATCH 16/22] build: rework some recipes in main/Makefile.am, for future changes, Stefano Lattarini, 2012/08/29
- [PATCH 18/22] maint: move man-related syntax checks in cfg.mk,
Stefano Lattarini <=
- [PATCH 20/22] maint: adjust syntax check 'sc_option_desc_uppercase', Stefano Lattarini, 2012/08/29
- [PATCH 19/22] maint: adjust syntax check 'check-x-vs-1', Stefano Lattarini, 2012/08/29
- [PATCH 17/22] build: don't use recursive make to build the 'man' subdirectory, Stefano Lattarini, 2012/08/29
- [PATCH 22/22] maint: update gitignore entries, Stefano Lattarini, 2012/08/29
- [PATCH 21/22] build: remove redundant indirection with variable '$(doc_srcdir)', Stefano Lattarini, 2012/08/29
- Re: [PATCH 00/22] Towards a non-recursive build system for coreutils?, Jim Meyering, 2012/08/29