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/ _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
