help-make
[Top][All Lists]
Advanced

[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:12:56 -0600

> 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 $@)))
  @mkdir -p $(dir $(patsubst %/../...,%,$@))

I haven't tried them, but I assume they 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:

.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.)

A very interesting idea!

Cheers,
Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]