summaryrefslogtreecommitdiff
path: root/man/local.mk
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-09-01 01:46:48 +0200
committerJim Meyering <meyering@redhat.com>2012-09-01 21:28:12 +0200
commit59da6f1e6fb5701fe2a78ebe4a7841d0d1b3ef7a (patch)
treea1b0b25c5f0eaaebc87e36d6f607f7e38914e278 /man/local.mk
parent380d9da0b01c86aa11a7e83279fe7baebed6aad7 (diff)
downloadcoreutils-59da6f1e6fb5701fe2a78ebe4a7841d0d1b3ef7a.tar.xz
build: simplify and make more portable to non-GNU make
The AC_SUBST'd variable '$(NO_INSTALL_PROGS_DEFAULT)' is only used in makefile expressions expanding the list of manual pages that are not built by default (but might need to be when a distribution tarball is created). Such expressions exploited a feature of make variable expansion -- namely, $(VAR:%=dir/%.x) -- that, while seemingly quite portable in practice, is not POSIX-conforming, and could break on lesser vendor make implementations. So kill two birds with one stone, by getting rid of the $(NO_INSTALL_PROGS_DEFAULT) intermediate variable and improving makefile portability in the process. While at it, we also clean up some other minor naming inconsistency and useless indirection. * configure.ac (NO_INSTALL_PROGS_DEFAULT): Don't define or AC_SUBST anymore; instead ... (EXTRA_MANS): ... define and AC_SUBST these. * man/local.mk (extra_man_1): Rename ... (EXTRA_MANS): ... like this, explicitly making clear it's AC_SUBST'd. (extra_man_x): It's used only once, no need to define it; just inline its only expansion where needed. (EXTRA_DIST): Adjust. (ALL_MANS): New, union of $(EXTRA_MANS) and $(dist_man1_MANS). * cfg.mk (check-x-vs-1, sc_option_desc_uppercase): Rely on $(ALL_MANS) rather than on $(NO_INSTALL_PROGS_DEFAULT) and $(dist_man1_MANS).
Diffstat (limited to 'man/local.mk')
-rw-r--r--man/local.mk12
1 files changed, 5 insertions, 7 deletions
diff --git a/man/local.mk b/man/local.mk
index 80519afce..f48744291 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -23,20 +23,18 @@ man_aux = $(dist_man1_MANS:.1=.x)
EXTRA_DIST += $(man_aux) man/help2man
MAINTAINERCLEANFILES += $(dist_man1_MANS)
-# The "$(VAR:%=dir/%.x)" idiom is not portable according to POSIX, but in
-# practice it works with several make implementation (GNU, BSD, CCS make
-# from Solaris 10, Sun distributed make).
-extra_man_x = $(NO_INSTALL_PROGS_DEFAULT:%=man/%.x)
-extra_man_1 = $(NO_INSTALL_PROGS_DEFAULT:%=man/%.1)
+EXTRA_MANS = @EXTRA_MANS@
-EXTRA_DIST += $(extra_man_1) $(extra_man_x)
+EXTRA_DIST += $(EXTRA_MANS) $(EXTRA_MANS:.1=.x)
+
+ALL_MANS = $(dist_man1_MANS) $(EXTRA_MANS)
# This is required because we have subtle inter-directory dependencies:
# in order to generate all man pages, even those for which we don't
# install a binary, require that all programs be built at distribution
# time. We can't use 'dist-hook' for this, since it would run too late:
# the manpages must be generated before the distdir is created and filled.
-$(extra_man_1): $(all_programs)
+$(EXTRA_MANS): $(all_programs)
# Depend on this to get version number changes.
mandep = .version