bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnu gmake question


From: Hans-Bernhard Broeker
Subject: Re: gnu gmake question
Date: 7 Dec 2000 17:45:25 GMT

Byerley, Seth <address@hidden> wrote:

> I could not seem to find any documentation on using a backwards 
> slash \ explicitly in a variable declaration from within a 
> makefile that is in turn built by using gmake. 

The best way often is not to use backslashes at all, in Makefiles.
That's one of the few things that can make GNU make a real pain to use
on DOSish platforms, despite all the efforts of the valiant people who
ported it. Drive letters (conflicting with the colon used in Make
rules) are another one.

OTOH, while you may believe you absolutely need them, actually DOS
isself (the OS kernel) doesn't care about backslashes at all. It groks
forward slashes for all filename just as easily as backslashes.  Only
the tools (command.com & Friends) make you use '\'.

Anyway. If you really need literal backslashes in makefile variables,
you have to double them in input, i.e.:

ifdef _dos

SRC_PATH = ..\\src\\$(LIB_NAME)
SOURCE_PATH = $(SRC_PATH)\\


pre_build:
        @$(CP) -f $(SOURCE_PATH)*.rc  

But as, in this example, $(CP) obviously is a Unix-style tool, anyway,
you can probably just use forward slashes and live happily ever after.

-- 
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]