Mail Archives: djgpp/2000/07/04/09:02:09
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 -