string - How do I properly comment a variable definition in GNU Make (damn whitespaces)? -


so want comment variable definitions in makefile in-line. problem make doesn't strip white spaces between definition , comment. here example of mean:

opts += -dbla       # bla opts += -dblubb     # blubb opts += -dend  .phony test test:     @echo $(opts) 

the output of is

-dbla       -dblubb     -dend 

with annoying white spaces between options. want this:

-dbla -dblubb -dend 

how around problem? make string function @echo $(strip $(opts)) strip whitespaces after -dend or before -dbla, not inbetween. dirty hack far @echo $(shell $(opts)), strips unwanted spaces uses shell call so, introduce other problems, i.e. unwanted shell injection via $(opts) variable. there better way it? simple @echo ($subst ...) doesn't work on mixed whitespaces unless 1 replaces of them reinserts @ -.

image
of course, 'zzz' replaced "impossible" match...


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -