bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating missing depfiles by an automake based makefile


From: Jacob Bachmeyer
Subject: Re: Generating missing depfiles by an automake based makefile
Date: Thu, 09 Feb 2023 23:01:04 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Dmitry Goncharov wrote:
On Thursday, February 9, 2023, Tom Tromey <tom@tromey.com> wrote:
It's been a long time since I worked on automake, but the dependency
tracking in automake is designed not to need to rebuild or pre-build dep
files.  Doing that means invoking the compiler twice, which is slow.
Instead, automake computes dependencies as a side effect of compilation.
The hello.Po example presented above computes depfiles as a side effect of
compilation. Moreover, when hello.Po is absent that makefile compiles
hello.o as a side effect of hello.Po computation. In total there is only
one compilation.
What is the scenario where you both end up with an empty depfile and a
compilation that isn't out of date for some other reason?  That seems
like it shouldn't be possible.
When a depfile is missing (for any reason) the current automake makefile
creates a dummy depfile. From that point on the user has to notice that
make is no longer tracking dependencies and their build is incorrect.

I am asking if automake can be enhanced to do something similar to hello.Po
example above, in those cases when make supports that.

If I understand correctly, the problem here is that the depfile is both empty and current. If Automake could set the dummy depfile's mtime to some appropriate past timestamp (maybe the Makefile itself?), it would appear out-of-date immediately and therefore be remade, also rebuilding the corresponding object.

A quick check of the POSIX manual finds that touch(1) accepts the '-r' option to name a reference file and can create a file. Could we simply use "touch -r Makefile $DEPFILE" to create depfiles when we need dummies?


-- Jacob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]