Reputation: 2472
I have something along the lines of
define URLS
http://www.foo.com/
http://www.bar.com/
http://www.foo1.com/
endef
How can I flatten that so that it uses spaces instead of linefeeds (I've tried tinkering with $(subst) with little luck) or iterate over each item with a for loop? I realize I can define it differently, but was hoping for a nice clean one-item-per-line solution.
Thanks.
Upvotes: 2
Views: 418
Reputation: 25523
First, you need to define \n
, because you can't use it literally.
define \n
endef
Now one may use subst
as follows:
URLS := $(subst $(\n), ,$(URLS))
Upvotes: 3