I am aware of questions like this one, but my question is specifically about makefile, specifically gnumake.
I have a command that prints line breaks and other whitespace to standard out. I want to capture that output into a variable and then later print the variable to a file.
Example Makefile:
OUTPUT=${shell cowsay hello}
all:
@echo "$(OUTPUT)" > output.txt
After running make, output.txt contains:
_______ < hello > ------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
I want it to retain the whitespaces and instead contain:
_______
< hello >
-------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
The command I'm actually using is not cowsay, but it outputs similar whitespace and linebreaks.