Fix failure of test 35 when the user has a .autom4te.cfg file.
[autoconf.git] / man / Makefile.am
blob2df4428b9a5e150c26ad50213ff49e9f785c4de7
1 # Make Autoconf man pages.
3 # Copyright (C) 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
4 # Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 dist_man_MANS = \
20         $(srcdir)/autoconf.1 \
21         $(srcdir)/autoheader.1 \
22         $(srcdir)/autom4te.1 \
23         $(srcdir)/autoreconf.1 \
24         $(srcdir)/autoscan.1 \
25         $(srcdir)/autoupdate.1 \
26         $(srcdir)/ifnames.1 \
27         $(srcdir)/config.guess.1 \
28         $(srcdir)/config.sub.1
30 EXTRA_DIST = $(dist_man_MANS:.1=.x) common.x
31 MAINTAINERCLEANFILES = $(dist_man_MANS)
33 # Depend on .version to get version number changes.
34 common_dep = $(top_srcdir)/.version $(srcdir)/common.x
35 binsrcdir = $(top_srcdir)/bin
36 $(srcdir)/autoconf.1:   $(common_dep) $(binsrcdir)/autoconf.as
37 $(srcdir)/autoheader.1: $(common_dep) $(binsrcdir)/autoheader.in
38 $(srcdir)/autom4te.1:   $(common_dep) $(binsrcdir)/autom4te.in
39 $(srcdir)/autoreconf.1: $(common_dep) $(binsrcdir)/autoreconf.in
40 $(srcdir)/autoscan.1:   $(common_dep) $(binsrcdir)/autoscan.in
41 $(srcdir)/autoupdate.1: $(common_dep) $(binsrcdir)/autoupdate.in
42 $(srcdir)/ifnames.1:    $(common_dep) $(binsrcdir)/ifnames.in
44 # Independent from this package.
45 $(srcdir)/config.guess.1: $(top_srcdir)/build-aux/config.guess
46 $(srcdir)/config.sub.1:   $(top_srcdir)/build-aux/config.sub
48 remove_time_stamp = 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
50 MOSTLYCLEANFILES = $(srcdir)/*.t
52 SUFFIXES = .x .1
54 .x.1:
55         @echo "Updating man page $@"
56         PATH="$(top_builddir)/tests$(PATH_SEPARATOR)$(top_srcdir)/build-aux$(PATH_SEPARATOR)$$PATH"; \
57         export PATH; \
58         $(HELP2MAN) \
59             --include=$*.x \
60             --include=$(srcdir)/common.x \
61             --source='$(PACKAGE_STRING)' \
62             --output=$@.t `echo '$*' | sed 's,.*/,,'`
63         if sed $(remove_time_stamp) $@ >$@a.t 2>/dev/null && \
64            sed $(remove_time_stamp) $@.t | cmp $@a.t - >/dev/null 2>&1; then \
65                 touch $@; \
66         else \
67                 mv $@.t $@; \
68         fi
69         rm -f $@*.t