bug-make
[Top][All Lists]
Advanced

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

Re: [bug #40610] gmake 4.0 loops rebuilding included makefiles


From: Edward Welbourne
Subject: Re: [bug #40610] gmake 4.0 loops rebuilding included makefiles
Date: Mon, 18 Nov 2013 08:19:37 +0000

> Moving the mkdir into the recipe for depend.mk does not change the behavior;
> however, removing objdir from the depends of depend.mk does.

Generally, making things depend on the directory in which they exist is
A Bad Idea.  Creating any file in the directory changes the directory,
hence forces recreation of everything that depends on it, which is
seldom the right thing to do.  If the directory contains two files that
each depend on it, recreating either changes the directory so makes the
other out of date: this (to my surprise) doesn't usually cause make to
spin, but it does cause every build to remake both files, wantonly

The way I handle this is by having a touch-file $D/.esists, that I
create when I mkdir; things that depend on the directory's existence so
that they can be created depend instead on the .exists file, whose rule
does the mkdir -p for the directory, then touches .exists in it; search
in page for ".exists" at
http://www.chaos.org.uk/~eddy/craft/make.html

        Eddy.



reply via email to

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