On Tue, Nov 15, 2011 at 7:53 AM, Paul Smith <[email protected]> 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

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to