Mail Archives: djgpp/2003/03/12/02:45:06
On Sat, 08 Mar 2003 11:29:11 +0200, "Eli Zaretskii" <eliz AT elta DOT co DOT il>
wrote:
>> From: H Johnson <classy-kg4wou AT kg4wou DOT com>
>> Newsgroups: comp.os.msdos.djgpp
>> Date: Fri, 07 Mar 2003 16:07:12 -0600
>>
>> I am pulling my hair out trying to get Make to use "\" as directory
>> separators vs. the "/" UNIX style.
>
>Please tell why do you need this. Unless absolutely necessary, it is
>not recommended to use backslashes in file names inside Makefiles; see
>the file README.DOS in the Make distribution for the reasons and
>explanations.
Because I also have a "clean" target which does the following:
for %X in ($(SRCDIR)) do del *.o
>
>> Nothing I have tried seems to work including escaping the "\".
>
... snip
>Again, please tell why do you need to see backslashes. DOS doesn't
>care, DJGPP programs don't care, so why should you care?
Apparently DOS does care because my clean function does not work...
For example, the SRCDIR variable has "dir1/subdir1 dir1/subdir2". All
files compile and link just fine. But when you try to do the "clean"
target above, DOS does not correctly parse SRCDIR so you get the
following output:
del dir1 *.o
del ubdir1 *.o
del dir1 *.o
del ubdir2 *.o
DOS interprets the /s in the path name to be a switch or control
character (or something else). At any rate it does not work.
And since all *.o files are all under the directory in which you
invoke make, I could just easily do:
clean:
del *.o /s
in the make file. But that does not work either because when I do a
"make clean" I get:
del *.o /s
Invalid switch - /s
Yet running "del *.o /s" from the command line does work as expected.
- H Johnson
- Raw text -