delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/04/09:02:09

Date: Tue, 4 Jul 2000 16:01:29 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Jeff T Williams <jeffw AT darwin DOT sfbr DOT org>
cc: djgpp AT delorie DOT com
Subject: Re: Using $(HOME) in makefile
In-Reply-To: <200007041133.GAA04523@darwin.sfbr.org>
Message-ID: <Pine.SUN.3.91.1000704155711.3385A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 4 Jul 2000, Jeff T Williams wrote:

> My C development trees are rooted differently on my Unix box at work and my 
> DJGPP box at home, so I wanted to use $(HOME) in makefiles to facilitate 
> portability, e.g.,
> 
> INCLUDE += -I$(HOME)/c/nrjtw/include
> 
> where HOME is set in my autoexec.bat: set HOME=c:\
> 
> This usage generates numerous warnings on my DJGPP box but not on my Unix box. 
>  You can see below the reason:  on the DJGPP box (DOS 5.0, bash 2.03, make 
> 3.79, gcc 2.7.2.1) the INCLUDE variable expands as
> 
> 	-Ic:\/c/nrjtw/include
> 
> which somebody (gcc?) doesn't like.
[snip]
> For the time being I have the makefile check COMSPEC and define HOME 
> accordingly.  But is there a better way?

There are several ways:

	set HOME=c:
	set HOME=c:/
	set HOME=/dev/c

A slightly different solutions would be to have INCLUDE be set to one of 
the values inside Makefile, and then set it from the command line for the 
other value, like in "make INCLUDE=c:/c/nrjtw/include".

- Raw text -


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