Is this possible at all and how?
Update: I need this because I create a file both from dynamic and static data.
Use case:
If you're using Gnu Make, use a 'define' to create a multi-line text variable, and a rule to echo it into your file. See 6.8 Defining Multi-Line Variables of https://www.gnu.org/software/make/manual/make.html#Appending
Like this:
define myvar
# line 1\nline 2\nline 3\n#etc\n
endef
myfile.txt:
/bin/echo -e "$(myvar)) >myfile.txt
To create this, it helps to use an editor, create the file you want to have, append "\n" to the end of every line, and then join them all into a single string. Paste that into your makefile.
Tested with GNU Make 3.81 on linux.