I want to use GNUMake to run a rule-based makefile which builds a set of C files in a directory structure (on a Windows file system).
The root directory, some sub-di
The easiest thing is indeed to fix the file names.
Failing that, though, write your commands to put double quotes around the file names. The easiest and safest thing is to put all the file names into macros; the trick there is that you have to escape the double quotes, which Make is otherwise going to want to eat up itself.
So: FN="\"C:\My Documents\myfiles.c\"" FN2="C:\My Documents\myfile2.c"
or use $(CC) $(CFLAGS) "$(FN2)"
The trick here is to echo your command line with echo
echo $(CC) $(CFLAGS) "$(FN2)"
or use make -d to get all the details of what make is trying to do.
You may need to hack about with this a bit, in particular, you may need to double up the escapes