1 # Makefile for Autoconf.
2 # Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 #### Start of system configuration section. ####
25 INSTALL_PROGRAM = @INSTALL_PROGRAM@
26 INSTALL_DATA = @INSTALL_DATA@
33 # Programs that are ALWAYS installed (and are created in the build dir).
34 ASCRIPTS = autoconf autoheader autoreconf autoupdate ifnames
36 # M4 input that is frozen.
37 M4FROZEN = autoconf.m4f autoheader.m4f
39 # All programs, including those only installed if you have perl.
40 SCRIPTS = $(ASCRIPTS) @SCRIPTS@
42 transform=@program_transform_name@
45 exec_prefix = @exec_prefix@
47 # Directory in which to install scripts.
50 # Directory in which to install library files.
52 acdatadir = $(datadir)/autoconf-2.13
54 # Directory in which to install documentation info files.
57 #### End of system configuration section. ####
63 M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4
65 # Files that can be generated, but should be up to date for a distribution.
66 DISTDEP = info Makefile
67 # Files to distribute.
68 DISTFILES = AUTHORS COPYING ChangeLog ChangeLog.1 INSTALL \
69 Makefile.in NEWS README TODO $(M4FILES) \
70 acconfig.h acfunctions acheaders acidentifiers \
71 acmakevars acprograms autoconf213.info* \
72 autoconf.sh autoconf213.texi install.texi \
73 autoheader.sh autoscan.pl autoreconf.sh autoupdate.sh ifnames.sh \
74 config.guess config.sub configure configure.in \
75 install-sh mkinstalldirs texinfo.tex \
76 testsuite/Makefile.in testsuite/config/*.exp \
77 testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
78 standards.texi make-stds.texi standards.info*
80 editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e \
81 's,@''M4''@,$(M4),g' -e 's,@''AWK''@,$(AWK),g' \
82 -e 's,@''SHELL''@,$(SHELL),g'
83 editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g'
85 all: ${SCRIPTS} ${M4FROZEN} info
88 .SUFFIXES: .sh .pl .m4 .m4f
92 $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
96 $(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
99 @case `$(M4) --help </dev/null 2>&1` in \
100 *reload-state*) echo freezing $*.m4; \
101 $(M4) -F $*.m4f -I${srcdir} ${srcdir}/$*.m4 ;; \
103 *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \
106 autoconf.m4f: autoconf.m4 acgeneral.m4 acspecific.m4 acoldnames.m4
107 autoheader.m4f: autoheader.m4 acgeneral.m4 acspecific.m4 acoldnames.m4
109 info: autoconf213.info @standards_info@ INSTALL
111 # Use --no-split to avoid creating filenames > 14 chars.
112 autoconf213.info: autoconf213.texi install.texi
113 $(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf213.texi --no-split --output=$@
115 INSTALL: install.texi
116 $(MAKEINFO) -I$(srcdir) $(srcdir)/install.texi --output=$@ \
117 --no-headers --no-validate
119 standards.info: standards.texi make-stds.texi
120 $(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --no-split --output=$@
122 dvi: autoconf.dvi @standards_dvi@
124 autoconf.dvi: autoconf213.texi
125 $(TEXI2DVI) $(srcdir)/autoconf213.texi
127 standards.dvi: standards.texi make-stds.texi
128 $(TEXI2DVI) $(srcdir)/standards.texi
131 rootme=`pwd`; srcrootme=`cd $(srcdir); pwd`; \
132 test -r install-sh || cp $(srcdir)/install-sh .; \
133 cd testsuite && ${MAKE} $@ AUTOCONF=$$rootme/autoconf \
134 AUTOCONFFLAGS="-m $$srcrootme"
136 installcheck: all install
137 cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@
140 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)/$(bindir) $(DESTDIR)/$(infodir) $(DESTDIR)/$(acdatadir)
142 install: all $(M4FILES) acconfig.h installdirs install-info
143 for p in $(ASCRIPTS); do \
144 $(INSTALL_PROGRAM) $$p $(DESTDIR)/$(bindir)/`echo $$p|sed '$(transform)'`; \
146 for i in $(M4FROZEN); do \
147 $(INSTALL_DATA) $$i $(DESTDIR)/$(acdatadir)/$$i; \
149 for i in $(M4FILES) acconfig.h; do \
150 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)/$(acdatadir)/$$i; \
152 -if test -f autoscan; then \
153 $(INSTALL_PROGRAM) autoscan $(DESTDIR)/$(bindir)/`echo autoscan|sed '$(transform)'`; \
154 for i in acfunctions acheaders acidentifiers acprograms \
156 $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)/$(acdatadir)/$$i; \
160 # Don't cd, to avoid breaking install-sh references.
161 install-info: info installdirs
162 if test -f autoconf213.info; then \
163 for i in *.info*; do \
164 $(INSTALL_DATA) $$i $(DESTDIR)/$(infodir)/$$i; \
167 for i in $(srcdir)/*.info*; do \
168 $(INSTALL_DATA) $$i $(DESTDIR)/$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
173 for p in $(SCRIPTS); do \
174 rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
177 cd $(infodir) && rm -f autoconf213.info*
178 if test -f standards.info || test -f $(srcdir)/standards.info; \
179 then cd $(infodir) && rm -f standards.info*; fi
181 ${srcdir}/configure: configure.in $(M4FILES)
183 rm -f configure configure.tmp && \
184 $(M4) autoconf.m4 configure.in > configure.tmp && \
185 chmod +x configure.tmp && mv configure.tmp configure
186 Makefile: Makefile.in config.status
187 $(SHELL) ./config.status
188 config.status: configure
189 $(SHELL) ./config.status --recheck
192 @echo "This command is intended for maintainers to use;"
193 @echo "rebuilding the deleted files requires makeinfo."
194 rm -f TAGS *.info* INSTALL
196 clean mostlyclean distclean maintainer-clean::
197 for dir in $(SUBDIRS); do \
198 echo making $@ in $$dir ; \
199 (cd $$dir && $(MAKE) $@) ; \
202 clean mostlyclean distclean maintainer-clean::
203 rm -f $(SCRIPTS) *.tmp
204 rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
205 rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
206 rm -f *.ev *.evs *.ov *.ovs *.cv *.cvs *.ma *.mas
208 distclean maintainer-clean::
209 rm -f Makefile config.status config.cache config.log
212 etags ${srcdir}/*.m4 ${srcdir}/*.sh ${srcdir}/[a-z]*.in ${srcdir}/*.texi
214 # Don't depend on DISTFILES because there's no rule for "standards.info*".
216 distname=`sed -e '/define(AC_ACVERSION,/!d' \
217 -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \
219 mkdir $$distname $$distname/testsuite $$distname/testsuite/config \
220 $$distname/testsuite/lib $$distname/testsuite/autoconf.g \
221 $$distname/testsuite/autoconf.s; \
222 for file in $(DISTFILES); do \
223 ln $$file $$distname/$$file \
224 || { echo copying $$file instead; cp -p $$file $$distname/$$file;}; \
226 chmod -R a+rX $$distname; \
227 tar -chz -f $$distname.tar.gz $$distname; \