I’m writing a dead simple Makefile to be used with GHCi and gedit. Essentially, I define a module to load, and a function (along with its parameters) to call/test. The Makefile would need to execute GHCi and then pass the necessary commands into it. I tried piping with echo, and it worked in a normal shell, but fails due to the way make handles whitespace, strings & formatting. It feeds the whole thing as as one single line, rather than individual lines of input. On top of that, it is a bit messy.
# Sorry if backslashes are messed up do to tabs...
module = somemodule
function = somefunction
params = 5 "Hello"
default: *.hs
echo \
:l $(module) \
\
$(function) $(params) \
| ghci
How could I acheive this cleanly and elegantly? 🙂
Have you tried using two separate
echocommands?