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 @ -
.
of course, 'zzz' replaced "impossible" match...
Comments
Post a Comment