help-gnu-utils
[Top][All Lists]
Advanced

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

Re: gmake include makefile question


From: Paul D. Smith
Subject: Re: gmake include makefile question
Date: 20 Mar 2006 10:47:33 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

%% "Murali" <maha.murali@gmail.com> writes:

  m> The only difference between "-include" and "include" is the display of
  m> a warning that the file does not exist.

It's helpful to include some context in your emails: due to volume we
are often forced to delete mail quickly and without any context it's
sometimes difficult to remember details of the problem.

Also, please always remember to include the type and version of OS
you're running, the version of GNU make you're using, etc.

  m> After another pass at the Makefile, I realised one other possible
  m> issue which turned out to be the cause. But I cant still figure out
  m> the reason. I had one other additional line in my makefile.

  m> .PHONY: Makefile.Depend

  m> I would have guessed that this would only cause Makefile.Depend to
  m> be regenerated everytime "make" is run.

This is very bad.  If an included makefile is phony then it will always
be considered out of date.  So, make will rebuild it, then re-exec.
Then the re-exec'd make will see that it's out of date and rebuild it,
then re-exec.  Etc, into an infinite loop.

  m> But for some reason removing this line, seems to fix the problem
  m> and now make is reading the generated file.

I believe make is protecting you from the above scenario, although the
documentation does not say this.  It talks about not re-execing WRT
double-colon targets, but not .PHONY targets.  I'll have to look into
that.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          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]