> From: "Noel Yap" <[EMAIL PROTECTED]>
> Robert Mecklenburg wrote:
> >
> >
> > @mkdir -p $(dir $(dir $(dir $@)))
>
> This didn't work, $(dir $(dir $@)) returns the same thing as $(dir $@).
So much for not testing my code...
> > .PRECIOUS: %.mkdir
> > %.mkdir:
> > @mkdir -p $(dir $@)
> > @touch $@
>
> Although this works, it doesn't work the way one would want. Here's why:
>
> Let's say you have:
>
> %.o: %.c %.o/../.mkdir
>
> When the %.mkdir rule above gets invoked for, say aoeu.o, it'll create
> the directory aoeu.o. Definitely not what you want. Unless I'm missing
> something.
%.o: %.c %.mkdir
So I was thinking the target would be, say, "out/bar.o". Now, with the
"slow" version it has prereq of "out/bar.mkdir" (In the slow version we omit
the .. path component.) Then the command script executes:
@mkdir -p $(dir out/bar.mkdir)
@touch out/bar.mkdir
Cheers,
Robert
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make