[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: exception to Paul's Second Rule?
From: |
Robert Mecklenburg |
Subject: |
Re: exception to Paul's Second Rule? |
Date: |
Thu, 16 Oct 2003 14:45:11 -0600 |
> From: "Noel Yap" <address@hidden>
> 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
- Re: exception to Paul's Second Rule?, (continued)
- Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/17
- wildcard recursive?!, Sylvain Becker, 2003/10/17
- Re: wildcard recursive?!, Paul D. Smith, 2003/10/17
- Re: wildcard recursive?!, Dan Kegel, 2003/10/17
- RE: wildcard recursive?!, Sylvain Becker, 2003/10/17
- RE: wildcard recursive?!, Paul D. Smith, 2003/10/17
- RE: wildcard recursive?!, Sylvain Becker, 2003/10/17
- RE: wildcard recursive?!, Paul D. Smith, 2003/10/17
- Re: wildcard recursive?!, Noel Yap, 2003/10/17
Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
Re: exception to Paul's Second Rule?, Benoit Poulot-Cazajous, 2003/10/24