1 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
3 ## Makefile for Autoconf.
4 ## Copyright 1999, 2000, 2001 Free Software 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 2, or (at your option)
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, write to the Free Software
18 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 AUTOMAKE_OPTIONS = check-news 1.4 readme-alpha
23 SUBDIRS = . config m4 man doc tests
26 ## There is currently no means with Automake not to run aclocal.
27 ACLOCAL_AMFLAGS = --version >/dev/null && touch aclocal.m4
30 bin_SCRIPTS = autoconf autoheader autoreconf ifnames @PERLSCRIPTS@
31 EXTRA_SCRIPTS = autoscan autoupdate
34 # s/distpackageDATA/dist_pkgdata_DATA/
35 # s/nodistpackageDATA/nodist_pkgdata_DATA/
36 # and adapt dependencies once we use a more recent Automake
38 m4sources = m4sugar.m4 m4sh.m4 \
39 $(srcdir)/acversion.m4 \
41 acgeneral.m4 acoldnames.m4 acspecific.m4 aclang.m4 \
42 acfunctions.m4 acheaders.m4 actypes.m4
44 distpkgdataDATA = acfunctions acheaders acidentifiers acmakevars acprograms \
45 aclibraries $(m4sources)
47 nodistpkgdataDATA = autoconf.m4f
49 pkgdata_DATA = $(distpkgdataDATA) $(nodistpkgdataDATA)
51 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 \
54 autoconf.in autoheader.in autoreconf.in autoupdate.in ifnames.in \
57 GNUmakefile Makefile.maint
59 # Files that should be removed, but which Automake does not know:
60 # the frozen files and the scripts.
61 CLEANFILES = autoconf.m4f \
65 ## ------------------ ##
66 ## Maintainer rules. ##
67 ## ------------------ ##
71 # - acversion.m4 needs to be updated only once, since it depends on
72 # configure.ac, not on the results of a 'configure' run.
73 # - It is guaranteed (with GNU Make) that when the version in configure.ac
74 # is changed, acversion.m4 is built only after the new version number is
75 # propagated to the Makefile. (Libtool uses the same guarantee.)
77 $(srcdir)/acversion.m4: $(srcdir)/acversion.in $(srcdir)/configure.ac
78 sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/acversion.in >acversion.tm4
79 mv acversion.tm4 $(srcdir)/acversion.m4
83 # INSTALL is a special case. Automake seems to have a single name space
84 # for both targets and variables. If we just use INSTALL, then the var
85 # $(INSTALL) is not defined, and the install target fails.
86 MAKEINFO = @MAKEINFO@ --no-headers --no-validate --no-split
87 INSTALL.txt: $(top_srcdir)/doc/install.texi
88 $(MAKEINFO) $(top_srcdir)/doc/install.texi --output=$(srcdir)/INSTALL.txt
89 cp $(srcdir)/INSTALL.txt $(srcdir)/INSTALL
91 MAINTAINERCLEANFILES = acversion.m4 INSTALL.txt
94 ## maintainer-check ##
95 maintainer-check: maintainer-check-tests
96 maintainer-check-tests:
97 cd tests && make maintainer-check
99 ## ----------------------------------- ##
100 ## Special installation instructions. ##
101 ## ----------------------------------- ##
103 install-data-hook: INSTALL.txt
105 @list='INSTALL'; for p in $$list; do \
106 if test -f "$$p.txt"; then d= ; else d="$(srcdir)/"; fi; \
107 f="`echo $$p | sed -e 's|^.*/||'`"; \
108 echo " $(INSTALL_DATA) $$d$$p.txt $(DESTDIR)$(pkgdatadir)/$$f"; \
109 $(INSTALL_DATA) $$d$$p.txt $(DESTDIR)$(pkgdatadir)/$$f; \
118 -e 's,@SHELL\@,$(SHELL),g' \
119 -e 's,@PERL\@,$(PERL),g' \
120 -e 's,@datadir\@,$(pkgdatadir),g' \
121 -e 's,@bindir\@,$(bindir),g' \
122 -e 's,@autoconf-name\@,'`echo autoconf | sed '$(transform)'`',g' \
123 -e 's,@autoheader-name\@,'`echo autoheader | sed '$(transform)'`',g' \
124 -e 's,@M4\@,$(M4),g' \
125 -e 's,@AWK\@,$(AWK),g' \
126 -e 's,@VERSION\@,$(VERSION),g' \
127 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g'
129 ## All the scripts below depend on configure.ac so that they are rebuilt
130 ## when the Autoconf version changes. Unfortunately, suffix rules cannot
131 ## have additional dependencies, so we have to use explicit rules for
134 autoconf: $(srcdir)/autoconf.in $(srcdir)/configure.ac
135 rm -f autoconf autoconf.tmp
136 $(edit) $(srcdir)/autoconf.in >autoconf.tmp
137 chmod +x autoconf.tmp
138 mv autoconf.tmp autoconf
140 autoheader: $(srcdir)/autoheader.in $(srcdir)/configure.ac
141 rm -f autoheader autoheader.tmp
142 $(edit) $(srcdir)/autoheader.in >autoheader.tmp
143 chmod +x autoheader.tmp
144 mv autoheader.tmp autoheader
146 autoreconf: $(srcdir)/autoreconf.in $(srcdir)/configure.ac
147 rm -f autoreconf autoreconf.tmp
148 $(edit) $(srcdir)/autoreconf.in >autoreconf.tmp
149 chmod +x autoreconf.tmp
150 mv autoreconf.tmp autoreconf
152 autoupdate: $(srcdir)/autoupdate.in $(srcdir)/configure.ac
153 rm -f autoupdate autoupdate.tmp
154 $(edit) $(srcdir)/autoupdate.in >autoupdate.tmp
155 chmod +x autoupdate.tmp
156 mv autoupdate.tmp autoupdate
158 ifnames: $(srcdir)/ifnames.in $(srcdir)/configure.ac
159 rm -f ifnames ifnames.tmp
160 $(edit) $(srcdir)/ifnames.in >ifnames.tmp
162 mv ifnames.tmp ifnames
164 autoscan: $(srcdir)/autoscan.in $(srcdir)/configure.ac
165 rm -f autoscan autoscan.tmp
166 $(edit) $(srcdir)/autoscan.in >autoscan.tmp
167 chmod +x autoscan.tmp
168 mv autoscan.tmp autoscan
171 ## ------------------ ##
172 ## The frozen files. ##
173 ## ------------------ ##
176 # When processing the file with diversion disabled, there must be no
177 # output but comments and empty lines.
178 # If freezing produces output, something went wrong: a bad `divert',
179 # or an improper paren etc.
180 # It may happen that the output does not end with a end of line, hence
181 # force an end of line when reporting errors.
183 $(M4) --include $(srcdir) --fatal-warning --define divert \
184 $(srcdir)/$*.m4 2>error.log | \
185 sed 's/#.*//;/^$$/d' >process.log
186 if grep . error.log >/dev/null 2>&1; then \
187 echo "ERROR: Processing $(srcdir)/$*.m4 produced errors:" >&2; \
188 sed "s,^,$(srcdir)/$*.m4: ," <error.log >&2; \
194 if grep . process.log >/dev/null 2>&1; then \
195 echo "ERROR: Processing $(srcdir)/$*.m4 produced output:" >&2; \
196 sed "s,^,$(srcdir)/$*.m4: ," <process.log >&2; \
202 $(M4) --include $(srcdir) --fatal-warning --freeze-state=$*.m4f \
203 $(srcdir)/$*.m4 >freeze.log
204 if grep . freeze.log >/dev/null 2>&1; then \
205 echo "ERROR: Freezing $(srcdir)/$*.m4 produced output:" >&2; \
206 sed "s,^,$(srcdir)/$*.m4: ," <freeze.log >&2; \
213 autoconf.m4f: $(m4sources)
216 ## ---------------------------- ##
217 ## Customizing Makefile.maint. ##
218 ## ---------------------------- ##
220 prev_version_file = $(srcdir)/config/prev-version.txt
221 release_archive_dir = releases
225 alpha_host = alpha.gnu.org
226 alpha_url_dir = gnu/autoconf
228 # Files to update automatically.
229 wget_files = $(srcdir)/config/config.guess $(srcdir)/config/config.sub \
230 $(srcdir)/config/texinfo.tex \
231 $(srcdir)/doc/standards.texi $(srcdir)/doc/make-stds.texi