makefile - Put names of the files containing spaces in quotes -
let's have makefile following.
foo: filename file\ name\ with\ spaces cat 'filename' 'file name spaces' > foo
however, don't have 2 files. have lot of them, trying make makefile more consistent way.
foo: filename file\ name\ with\ spaces cat $^ > foo
this works fine long file names not contain spaces. way put file names $^
in single quotes? or there other way around problem of spaces?
edit
i found partially solution.
foo: filename.txt file\ name\ with\ spaces.txt cat '$(subst .txt ,.txt' ',$^)' > foo
unfortunately, works when files have same extension. can not write script works file name.
Comments
Post a Comment