On Sun, 2017-03-12 at 18:15 +1100, Tony Theodore wrote: > It seems the variable `prog` is in scope from the calling loop and > can be referenced in the template: > > define PROGRAM_template = > $(prog): $$($(prog)_OBJS) $$($(prog)_LIBS:%=-l%) > ALL_OBJS += $$($(prog)_OBJS) > endef > > I was wondering if this is defined behaviour and can be relied upon > to work in future versions of make?
Yes, absolutely. The point of the foreach function is that the loop variable is visible in the scope of the loop body... otherwise foreach is almost useless. _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make