www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/02/23/09:22:03

Date: Tue, 23 Feb 1999 16:20:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Bug in make?
In-Reply-To: <m10FHAs-000S6NC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.990223161111.3867G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

On Tue, 23 Feb 1999, Salvador Eduardo Tropea (SET) wrote:

> Just $(MAKE), it looks like the second copy of make expands this variable 
> using some strange thing.

It just takes argv[0] as it is passed by DOS, and doesn't do anything to 
change how it looks.

> Why if make is called with $(MAKE) expands with 
> forward slashes and if make is called with "make" expands it with forward 
> slashes?

Because the top-level Make gets argv[0] with all slashes converted to 
forward slashes by the startup code.  This is the default operation of 
the startup code (you can change it with one of the bits in 
__crt0_startup_flags).

In the second case, E:\DJ\BIN/make.exe is created by spawnv, by looking
along the PATH, and passed like that to the child Make.  When argv[0] is
passed from another DJGPP program, it is not subject to the normal startup
processing, but is instead passed as is.  This is how DJGPP always 
worked, since v1.x, and it was decided to not change that in v2.x.

> Is very strange. From where comes these forward slashes? argv[0]? 

From argv[0] that is created by __dosexec_find_on_path function from 
dosexec.c and passed via spawnv to the child.

> 1) Make used a mixed stuff (2 back and one forward!)

So?  Most programs, including DOS itself and Make, don't have any 
problems with such pathnames.

> 2) Make expands this variable in a different way if:

No, the expansion is the same, it's just that argv[0] is different in 
these two cases, like I explained above.

- Raw text -


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