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 <[email protected]>          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


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to