Re: Optimizing directory creation

Heime <[email protected]> Fri, 01 May 2026 11:20:31 +0000
Newsgroups gmane.comp.gnu.make.general
Message-ID <vytOqpnve9vnRl9m4PHtnCFSb9fJTeNU5uV-HG7XYgsUT4T_WEXXupMN3933sZcs9iFJRfy2VcLuRwTzjdeMPrefHZzzHeun5mv3qdrAuzA=@protonmail.com>
On Friday, May 1st, 2026 at 7:10 PM, Tim Murphy <[email protected]> wrote:

> On Fri, 1 May 2026 at 06:59, Eli Zaretskii <[email protected]> wrote:
>=20
> > > From: Tim Murphy <[email protected]>
> >=20
> > > One problem with directories is that their time and date change when
> > > anything is done on the directory e.g. if a new file is created. I th=
ink
> > > you might need to check that adding a file to one of your directories
> > > doesn't trigger m=C4=B1d=C4=B1r on anything below it. Does this matte=
r a lot? Not
> > > really in this case.
> >=20
> > Order-only dependencies are exactly the means to avoid the dependency
> > on the time stamps of the directories. So I don't think I understand
> > what you are saying here.
>=20
>=20
> At the bottom of his makefile the directories depend directly on each oth=
er. . So even though the target files depend on the directories via order-o=
nly the directories themselves depend on their parent via a normal dependen=
cy. Hence I wondered if any change in a parent directory would trigger a co=
uple of mildly annoying unneeded "mkdir -p" commands for the children. In t=
his situation it is so trivial that it doesn't matter even if this is the c=
ase and mkdir -p is harmless either way.
>=20
> In a different situation, if many rules wrote to a parent directory that =
might trigger a deluge of "mkdir -p" - even so it would only be an annoyanc=
e. I had a really unusual situation unrelated to GNU make which made it a d=
isaster and therefore had to come up with the plan of making all directorie=
s before any rules were executed.

I like the making all directories before rules.
=20
> Best regards,
> Tim
=20
=20