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

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -