[Top][All Lists]
[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
- [bug-cppi] use mostly-non-recursive make, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 01/19] build: remove use of vestigial rm_subst, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 04/19] maint: man: use dist_man1_MANS, rather than dist_man_MANS, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 02/19] update bootstrap; don't recurse into lib/ or src/, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 08/19] maint: .gitignore: ignore/adjust a few more, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 03/19] maint: remove useless artifacts copied from coreutils, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 09/19] build: remove obsolete settings from cfg.mk, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 10/19] maint: update init.sh from gnulib, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 11/19] maint: remove redundant build output, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 05/19] build: don't recurse into man/ when building,
Jim Meyering <=
- [bug-cppi] [PATCH 07/19] build: don't recurse into tests/ when building, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 12/19] maint: use gnulib's getopt-gnu, not the deprecated getopt module, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 13/19] maint: tweak m4 quoting in AC_CONFIG_FILES, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 06/19] tests: add the help-version test, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 14/19] build: part two of using subdir-objects: handle e.g., GETOPT_H, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 17/19] version 1.16, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 18/19] maint: post-release administrivia, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 15/19] build: don't depend on help2man when building from dist tarball, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 16/19] doc: NEWS: mention our non-recursive make scheme, Jim Meyering, 2012/01/25
- [bug-cppi] [PATCH 19/19] build: don't require /usr/bin/perl, Jim Meyering, 2012/01/25