broken dependencies when doing make all ?

Erik Joelsson erik.joelsson at oracle.com
Tue Mar 25 17:06:10 UTC 2025


On 3/25/25 08:57, Baesken, Matthias wrote:
>
> > Did you try to run "make doctor"?
>
> No .
>
> (I have to confess I deleted some stuff from the builddir before) .
>
If you manually delete stuff from the builddir, you cannot expect 
incremental builds to work unless you know exactly what to delete. Make 
does track dependencies, but that only works really well when every file 
in the output is known and can be declared to be the result of a 
complete set of prerequisites (e.g. foo.c -> foo.o). Our build is far 
from this ideal. We have plenty of build steps where the makefiles 
cannot predict all the files that will be generated by a rule (e.g. 
Foo.java -> Foo.class, Foo$1.class, Foo$Internal.class etc). To work 
around this we use "touch files" or pick a particular known file in the 
output to declare the rule around. As long as files in the builddir are 
only deleted together with the appropriate touch files or as a group 
including the chosen target file, incremental builds should work. 
Knowing exactly how these groups are composited is hard however, so my 
recommendation is to stick to the existing clean targets unless you know 
for sure what to delete.

/Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20250325/f56bbe64/attachment.htm>


More information about the build-dev mailing list