Norman Wilson wrote:
After working this out I had another flash of inspiration. I can make
each directory depend on it's parent and thus do away with the -p flag
to mkdir:

%/.: | %/../.
        mkdir $(@D)

However this doesn't work. So is this a bug or a feature. If it's a
feature can someone explain the rules.

Suppose that you write

foo/bar/baz: | foo/bar/.

and run it. Then the % matches against foo/bar with order-only prerequisite foo/bar/../. which GNU make then tries to build, but it _does not_ collapse the path and hence cannot find a rule to make that.

The other problem is that GNU Make also avoid recursing through the same rule and hence even if you did make this 'work' (say by wrapping the prerequisite in $$(realpath) and using second expansion) it still wouldn't work.

I guess -p doesn't look so bad after all.

BTW. If you are interested in directory creation ideas you can read my column in CM Basics 'Making directories in GNU Make' here: http://www.cmcrossroads.com/content/view/6936/120/

John.
--
John Graham-Cumming
[EMAIL PROTECTED]

Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/

POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/

Help out in the fight against spam
http://www.spamorham.org/


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

Reply via email to