On Tue, 2011-11-15 at 08:22 -0500, David Boyce wrote: > 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.
Yes but I don't know if there's an equivalent in Windows. If not redirect stderr to /dev/null (or the equivalent in Windows). > > 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. I think it's parallel-safe. Everything is serialized at the filesystem level anyway; it won't corrupt your filesystem or anything to run mkdir multiple times concurrently. One of the mkdirs will succeed and the others will not but either way you'll have a directory created. OO prereqs are definitely the most "correct" way but older versions of GNU make don't support that feature. -- ------------------------------------------------------------------------------- Paul D. Smith <[email protected]> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
