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

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

recursive inclusion of makefiles - gmake 3.79.1


From: Crazy Coder
Subject: recursive inclusion of makefiles - gmake 3.79.1
Date: Tue, 29 Jun 2004 17:35:39 -0000

Hi, 

  I have 2 makefiles - makefile1 and makefile2 and i'm running the
following test.

-----------------------------------------------------------------------------
[yvb@bfc1 ch4]$ make --version
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for i386-redhat-linux-gnu
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <bug-make@gnu.org>.

[yvb@bfc1 ch4]$ cat makefile1
include makefile2

hello:
        echo "Hello World!"

[yvb@bfc1 ch4]$ cat makefile2
include makefile1

[yvb@bfc1 ch4]$ make -f makefile1 hello > output1 2>&1

[yvb@bfc1 ch4]$ ls -l output1
-rw-rw-r--    1 yvb      yvb         63317 Jun 11 20:07 output1

[yvb@bfc1 ch4]$ wc output1
   1023    7661   63317 output1

[yvb@bfc1 ch4]$ head -n 5 output1
makefile1:1: makefile2: Too many open files
makefile1:4: warning: overriding commands for target `hello'
makefile1:4: warning: ignoring old commands for target `hello'
makefile1:4: warning: overriding commands for target `hello'
makefile1:4: warning: ignoring old commands for target `hello'


-----------------------------------------------------------------------------

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

Is there any reason for not flagging the recursive inclusion of
makefile1 and makefile2 in each other ? except that this is a very
rare mistake and hence not worth pointing out to the user.

Thanks

Yashesh Bhatia.


reply via email to

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