Date: Sat, 08 Mar 2003 11:29:11 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: djgpp AT delorie DOT com Message-Id: <1858-Sat08Mar2003112910+0200-eliz@elta.co.il> X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9 In-reply-to: <3i5i6vsg9rgbfbn00p2dna50v1e943ucpf@4ax.com> (message from H Johnson on Fri, 07 Mar 2003 16:07:12 -0600) Subject: Re: Problems with file names with Make References: <3i5i6vsg9rgbfbn00p2dna50v1e943ucpf AT 4ax DOT com> Reply-To: Eli Zaretskii 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 > From: H Johnson > 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. > Nothing I have tried seems to work including escaping the "\". Escaping should work, in general. But it doesn't work in every place in a Makefile; that's one reason why it should be avoided. > # Source files (C and Assembler). > SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c)) > > dep: > $(CC) $(CINCLUDE) -nostdinc -fno-builtin -M $(SRC_C) > ./depend.mk > > running as is works fine except everything dumped into depend.mk has > "/" instead of "\". That's because GCC produces file names with forward slashes. > By changing the SRC_C line at the end to read "$(dir)\.c))" produces > no output. Changing to "$(dir)\\.c))" produces nothing as well. Probably because GCC's -M feature does not support backslashes. Again, please tell why do you need to see backslashes. DOS doesn't care, DJGPP programs don't care, so why should you care?