I have a makefile that has C INCLUDES with spaces in them. There is no way for me to get around having to have the spaces in the file names. Is there any way to have spaces in file names with gnu make?
See Question&Answers more detail:osI have a makefile that has C INCLUDES with spaces in them. There is no way for me to get around having to have the spaces in the file names. Is there any way to have spaces in file names with gnu make?
See Question&Answers more detail:osMake has some basic support for this by escaping spaces in filenames, in that the following Makefile will correctly compile and recompile the C file foo?bar.c
:
foo bar: foo bar.c
gcc -o "${@}" "${<}"
However, you have to be super-careful in quoting every command you run, and variables that are space-separated lists of files—e.g., SRCS
, LIBS
—won’t work, although it’? possible that with enough hacking using Make text functions you can parse out the quotes and get everything working…
So while there is rudimentary support for spaces in filenames in rules and patterns, anything complicated is going to be an awful lot of very hard and frustrating work.