Is it possible to insert a new-line to be executed within a foreach
loop in a Makefile?
Currently, I have the following:
$(foreach my_lib,$(MY_LIBS),$(call my_func,results,boxer,$(my_lib)))
Now, assuming that I have:
MY_LIBS = lib1 \
lib2
The above foreach
loop would evaluate to:
lib1 lib2
I would like this to evaluate to:
lib1
lib2
Is it possible to insert a newline in the foreach
loop to accomplish this?
Thank you.
define \n
endef
$(error Here is a message${\n}with embedded${\n}newlines.${\n}${\n}hooray!)
You can use ${\n}
in things like $(subst...)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With