On Fri, 2009-10-02 at 14:00 +0100, Ian Lynagh wrote:
> Hi all,
>
> I would like to use make to create directories, something like this
> (which works):
>
> # --------------
> default: a/b/c/
>
> a/b/c/ : | a/b/
> mkdir $@
>
> a/b/ : | a/
> mkdir $@
>
> a/ : | ./
> mkdir $@
> # --------------
>
> but I don't want to have to have an explicit rule for every directory;
Why don't you just use "mkdir -p"?
default: a/b/c/
a/b/c/ : ; mkdir -p $@
??
To answer your question, there's no way to do that without using a
complicated expression combining $(foreach ...) and $(eval ...) and
probably a few other functions such as patsubst to turn / into space
etc.
--
-------------------------------------------------------------------------------
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]
http://lists.gnu.org/mailman/listinfo/help-make