[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Inproper actions when version.texi is used
From: |
Herbert Euler |
Subject: |
Inproper actions when version.texi is used |
Date: |
Mon, 9 Jun 2008 17:20:52 +0800 |
I encountered a problem using version.texi with GNU make: after
changing the version of my project in configure.in GNU make has to be
executed twice to get the correct version number in the info document.
I had sent a mail to the bug-make mailing list, but I found changing
the dependencies in automake generated Makefile.in a bit would also
let the problem go away. I'm not sure if this is a bug of GNU make or
automake now.
When version.texi is used, the Makefile.in has a dependency tree like
this:
DOC: DOC.texi version.texi
version.texi: stamp-vti
stamp-vti: DOC.texi .../configure
Where DOC is the name of the texinfo format document file. When the
version number in configure.in is updated, configure gets updated by
autoconf. After that, stamp-vti will be regenerated as expected, but
version.texi is also regenerated in stamp-vti's action. Here is a toy
example shows GNU make's reaction to this definition:
address@hidden:~/tmp/k$ cat Makefile
a: b
cat b>a
b: c
c: d
date>b
cp b c
address@hidden:~/tmp/k$ touch d
address@hidden:~/tmp/k$ make
date>b
cp b c
address@hidden:~/tmp/k$ make
cat b>a
address@hidden:~/tmp/k$
As you can see, `make' has to be executed twice for generating the
correct target `a'. The debug log from GNU make shows that if the
target `b' is generated in `c''s actions, it will not consider `b'
updated, i.e. it still thinks `b' is older than `a', so the first time
the target `a' is not regenerated. But in the second execution, all
`b', `c', and `d' are not regenerated, and GNU make will consider `b'
newer than `a', so `a' is regenerated.
The behavior will be as expected if we re-arrange the actions to
generate `b' in `b''s action:
address@hidden:~/tmp/k$ cat Makefile
a: b
cat b>a
b: c
cp c b
c: d
date>c
address@hidden:~/tmp/k$ touch d
address@hidden:~/tmp/k$ make
date>c
cp c b
cat b>a
address@hidden:~/tmp/k$
Perhaps we should make such a change?
Regards,
Guanpeng Xu
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Inproper actions when version.texi is used,
Herbert Euler <=