help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Partial generation of recipe and dependencies


From: Andre Majorel
Subject: Re: Partial generation of recipe and dependencies
Date: Wed, 27 Jun 2012 22:44:46 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On 2012-06-21 08:42 -0400, Paul Smith wrote:
> On Wed, 2012-06-20 at 23:08 -0700, Philip Guenther wrote:

> > -----
> > define tgt
> > $(eval .PHONY: $(value 1)
> > $(value 1): destdir-unsafe)$(1):
> > endef
> > 
> > $(call tgt, target1)
> >         @echo something
> > 
> > $(call tgt, target2)
> >         @echo something2
> > -----
> 
> Ha!  That's very cute indeed Philip.  Nicely done.
> 
> For Andre: the reason this doesn't work is the same reason that an
> "include" containing a target setup cannot be followed by the recipe for
> that target after the include; this won't work:
> 
>       include target.mk
>               @echo this is the recipe
> 
> For both include and $(eval ...) the makefile that is included or eval'd
> is always parsed by make as if it were a self-contained makefile, and
> the end-of-file (or end-of-string) markers will be interpreted by make
> as ending any target that is currently being parsed.

That works (though it's very easily broken by changes in white
space). Thank you both.

-- 
André Majorel http://www.teaser.fr/~amajorel/



reply via email to

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