bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange GNU make behavior with -include ?


From: Paul D. Smith
Subject: Re: Strange GNU make behavior with -include ?
Date: Tue, 3 Dec 2002 15:44:31 -0500

%% Grégoire Sutre <address@hidden> writes:

  gs> I was having errors with my Makefiles (for Objective Caml), and I could 
  gs> pinpoint the problem with the attached very simple Makefile.

  gs> Basically (please see the attached Makefile), I use a:

  gs> -include fake.depend

  gs> statement to include a dependencies makefile 'fake.depend', but
  gs> this included makefile does not exists and cannot be made.
  gs> Indeed, fake.depend can be made from fake.c, but fake.c does not
  gs> exist, and it isn't the target of any rule -- explicit or
  gs> implicit).

  gs> So I expected make to simply ignore fake.depend (as explained in
  gs> GNU make's manual).

Not quite.  The manual says that if the makefile does not exist and
cannot be remade, then it will be ignored.  By "cannot be remade", the
manual really means "make doesn't know of any way to remake it".

Because make can imagine a way to recreate the included makefile, it
tries to do so (this is a result of the auto-re-exec feature of GNU
make; it has nothing to do with whether fake.c is a prerequisite or
not).  If the rebuild fails (in this case because there is no fake.c)
then it stops with an error.


It's not clear to me which is the correct behavior in this case, but
make has always behaved as it does now.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]