www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/24/09:57:02

Date: Mon, 24 Nov 1997 16:55:01 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Christopher Croughton <crough45 AT amc DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Substituting \ for / in make
In-Reply-To: <97Nov24.143606gmt+0100.17026@internet01.amc.de>
Message-ID: <Pine.SUN.3.91.971124164432.24907A-100000@is>
MIME-Version: 1.0

On Mon, 24 Nov 1997, Christopher Croughton wrote:

> the 'install' rule needs to use COPY on DOS and cp
> on Unix (because I can't guarantee that someone 
> compiling the DOS version will have installed the
> DJGPP fileutils).

Can you guarantee that they have the minimal DJGPP development suite 
(djdev) installed?  If so, use `update' on DOS: it understands forward 
slashes.  It also won't copy a file if its contents is identical, even if 
the time stamps differ.

> What I tried was to use
> 
>   $(DJDIR/bin:/=\\)

If you need the conversion, use the function $(subst), like this:

	$(subst, /,\\,$(DJDIR))

(it's described in the Make docs, in the chapter named "Functions").

Beware: non-GNU Make don't usually know about $(subst).

> Even worse, the environment variable DJDIR is set as C:/DJGPP.
> I know there was some reason for using slash instead of backslash,
> something wouldn't work, but I can't find any mention of this
> variable in either the FAQ or in readme.1st.  Is there a use for
> this variable, possibly in other install scripts, or is it
> a relic from some older installation (DJGPP version 1, possibly)?

All the rest of DJGPP.ENV settings use %DJDIR% to generate all the other 
directories used by the various ports.  If DJDIR is not set, you will be 
lost.  DJGPP.ENV arranges for forward slashes to be used because some 
ported programs (e.g. info.exe) don't like backslashes.

You shouldn't care if you use $(subst) as above.

- Raw text -


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