delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/08/20:25:28

From: nygren AT tecnet1 DOT jcte DOT jcs DOT mil
Message-Id: <199903090125.UAA13937@huey.nawcad.navy.mil>
Date: Mon, 8 Mar 99 17:23:03 PDT
To: djgpp AT delorie DOT com
Posted: Mar 8 17:18 1999 EST (Mar 9 01:18 ZULU)
Mime-Version: 1.0
Subject: DJGPP Make v3.77 recursion bug test case
Reply-To: djgpp AT delorie DOT com

Here is a contrived short test case of a possible recursion bug 
in DJGPP Make v3.77:

Each directory contains a .src file, a macro.m4 file, and a Makefile

-----------This is the Makefile in /root----------

root.htm : subpages 
	m4 macro.m4 root.src > root.htm
	
subpages:
	cd sub; $(MAKE)

-----------This is the Makefile in /root/sub------

sub.htm :  
	m4 macro.m4 sub.src > sub.htm

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

C:\root>make
cd sub; c:/gnu/make/bin/make.exe
make.exe[1]: Entering directory `c:/root/sub'
m4 macro.m4 sub.src > sub.htm
make.exe[1]: Leaving directory `c:/root/sub'
m4 macro.m4 root.src > root.htm
c:/gnu/m4/bin/m4.exe: root.src: No such file or directory (ENOENT)

--------------------------------------------------
root.htm winds up in /root/sub rather in than /root 
even though make said it left /root/sub! Make can't
find root.src because it is still in /root/sub instead
of /root.

--------------------------------------------------
I'm using DJGPP Make V3.77

C:\root>make --v
GNU Make version 3.77, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
        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 AT gnu DOT org>.
----------------------------------------------------
CYGWIN32 Make V3.75 seems to work fine.

C:\root>make
cd sub; /CYGNUS/CYGWIN\~1/H-I586\~1/BIN/MAKE.EXE
m4 macro.m4 sub.src > sub.htm
m4 macro.m4 root.src > root.htm

C:\Dan\tmp>make --v
GNU Make version 3.75, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96
        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-gnu-utils AT prep DOT ai DOT mit DOT edu>.
-----------------------------------------------------

	Dan Nygren
	nygren AT tecnet1 DOT jcte DOT jcs DOT mil

On Mon, 1 Mar 1999 nygren AT tecnet1 DOT jcte DOT jcs DOT mil wrote:

> I have a rule in a makefile in the root directory called R.
> I have a rule in a makefile in a subdirectory called S.
> R depends upon S
> I type make at the root directory prompt
> When it makes R, make properly changes directories to the subdirectory
> Make tells me it went into the subdirectory
> Make executes rule S
> Make tells me it went back to the root directory (**I think its
lying**)

Why do you think it's lying?  Can you insert a command into the Makefile 
that prints the directory, and see?

Make always returns to the original directory after it finishes its job.  
This is so for the DJGPP port as well.  If you think this isn't working 
for you, please post the shortest Makefile which demonstrates the 
problem.

> I think make is erroneously finishing executing rule R in the
subdirectory,
> instead of the root directory, because I found rule R's partial target
file
> in the subdirectory instead of the root directory.

I think you failed to describe too many fine details of your case, and 
therein be dragons.  Throw together the shortest test case which 
exhibits the problem, and post it here.
,

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019