[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: overriding recipe
From: |
Paul Smith |
Subject: |
Re: overriding recipe |
Date: |
Tue, 15 Nov 2011 07:57:17 -0500 |
On Tue, 2011-11-15 at 09:25 +0100, Warlich, Christof wrote:
> is it possible to override a rule without getting the "overriding
> recipe" warning?
No, this can't be done.
> My problem is that I need to see (some of) the variables in User.mk in
> both of these instances of make, but I need to ignore any rules in the
> initial make instance, allowing that they are only executed in the
> second invocation of make, i.e. when being in the right directory.
One simple thing is to create a sentinel variable specifying whether the
targets have been defined.
So, in User.mk you'd do something like:
FOO = foo
BAR = bar
... other variables ...
ifndef TARGETS_DEFINED
TARGETS_DEFINED = 1
foo:
build a foo
... other targets ...
endif
Now the first time you included it TARGETS_DEFINED would not be defined,
so you'd get the targets. After that TARGETS_DEFINED would be defined
and you wouldn't define them twice.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
- overriding recipe, Warlich, Christof, 2011/11/15
- Re: overriding recipe,
Paul Smith <=