%% Olivier Durand <[EMAIL PROTECTED]> writes:

  od> I have two solution here: I can either use the include directive
  od> or the MAKEFILES environment variable.  The include directive
  od> works fine but redefines the goal of my makefile to the first
  od> target of the included file (if there is one...) since I would
  od> like to put all my inlcudes at the begining of the file.

Tim gave the short answer; you have to put the rule you want built as
the first one that make sees in the makefile.  Note you don't have to
give it a _prerequisite_ right there, you can do that later.  You just
need to declare it as a target, then make will treat it as the first
one.  So, if your "default" target is "all", you would just need this,
at a minimum, as the first target mentioned in the makefile:

  all:

So, there are a number of ways to do this:

 1) Put the above line in each makefile, before you include anything.

 2) If you have one particular include file which is always first, you
    can put the above line in that include file.

 3) If you don't, you could put it at the top of _every_ include file;
    this would ensure that no matter which one was first, that target
    would be declared before any others.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

Reply via email to