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

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

Re: recursive inclusion of makefiles - gmake 3.79.1


From: Paul D. Smith
Subject: Re: recursive inclusion of makefiles - gmake 3.79.1
Date: Tue, 29 Jun 2004 17:35:40 -0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

%% yasheshb@yahoo.com (Crazy Coder) writes:

  cc> So from the file output1 above it is seen that "make" is not
  cc> checking to see if a file is already included during the first
  cc> pass.

Correct.

  cc> Is there any reason for not flagging the recursive inclusion of
  cc> makefile1 and makefile2 in each other ?

Maybe the person writing the makefiles _WANTS_ to include them twice.


If you want to protect against this you can, using the same methods you
would use in C, for example:

    ifndef __INCLUDED_makefile1
    __INCLUDED_makefile1 := 1

    include makefile2

        ... contents of the makefile

    endif

etc.

-- 
-------------------------------------------------------------------------------
 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]