source: trunk/essentials/sys-devel/automake-1.8/lib/am/configure.am

Last change on this file was 3118, checked in by bird, 18 years ago

automake 1.8.5

File size: 5.9 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 2001, 2002, 2003, 2004 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
20## This dummy rule is called from subdirectories whenever one of the
21## top-level Makefile's dependencies must be updated. It does not
22## need to depend on %MAKEFILE% because GNU make will always make sure
23## %MAKEFILE% is updated before considering the am--refresh target.
24if %?TOPDIR_P%
25.PHONY: am--refresh
26am--refresh:
27 @:
28endif %?TOPDIR_P%
29
30## --------------------- ##
31## Building Makefile.*. ##
32## --------------------- ##
33
34## This rule remakes the Makefile.in.
35%MAKEFILE-IN%: %MAINTAINER-MODE% %MAKEFILE-AM% %MAKEFILE-IN-DEPS% $(am__configure_deps)
36## If configure.ac or one of configure's dependencies has changed, all
37## Makefile.in are to be updated; it is then more efficient to run
38## automake on all the Makefiles at once. It also allow Automake to be
39## run for newly added directories.
40 @for dep in $?; do \
41 case '$(am__configure_deps)' in \
42 *$$dep*) \
43?TOPDIR_P? echo ' cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS%'; \
44?TOPDIR_P? cd $(srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% \
45?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
46 && exit 0; \
47 exit 1;; \
48 esac; \
49 done; \
50## Otherwise, rebuild only this file.
51 echo ' cd $(top_srcdir) && $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%'; \
52 cd $(top_srcdir) && \
53 $(AUTOMAKE) --%STRICTNESS% %USE-DEPS% %MAKEFILE-AM-SOURCES%
54
55## Ensure that GNU make doesn't remove Makefile if ./config.status (below)
56## is interrupted. Otherwise, the user would need to know to rerun
57## ./config.status to recreate the lost Makefile.
58.PRECIOUS: %MAKEFILE%
59## This rule remakes the Makefile.
60%MAKEFILE%: %MAKEFILE-DEPS% $(top_builddir)/config.status
61## If Makefile is to be updated because of config.status, then run
62## config.status without argument in order to (i) rerun all the
63## AC_CONFIG_COMMANDS including those that are not visible to
64## Automake, and (ii) to save time by running config.status all with
65## all the files, instead of once per file (iii) generate Makefiles
66## in newly added directories.
67 @case '$?' in \
68## Don't prefix $(top_builddir), because GNU make will strip it out
69## when it's `.'.
70 *config.status*) \
71?TOPDIR_P? echo ' $(SHELL) ./config.status'; \
72?TOPDIR_P? $(SHELL) ./config.status;; \
73?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
74 *) \
75## FIXME: $(am__depfiles_maybe) lets us re-run the rule to create the
76## .P files. Ideally we wouldn't have to do this by hand.
77 echo ' cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe)'; \
78 cd $(top_builddir) && $(SHELL) ./config.status %CONFIG-MAKEFILE% $(am__depfiles_maybe);; \
79 esac;
80
81DIST_COMMON += %MAKEFILE-AM%
82
83
84## --------------------------- ##
85## config.status & configure. ##
86## --------------------------- ##
87
88if %?TOPDIR_P%
89## Always require configure.ac and configure at top level, even if they
90## don't exist. This is especially important for configure, since it
91## won't be created until autoconf is run -- which might be after
92## automake is run.
93DIST_COMMON += $(top_srcdir)/configure $(am__configure_deps)
94endif %?TOPDIR_P%
95
96$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
97?TOPDIR_P? $(SHELL) ./config.status --recheck
98?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
99
100$(top_srcdir)/configure: %MAINTAINER-MODE% $(am__configure_deps)
101?TOPDIR_P? cd $(srcdir) && $(AUTOCONF)
102?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
103
104
105## ------------ ##
106## aclocal.m4. ##
107## ------------ ##
108
109## aclocal.m4 must be built by the top-level Makefile, because this is
110## where the user is expected to define $(ACLOCAL_AMFLAGS).
111##
112## Whenever a configure dependency changes we need to rebuild
113## aclocal.m4 too. Changing configure.ac, or any file included by
114## aclocal.m4 might require adding more files to aclocal.m4. Hence
115## the $(am__configure_deps) dependency.
116if %?REGEN-ACLOCAL-M4%
117$(ACLOCAL_M4): %MAINTAINER-MODE% $(am__aclocal_m4_deps)
118?TOPDIR_P? cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
119?!TOPDIR_P? cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
120endif %?REGEN-ACLOCAL-M4%
121
122
123## --------- ##
124## cleanup. ##
125## --------- ##
126
127## We special-case config.status here. If we do it as part of the
128## normal clean processing for this directory, then it might be
129## removed before some subdir is cleaned. However, that subdir's
130## Makefile depends on config.status.
131
132if %?TOPDIR_P%
133am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
134 configure.lineno configure.status.lineno
135distclean:
136 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
137
138## Note: you might think we should remove Makefile.in, configure, or
139## aclocal.m4 here in a maintainer-clean rule. However, the GNU
140## Coding Standards explicitly prohibit this.
141
142maintainer-clean:
143 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
144## autom4te.cache is created by Autoconf; the only valid target to
145## remove it is maintainer-clean, not distclean.
146## If you have an autom4te.cache that cause distcheck to fail, then
147## it is good news: you finally discovered that autoconf and/or
148## autoheader is needed to use your tarball, which is wrong.
149 -rm -rf $(top_srcdir)/autom4te.cache
150
151
152endif %?TOPDIR_P%
Note: See TracBrowser for help on using the repository browser.