delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/03/12/02:45:06

From: H Johnson <classy-kg4wou AT kg4wou DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problems with file names with Make
Date: Mon, 10 Mar 2003 10:52:08 -0600
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <hsfp6v8ebqtthnvrjkdjg3clgq1tqccped@4ax.com>
References: <3i5i6vsg9rgbfbn00p2dna50v1e943ucpf AT 4ax DOT com> <1858-Sat08Mar2003112910+0200-eliz AT elta DOT co DOT il>
X-Newsreader: Forte Agent 1.91/32.564
MIME-Version: 1.0
X-Complaints-To: abuse AT supernews DOT com
Lines: 59
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


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