help-make
[Top][All Lists]
Advanced

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

Re: make always builds, part 2


From: David Boyce
Subject: Re: make always builds, part 2
Date: Tue, 15 Nov 2011 08:22:46 -0500

On Tue, Nov 15, 2011 at 7:53 AM, Paul Smith <address@hidden> wrote:
>        __dummy := $(shell mkdir $(OBJDIRECTORY))

Generally best here (again, assuming POSIX) to use mkdir -p which does
not fail if the directory already exists.

> Second, you can create it as a side-effect of every target that needs it
> (in the script for that target).

This is not parallel-safe because two recipes building unrelated
targets in the same directory might run mkdir at the same time.

> And third, you can use order-only prerequisites:
>
>        %.d : %.cpp | $(OBJDIRECTORY)
>                ...

This, IMHO, is the "right" way.

-David Boyce



reply via email to

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