delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/09/05:19:44

Date: Tue, 9 Mar 1999 12:17:24 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: nygren AT tecnet1 DOT jcte DOT jcs DOT mil
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP Make v3.77 recursion bug test case
In-Reply-To: <199903090125.UAA13937@huey.nawcad.navy.mil>
Message-ID: <Pine.SUN.3.91.990309121712.7248Y-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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

> root.htm winds up in /root/sub rather in than /root 
> even though make said it left /root/sub!

``Leaving'' a directory doesn't necessarily mean that you are going
somewhere else ;-).  You can ``leave'' it and yet stay put.  For
example, if the Makefile doesn't change the directory, the recursive
Make will still say ``Leaving directory''.

> Make can't find root.src because it is still in /root/sub instead of
> /root.

This is a feature.  Current working directory is a global notion in
DOS/Windows, and many DOS Makefiles assume that behavior and rely upon
it.  For example, consider the following Makefile:

  all:
	cd foo
	frobnicate -o product foo-source

If the DJGPP port would to behave like Make works on Unix, this
Makefile will not work, and there are lots of such Makefiles out
there.

> CYGWIN32 Make V3.75 seems to work fine.

I'm not sure it does.  It's quite possible that it ``works'' because
the Cygnus Make always calls the shell to run commands which use
redirection, and it is the Cygnus-ported Bash that takes care to
return to the original directory.  Add "SHELL=/bin/sh" to the
Makefile, install the DJGPP port of Bash, and you will see the same
behavior with the DJGPP port of Make.

When the Makefile does NOT say "SHELL=/bin/sh", and if SHELL in the
environment does NOT point to a program whose name seems like a Unixy
shell, the DJGPP port does NOT automatically invoke Bash because many
DOS Makefiles were not written for Bash and will break.

(Btw, this and other aspects of the shell issue in the DJGPP port are
described at some length in the file README.DOS which comes with
mak377b.zip; I suggest to re-read it.)

- Raw text -


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