delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/11/13:49:17

Date: Thu, 11 Jun 1998 20:48:56 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Laszlo Molnar <molnarl AT cdata DOT tvnet DOT hu>
cc: djgpp AT delorie DOT com
Subject: Re: directory changing problem with make
In-Reply-To: <19980611013127.D302@cdata.tvnet.hu>
Message-ID: <Pine.SUN.3.91.980611204839.26077U-100000@is>
MIME-Version: 1.0

On Thu, 11 Jun 1998, Laszlo Molnar wrote:

> The scripts in the `pod' directory (like pod/pod2html.PL) begin with a
> chdir to the `pod' directory but they don't chdir back to the base
> directory at the end. This should be no problem, because make should
> take care of this, but it seems djgpp's make doesn't do that
> (make 3.76.1).

Make on Unix doesn't need to take care of this at all, since current
directory is local to a process there, so if a program invoked by
Make chdirs somewhere, it doesn't affect Make itself, and the next
command starts from the same place the original one did.

But DOS and Windows are different.  The DJGPP port is careful to
restore the original directory when Make itself exits, but it doesn't
do so between commands in a rule.  The reason for this is
compatibility to DOS Makefile's which run several commands after
changing to some directory, like this:

   foo:
	cd foobar
	bar file1 file2
	baz file3 file3

Since most DOS Make's don't support multiple commands on the same line
(DJGPP's port does support it), they don't have any choice but to use
the above paradigm.  And I didn't want to break this.

> I hope this could be corrected in the next release (and I will be able
> to remove my ugly workaround from Perl's makefile).

Sorry, I don't think it can be corrected, since this is a feature, not
a bug.  This really is one of the cases where Unix compatibility
conflicts with DOS/Windows compatibility, and I don't see how this can
be resolved.

- Raw text -


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