1 | # Makefile for Autoconf. |
---|
2 | # Copyright (C) 1992, 1993, 1994, 1998 Free Software Foundation, Inc. |
---|
3 | |
---|
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) |
---|
7 | # any later version. |
---|
8 | |
---|
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. |
---|
13 | |
---|
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 |
---|
17 | # 02111-1307, USA. |
---|
18 | |
---|
19 | #### Start of system configuration section. #### |
---|
20 | |
---|
21 | srcdir = @srcdir@ |
---|
22 | VPATH = @srcdir@ |
---|
23 | |
---|
24 | INSTALL = @INSTALL@ |
---|
25 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
26 | INSTALL_DATA = @INSTALL_DATA@ |
---|
27 | MAKEINFO = makeinfo |
---|
28 | TEXI2DVI = texi2dvi |
---|
29 | M4 = @M4@ |
---|
30 | AWK = @AWK@ |
---|
31 | PERL = /usr/athena/bin/perl |
---|
32 | |
---|
33 | # Programs that are ALWAYS installed (and are created in the build dir). |
---|
34 | ASCRIPTS = autoconf autoheader autoreconf autoupdate ifnames |
---|
35 | |
---|
36 | # M4 input that is frozen. |
---|
37 | M4FROZEN = autoconf.m4f autoheader.m4f |
---|
38 | |
---|
39 | # All programs, including those only installed if you have perl. |
---|
40 | SCRIPTS = $(ASCRIPTS) autoscan |
---|
41 | |
---|
42 | transform=@program_transform_name@ |
---|
43 | |
---|
44 | prefix = @prefix@ |
---|
45 | exec_prefix = @exec_prefix@ |
---|
46 | |
---|
47 | # Directory in which to install scripts. |
---|
48 | bindir = @bindir@ |
---|
49 | |
---|
50 | # Directory in which to install library files. |
---|
51 | datadir = @datadir@ |
---|
52 | acdatadir = $(datadir)/autoconf |
---|
53 | |
---|
54 | # Directory in which to install documentation info files. |
---|
55 | infodir = @infodir@ |
---|
56 | |
---|
57 | #### End of system configuration section. #### |
---|
58 | |
---|
59 | SHELL = @SHELL@ |
---|
60 | |
---|
61 | SUBDIRS = testsuite |
---|
62 | |
---|
63 | M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 autoheader.m4 |
---|
64 | |
---|
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 autoconf.info* \ |
---|
72 | autoconf.sh autoconf.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* |
---|
79 | |
---|
80 | editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e \ |
---|
81 | 's,@''M4''@,/usr/athena/bin/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' |
---|
84 | |
---|
85 | all: ${SCRIPTS} ${M4FROZEN} |
---|
86 | |
---|
87 | .SUFFIXES: |
---|
88 | .SUFFIXES: .sh .pl .m4 .m4f |
---|
89 | |
---|
90 | .sh: |
---|
91 | rm -f $@ $@.tmp |
---|
92 | $(editsh) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@ |
---|
93 | |
---|
94 | .pl: |
---|
95 | rm -f $@ $@.tmp |
---|
96 | $(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@ |
---|
97 | |
---|
98 | .m4.m4f: |
---|
99 | @case `$(M4) --help </dev/null 2>&1` in \ |
---|
100 | *reload-state*) echo freezing $*.m4; \ |
---|
101 | $(M4) -F $*.m4f -I${srcdir} ${srcdir}/$*.m4 ;; \ |
---|
102 | *traditional*) ;; \ |
---|
103 | *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \ |
---|
104 | esac |
---|
105 | |
---|
106 | autoconf.m4f: autoconf.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 |
---|
107 | autoheader.m4f: autoheader.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 |
---|
108 | |
---|
109 | info: autoconf.info @standards_info@ INSTALL |
---|
110 | |
---|
111 | # Use --no-split to avoid creating filenames > 14 chars. |
---|
112 | autoconf.info: autoconf.texi install.texi |
---|
113 | $(MAKEINFO) -I$(srcdir) $(srcdir)/autoconf.texi --no-split --output=$@ |
---|
114 | |
---|
115 | INSTALL: install.texi |
---|
116 | $(MAKEINFO) -I$(srcdir) $(srcdir)/install.texi --output=$@ \ |
---|
117 | --no-headers --no-validate |
---|
118 | |
---|
119 | standards.info: standards.texi make-stds.texi |
---|
120 | $(MAKEINFO) -I$(srcdir) $(srcdir)/standards.texi --no-split --output=$@ |
---|
121 | |
---|
122 | dvi: autoconf.dvi @standards_dvi@ |
---|
123 | |
---|
124 | autoconf.dvi: autoconf.texi |
---|
125 | $(TEXI2DVI) $(srcdir)/autoconf.texi |
---|
126 | |
---|
127 | standards.dvi: standards.texi make-stds.texi |
---|
128 | $(TEXI2DVI) $(srcdir)/standards.texi |
---|
129 | |
---|
130 | check: all |
---|
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" |
---|
135 | |
---|
136 | installcheck: all install |
---|
137 | cd testsuite && ${MAKE} AUTOCONF=${bindir}/autoconf $@ |
---|
138 | |
---|
139 | installdirs: |
---|
140 | $(SHELL) ${srcdir}/mkinstalldirs ${DESTDIR}$(bindir) ${DESTDIR}$(infodir) ${DESTDIR}$(acdatadir) |
---|
141 | |
---|
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)'`; \ |
---|
145 | done |
---|
146 | for i in $(M4FROZEN); do \ |
---|
147 | $(INSTALL_DATA) $$i ${DESTDIR}$(acdatadir)/$$i; \ |
---|
148 | done |
---|
149 | for i in $(M4FILES) acconfig.h; do \ |
---|
150 | $(INSTALL_DATA) $(srcdir)/$$i ${DESTDIR}$(acdatadir)/$$i; \ |
---|
151 | done |
---|
152 | -if test -f autoscan; then \ |
---|
153 | $(INSTALL_PROGRAM) autoscan ${DESTDIR}$(bindir)/`echo autoscan|sed '$(transform)'`; \ |
---|
154 | for i in acfunctions acheaders acidentifiers acprograms \ |
---|
155 | acmakevars; do \ |
---|
156 | $(INSTALL_DATA) $(srcdir)/$$i ${DESTDIR}$(acdatadir)/$$i; \ |
---|
157 | done; \ |
---|
158 | else :; fi |
---|
159 | |
---|
160 | # Don't cd, to avoid breaking install-sh references. |
---|
161 | install-info: installdirs |
---|
162 | if test -f autoconf.info; then \ |
---|
163 | for i in *.info*; do \ |
---|
164 | $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/$$i; \ |
---|
165 | done; \ |
---|
166 | else \ |
---|
167 | for i in $(srcdir)/*.info*; do \ |
---|
168 | $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \ |
---|
169 | done; \ |
---|
170 | fi |
---|
171 | |
---|
172 | uninstall: |
---|
173 | for p in $(SCRIPTS); do \ |
---|
174 | rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \ |
---|
175 | done |
---|
176 | rm -fr $(acdatadir) |
---|
177 | cd $(infodir) && rm -f autoconf.info* |
---|
178 | if test -f standards.info || test -f $(srcdir)/standards.info; \ |
---|
179 | then cd $(infodir) && rm -f standards.info*; fi |
---|
180 | |
---|
181 | ${srcdir}/configure: configure.in $(M4FILES) |
---|
182 | cd $(srcdir) && \ |
---|
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: |
---|
189 | $(SHELL) ./config.status --recheck |
---|
190 | |
---|
191 | maintainer-clean:: |
---|
192 | @echo "This command is intended for maintainers to use;" |
---|
193 | @echo "rebuilding the deleted files requires makeinfo." |
---|
194 | rm -f TAGS *.info* INSTALL |
---|
195 | |
---|
196 | clean mostlyclean distclean maintainer-clean:: |
---|
197 | for dir in $(SUBDIRS); do \ |
---|
198 | echo making $@ in $$dir ; \ |
---|
199 | (cd $$dir && $(MAKE) $@) ; \ |
---|
200 | done |
---|
201 | |
---|
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 |
---|
207 | |
---|
208 | distclean maintainer-clean:: |
---|
209 | rm -f Makefile config.status config.cache config.log |
---|
210 | |
---|
211 | TAGS: |
---|
212 | etags ${srcdir}/*.m4 ${srcdir}/*.sh ${srcdir}/[a-z]*.in ${srcdir}/*.texi |
---|
213 | |
---|
214 | # Don't depend on DISTFILES because there's no rule for "standards.info*". |
---|
215 | dist: $(DISTDEP) |
---|
216 | distname=`sed -e '/define(AC_ACVERSION,/!d' \ |
---|
217 | -e 's/[^0-9.]*\([0-9.]*\).*/autoconf-\1/' -e q acgeneral.m4`; \ |
---|
218 | rm -fr $$distname; \ |
---|
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;}; \ |
---|
225 | done; \ |
---|
226 | chmod -R a+rX $$distname; \ |
---|
227 | tar -chz -f $$distname.tar.gz $$distname; \ |
---|
228 | rm -fr $$distname |
---|