How do I handle files with spaces in my Makefile? -


so anonymous developers have decided use ridiculous convention of using spaces in folder names contain source files. change these folders not use spaces sadly don't make rules around here that's not option (though wish were).

luac            = luac  src_dir         = . source          =                                                      \ stupid/naming\ convention/a.lua                                        \ stupid/naming\ convention/very\ annoying/b.lua                         \  vpath .lua $(src_dir)  out_dir         = ../out/ output          = $(patsubst %.lua, $(out_dir)/%.luac, $(source))   all: $(output)  $(out_dir)/%.luac: %.lua     $(luac) "$<"     mv luac.out "$@"  .phony: 

simple makefile. it's meant compile lua files have , put them output directory.

no matter keeps wanting split source string on spaces in folder, end beautiful error this:

make: *** no rule make target `stupid/naming ', needed `all'.  stop. 

is there way fix without renaming folders?

thanks in advance.

the short, imo correct, answer make (not gnu make, posix-style make implementations) not support pathnames containing whitespace. if want use make, "anonymous developers" cannot use them. if insist absolute requirement should switch different build tool altogether, support whitespace in filenames.

yes, it's barely possible create makefile work filenames containing whitespace, have rewrite makefiles scratch, , not able use many of features of gnu make makefiles long, difficult read, , difficult maintain.

just tell them on themselves. or if can't, try having them create workspace in pathname without whitespace in names, create symbolic link containing whitespace pointing real workspace (the other way around won't work in situations).


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -