bug-cppi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cppi] [PATCH 05/19] build: don't recurse into man/ when building


From: Jim Meyering
Subject: [bug-cppi] [PATCH 05/19] build: don't recurse into man/ when building
Date: Wed, 25 Jan 2012 09:22:42 +0100

From: Jim Meyering <address@hidden>

* man/local.mk: New file, derived from...
* man/Makefile.am: ... this file.  Remove file.
* Makefile.am: Include man/local.mk.
(SUBDIRS): Remove "man".
* configure.ac (AC_CONFIG_FILES): Remove man/Makefile.
---
 Makefile.am     |    5 ++-
 configure.ac    |    3 +-
 man/Makefile.am |   50 ----------------------------------------------
 man/local.mk    |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 63 insertions(+), 54 deletions(-)
 delete mode 100644 man/Makefile.am
 create mode 100644 man/local.mk

diff --git a/Makefile.am b/Makefile.am
index 582803e..b18eadd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 ## Process this file with automake to produce Makefile.in.

 AUTOMAKE_OPTIONS = subdir-objects
-SUBDIRS = po . tests man
+SUBDIRS = po . tests

 ACLOCAL_AMFLAGS = -I m4

@@ -42,5 +42,6 @@ SUFFIXES =

 include lib/local.mk
 include src/local.mk
-# FIXME include man/local.mk
+include man/local.mk
+
 # FIXME include tests/local.mk
diff --git a/configure.ac b/configure.ac
index abad6e4..c4efbea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,7 +86,6 @@ AM_GNU_GETTEXT_VERSION([0.17])
 AC_CONFIG_FILES(
   Makefile
   po/Makefile.in
-  tests/Makefile
-  man/Makefile)
+  tests/Makefile)

 AC_OUTPUT
diff --git a/man/Makefile.am b/man/Makefile.am
deleted file mode 100644
index 053bd30..0000000
--- a/man/Makefile.am
+++ /dev/null
@@ -1,50 +0,0 @@
-## Process this file with automake to produce Makefile.in -*-Makefile-*-
-dist_man1_MANS = cppi.1
-
-man_aux = $(dist_man1_MANS:.1=.x)
-EXTRA_DIST = $(man_aux)
-MAINTAINERCLEANFILES = $(dist_man1_MANS)
-
-# Depend on .version to get version number changes.
-common_dep = $(top_srcdir)/.version
-
-cppi.1:        $(common_dep)   $(srcdir)/cppi.x        ../src/cppi.c
-
-SUFFIXES = .x .1
-
-.x.1:
-       $(AM_V_GEN)echo "Updating man page $@";                 \
-       PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH;        \
-       $(HELP2MAN)                                             \
-           --include=$(srcdir)/$*.x                            \
-           --output=$@ $*$(EXEEXT)
-
-check-local: check-x-vs-1 check-programs-vs-x
-
-# Sort in traditional ASCII order, regardless of the current locale;
-# otherwise we may get into trouble with distinct strings that the
-# current locale considers to be equal.
-ASSORT = LC_ALL=C sort
-
-# Ensure that for each .x file in this directory, there is a
-# corresponding .1 file in the definition of $(dist_man1_MANS) above.
-.PHONY: check-x-vs-1
-check-x-vs-1:
-       $(AM_V_GEN)t=ls-files.$$$$;                                     \
-       (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
-       echo $(dist_man1_MANS) | fmt -w1 | sed 's/\.1$$//' | $(ASSORT)  \
-         | diff - $$t || { rm $$t; exit 1; };                          \
-       rm $$t
-
-programs =                                                             \
-  echo 'spy:;@echo $$(all_programs)'                                   \
-    | MAKEFLAGS= $(MAKE) -s -C .. -f Makefile -f - spy                 \
-    | fmt -1 | $(ASSORT) -u
-
-.PHONY: check-programs-vs-x
-check-programs-vs-x:
-       $(AM_V_GEN)for p in `$(programs)`; do           \
-         test -f $(srcdir)/$$p.x                       \
-           || { echo missing $$p.x 1>&2; missing=1; }; \
-       done;                                           \
-       test "$$missing" = 1 && exit 1 || :
diff --git a/man/local.mk b/man/local.mk
new file mode 100644
index 0000000..db5d9fe
--- /dev/null
+++ b/man/local.mk
@@ -0,0 +1,59 @@
+## Process this file with automake to produce Makefile.in -*-Makefile-*-
+dist_man1_MANS = man/cppi.1
+
+man_aux = $(dist_man1_MANS:.1=.x)
+EXTRA_DIST += $(man_aux)
+MAINTAINERCLEANFILES += $(dist_man1_MANS)
+
+# Depend on .version to get version number changes.
+common_dep = $(top_srcdir)/.version
+
+man/cppi.1: $(common_dep) $(srcdir)/man/cppi.x src/cppi
+
+SUFFIXES += .x .1
+
+# FIXME: when we depend on GNU make, remove $$prog; use $(*F) in its place
+# Also, use a %.1: man/%.x pattern rule and remove the mkdir (required for
+# non-srcdir builds).
+.x.1:
+       $(AM_V_GEN)echo "Updating man page $@";                 \
+       mkdir -p man;                                           \
+       PATH=src$(PATH_SEPARATOR)$$PATH; export PATH;           \
+       prog=`basename $*`;                                     \
+       $(HELP2MAN)                                             \
+           --include=$(srcdir)/$*.x                            \
+           --output=$@ $$prog$(EXEEXT)
+
+check-local: check-x-vs-1 check-programs-vs-x
+
+# Sort in traditional ASCII order, regardless of the current locale;
+# otherwise we may get into trouble with distinct strings that the
+# current locale considers to be equal.
+ASSORT = LC_ALL=C sort
+
+# Ensure that for each .x file in this directory, there is a
+# corresponding .1 file in the definition of $(dist_man1_MANS) above.
+.PHONY: check-x-vs-1
+check-x-vs-1:
+       $(AM_V_GEN)t=ls-files.$$$$;                                     \
+       (cd $(srcdir)/man && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
+       echo $(dist_man1_MANS) | tr -s ' ' '\015' | sed 's,man/,,;s/\.1$$//' \
+          | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; };          \
+       rm $$t
+
+programs =                                                             \
+  echo 'spy:;@echo $$(PROGRAMS)'                                       \
+    | MAKEFLAGS= $(MAKE) -s -f Makefile -f - spy                       \
+    | tr -s ' ' '\015' | sed 's,.*/,,' | $(ASSORT) -u
+
+.PHONY: check-programs-vs-x
+check-programs-vs-x:
+       $(AM_V_GEN)for p in `$(programs)`; do           \
+         test -f $(srcdir)/man/$$p.x                   \
+           || { echo missing $$p.x 1>&2; missing=1; }; \
+       done;                                           \
+       test "$$missing" = 1 && exit 1 || :
+
+# This is a kludge to remove man/cppi.1 from a non-srcdir build.
+distclean-local:
+       test 'x$(srcdir)' = 'x$(builddir)' && : || rm -f $(dist_man1_MANS)
-- 
1.7.9.rc2.2.g183d6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]