> On 8/4/05, Dale King <[EMAIL PROTECTED]> wrote: > > So I am looking for another workaround to the issue. I thought perhaps > > target-specific variables might do it, but haven't gotten it to work. > > First: is the second "standard include file" supposed to be the same > as the first? It looks to me like the output you want is: > > 123 > 789
Yes. > Second, when you tried target-specific variables, did you use the := > instead of = ? This seems to work fine for me: Yes, target-specific and pattern-specific variables were the answer I was looking for. I didn't have time to figure out what was wrong with my first attempt at target specific variables before sending the message. It should probably be documented the way these type of variables are evaluated in section 3.9 of the make manual. > # The main make file > targets := > > all: do-targets > > # This comes from an included file for a > foo := a > target := abc > flags := 123 > > # This comes from a standard include file > $(target): flags:=$(flags) > $(target): > @echo "$@ has flags: $(flags)" > targets += $(target) > > # This comes from an included file for b > foo := b > target := xyz > flags := 789 > > # This comes from a standard include file > $(target): flags:=$(flags) > targets += $(target) > $(target): > @echo "$@ has flags: $(flags)" > > # this is back to the main include file > do-targets: $(targets) > > ### EOF ### > > The only changes are to your standard include file. I get the output > of '123' and '789' using make 3.79.1 and make 3.80. Note that if you > want to use more variables than just $(flags) in your command script, > you need a line to set each one. > > Hope this helps, > -Mike _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
