Make 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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…