[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature request: silently overriding existing rules
From: |
Stefano Lattarini |
Subject: |
Re: Feature request: silently overriding existing rules |
Date: |
Fri, 10 Aug 2012 20:38:08 +0200 |
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
- Feature request: silently overriding existing rules, Stefano Lattarini, 2012/08/10
- Re: Feature request: silently overriding existing rules, David Boyce, 2012/08/10
- Re: Feature request: silently overriding existing rules,
Stefano Lattarini <=
- Re: Feature request: silently overriding existing rules, David Boyce, 2012/08/10
- Re: Feature request: silently overriding existing rules, Stefano Lattarini, 2012/08/10
- Re: Feature request: silently overriding existing rules, Tim Murphy, 2012/08/11
- Re: Feature request: silently overriding existing rules, Stefano Lattarini, 2012/08/11
- Re: Feature request: silently overriding existing rules, Tim Murphy, 2012/08/11
- Re: Feature request: silently overriding existing rules, Stefano Lattarini, 2012/08/11