[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: exception to Paul's Second Rule?
From: |
Noel Yap |
Subject: |
Re: exception to Paul's Second Rule? |
Date: |
Thu, 16 Oct 2003 16:38:49 -0400 |
Robert Mecklenburg wrote:
>
> > From: "Noel Yap" <address@hidden>
> >
> > .PRECIOUS: %/../...
> > %/../...:
> > @mkdir -p $(dir $(patsubst %/,%,$(dir $(@D)))) && : >> $(dir $(patsubst
> %/,%,$(dir $(@D))))$(@F)
>
> Is there a reason why you didn't use either of:
>
> @mkdir -p $(dir $(dir $(dir $@)))
This didn't work, $(dir $(dir $@)) returns the same thing as $(dir $@).
> @mkdir -p $(dir $(patsubst %/../...,%,$@))
I like this much better. I'll do this.
> I haven't tried them, but I assume they work. ;-)
I'm pretty sure the second one should work.
> I don't care for the file name you've chosen! ;-) Would something like
> ".creator" be easier on the eyes? In fact, changing the code from the "fast
> lane" to the "slow lane" yields:
Funny, the originator of this idea was using ".created".
> .PRECIOUS: %.mkdir
> %.mkdir:
> @mkdir -p $(dir $@)
> @touch $@
>
> Now I grant you, the "cool factor" of yours is way beyond the "slow"
> version, but this one actually follows Paul's second rule at the cost of
> more files created and visible to the user. (Not a trivial cost, I admit.)
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.
> A very interesting idea!
Thanks, I wish I could take credit for it, but someone over here came up with
it.
Noel
--
NOTICE: If received in error, please destroy and notify sender. Sender does
not waive confidentiality or privilege, and use is prohibited.
- Re: exception to Paul's Second Rule?, (continued)
- Re: exception to Paul's Second Rule?, Paul D. Smith, 2003/10/16
- 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 <=
- Re: exception to Paul's Second Rule?, Robert Mecklenburg, 2003/10/16
- Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
- Re: exception to Paul's Second Rule?, Robert Mecklenburg, 2003/10/16
- Re: exception to Paul's Second Rule?, Noel Yap, 2003/10/16
- 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