Mail Archives: djgpp/2003/03/08/04:34:39
> 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.
> 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?
- Raw text -