Hi David, thanks for the feedback.

On 08/10/2012 07:00 PM, David Boyce wrote:
> Even with GNU make as it stands, couldn't you emit your rules in the
> form of variables, override them at will, and eval() them at the end?
> E.g.
> 
> define ruleA
> version 1
> endef
> 
> then later...
> 
> define ruleA
> version 2
> endef
> 
> $(eval $(call ruleA,...))
> 
Thanks for the tip.  And now that I think about it, an even simpler
and clearer idiom would be using GNU make ability of "recipe canning"
<http://www.gnu.org/software/make/manual/make.html#Canned-Recipes>
(which is a great, great feature IMO):

  define rule-foo
    do something
    @do something else, hiding the recipe
    do something else; \
      that spans \
      multiple lines
  endef

  define rule-bar
    @cmd1
    @cmd2
 endef

 ... # Then later ...
 foo bar:
        $(rule-$@)

However, even my simplified idiom, if used throughout, would rapidly
render the "makefile library" I was hinting to more cumbersome to
write and to understand than I'd like; having a more "native" way to
obtain the intended effect would be better.  I guess in the end it
will boil down to: is it be easier to consistently use the idiom
above, or to enhance GNU make to implement my feature request?
I have no answer for that, lacking any knowledge about GNU make
internals; I guess the make developers here will be in a better
position to answer my question.

Thanks,
  Stefano

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to