[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/22] build: rework some recipes in main/Makefile.am, for future
From: |
Stefano Lattarini |
Subject: |
[PATCH 16/22] build: rework some recipes in main/Makefile.am, for future changes |
Date: |
Wed, 29 Aug 2012 23:54:53 +0200 |
This change is merely required to make future changes easier.
In particular, since we are going to merge the contents of
'man/Makefile.am' in the top-level Makefile, we need to avoid
conflicts with the rules and variables in 'dist-check.mk', and
to prepare for changes in the value of the '$*' variable in the
recipe of the '.x -> .1' suffix rule.
* man/Makefile.am (t, mapped_name): Delete, inlining their use ...
(.1.x): ... in the recipe of this suffix rule. Other adjustments
to prepare to changes in the value of the '$*' automatic variable.
While at it, made more resilient about unlikely but possible failure.
Adjust and reorder few comments.
Signed-off-by: Stefano Lattarini <address@hidden>
---
man/Makefile.am | 54 +++++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/man/Makefile.am b/man/Makefile.am
index ff1c1ab..f7db996 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -148,38 +148,38 @@ yes.1: $(mandep) ../src/yes.c
# provoke regeneration of all $(MAN) files.
$(MAN): $(top_srcdir)/src/system.h
-# Ensure that help2man runs the ../src/ginstall binary as
-# 'install' when creating install.1.
-# Similarly, ensure that it uses the ../src/[ binary to create test.1.
-t = $*.td
-mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'`
-
-# Note the use of $t/$*, rather than just '$*' as in other packages.
-# That is necessary to avoid failures for programs that are also shell built-in
-# functions like echo, false, printf, pwd.
.x.1:
$(AM_V_GEN)case '$(PERL)' in \
*"/missing "*) \
echo 'WARNING: cannot update man page $@ since perl is missing' \
'or inadequate' 1>&2 \
- ;; \
- *) \
- rm -f $@ $@-t \
- && { \
- rm -rf $t; \
- mkdir $t; \
- (cd $t && $(LN_S) $(abs_top_builddir)/src/$(mapped_name) $*); \
- $(PERL) -- $(srcdir)/help2man \
- --source='$(PACKAGE_STRING)' \
- --include=$(srcdir)/$*.x \
- --output=$t/$@ $t/$*; \
- } \
- && sed 's|$*\.td/||g' $t/$@ > $@-t \
- && rm -rf $t \
- && chmod -w $@-t \
- && mv $@-t $@ \
- ;; \
- esac
+ exit 0;; \
+ esac; \
+ name=`echo $@ | sed -e 's|.*/||' -e 's|\.1$$||'` || exit 1; \
+## Ensure that help2man runs the 'src/ginstall' binary as 'install' when
+## creating 'install.1'. Similarly, ensure that it uses the 'src/[' binary
+## to create 'test.1'.
+ case $$name in \
+ install) prog='ginstall';; \
+ test) prog='[';; \
+ *) prog=$$name;; \
+ esac; \
+## Note the use of $$t/$*, rather than just '$*' as in other packages.
+## That is necessary to avoid failures for programs that are also shell
+## built-in functions like echo, false, printf, pwd.
+ rm -f $@ $@-t \
+ && t=$*.td \
+ && rm -rf $$t \
+ && mkdir $$t \
+ && (cd $$t && $(LN_S) $(abs_top_builddir)/src/$$prog $$name) \
+ && $(PERL) -- $(srcdir)/help2man \
+ --source='$(PACKAGE_STRING)' \
+ --include=$(srcdir)/$$name.x \
+ --output=$$t/$$name.1 $$t/$$name \
+ && sed 's|$*\.td/||g' $$t/$$name.1 > $@-t \
+ && rm -rf $$t \
+ && chmod -w $@-t \
+ && mv $@-t $@
# Option descriptions should not start with a capital letter
.PHONY: sc_option_desc_uppercase
--
1.7.12
- [PATCH 06/22] build: don't use recursive make to build the 'doc' subdirectory, (continued)
- [PATCH 06/22] build: don't use recursive make to build the 'doc' subdirectory, Stefano Lattarini, 2012/08/29
- [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 <=
- [PATCH 18/22] maint: move man-related syntax checks in cfg.mk, Stefano Lattarini, 2012/08/29
- [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