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