1 | ## automake - create Makefile.in from Makefile.am
|
---|
2 | ## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2003
|
---|
3 | ## Free Software Foundation, Inc.
|
---|
4 |
|
---|
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 2, or (at your option)
|
---|
8 | ## any later version.
|
---|
9 |
|
---|
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.
|
---|
14 |
|
---|
15 | ## You should have received a copy of the GNU General Public License
|
---|
16 | ## along with this program; if not, write to the Free Software
|
---|
17 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
---|
18 | ## 02111-1307, USA.
|
---|
19 |
|
---|
20 | ## Explicitly look in srcdir for benefit of non-GNU makes.
|
---|
21 |
|
---|
22 |
|
---|
23 | %CONFIG_H%: %STAMP%
|
---|
24 | ## Recover from removal of CONFIG_HEADER
|
---|
25 | @if test ! -f $@; then \
|
---|
26 | rm -f %STAMP%; \
|
---|
27 | $(MAKE) %STAMP%; \
|
---|
28 | else :; fi
|
---|
29 |
|
---|
30 |
|
---|
31 | %STAMP%: %CONFIG_H_DEPS% $(top_builddir)/config.status
|
---|
32 | @rm -f %STAMP%
|
---|
33 | cd $(top_builddir) && $(SHELL) ./config.status %CONFIG_H_PATH%
|
---|
34 |
|
---|
35 |
|
---|
36 | ## Only the first file of AC_CONFIG_HEADERS is assumed to be generated
|
---|
37 | ## by autoheader.
|
---|
38 | if %?FIRST_CONFIG_HIN%
|
---|
39 | %CONFIG_HIN%: %MAINTAINER-MODE% $(am__configure_deps) %FILES%
|
---|
40 | cd $(top_srcdir) && $(AUTOHEADER)
|
---|
41 | ## Whenever $(AUTOHEADER) has run, we must make sure that
|
---|
42 | ## ./config.status will rebuild config.h. The dependency from %STAMP%
|
---|
43 | ## on %CONFIG_H_DEPS% (which contains config.hin) is not enough to
|
---|
44 | ## express his.
|
---|
45 | ##
|
---|
46 | ## There are some tricky cases where this rule will build a
|
---|
47 | ## config.hin which has the same timestamp as %STAMP%, in which case
|
---|
48 | ## ./config.status will not be rerun (meaning that users will use in
|
---|
49 | ## out-of-date config.h without knowing it). One situation where this
|
---|
50 | ## can occurs is the following:
|
---|
51 | ## 1. the user updates some configure dependency (let's say foo.m4)
|
---|
52 | ## and run `make'
|
---|
53 | ## 2. the rebuild rules detect that a foo.m4 has changed,
|
---|
54 | ## run aclocal, autoconf, automake, and then run ./config.status.
|
---|
55 | ## (Note that autoheader hasn't been called yet, so ./config.status
|
---|
56 | ## outputs a config.h from an obsolete config.hin.)
|
---|
57 | ## 3. Once Makefile has been regenerated, make continues, and
|
---|
58 | ## discover that config.h is a dependency of the `all' rule.
|
---|
59 | ## Because config.h depends on stamp-h1, stamp-h1 depends on
|
---|
60 | ## config.hin, and config.hin depends on aclocal.m4, make runs
|
---|
61 | ## autoheader to rebuild config.hin.
|
---|
62 | ## Now make ought to call ./config.status once again to rebuild
|
---|
63 | ## config.h from the new config.hin, but if you have a sufficiently
|
---|
64 | ## fast box, steps 2 and 3 will occur within the same second: the
|
---|
65 | ## config.h/stamp-h1 generated from the outdated config.hin will have
|
---|
66 | ## the same mtime as the new config.hin. Hence make will think that
|
---|
67 | ## config.h is up to date.
|
---|
68 | ##
|
---|
69 | ## A solution is to erase %STAMP% here so that the %STAMP% rule
|
---|
70 | ## is always triggered after the this one.
|
---|
71 | rm -f %STAMP%
|
---|
72 | ## Autoheader has the bad habit of not changing the timestamp if
|
---|
73 | ## config.hin is unchanged, which breaks Make targets. Since what
|
---|
74 | ## must not changed gratuitously is config.h, which is already handled
|
---|
75 | ## by config.status, there is no reason to make things complex for
|
---|
76 | ## config.hin.
|
---|
77 | touch $@
|
---|
78 | endif %?FIRST_CONFIG_HIN%
|
---|