Date: Tue, 4 Jul 2000 16:01:29 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Jeff T Williams cc: djgpp AT delorie DOT com Subject: Re: Using $(HOME) in makefile In-Reply-To: <200007041133.GAA04523@darwin.sfbr.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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".