title: Makefile recipe with a here-document redirection
body: <p>Does anyone know how to use a here-document redirection on a recipe?</p>
  
  <pre><code>test:
    sh &lt;&lt;EOF
    echo I Need This
    echo To Work
    ls
    EOF
  </code></pre>
  
  <p>I can't find any solution trying the usual backslash method (which basically ends with a command in a single line).</p>
  
  <p>Rationale:</p>
  
  <p>I have a set of multi-line recipes that I want to proxy through another command (e.g., sh, docker).</p>
  
  <pre><code>onelinerecipe := echo l1
  define twolinerecipe :=
  echo l1
  echo l2
  endef
  define threelinerecipe :=
  echo l1
  echo l2
  echo l3
  endef
  
  # sh as proxy command and proof of concept
  proxy := sh
  
  test1:
    $(proxy) &lt;&lt;EOF
    $(onelinerecipe)
    EOF
  
  test2:
    $(proxy) &lt;&lt;EOF
    $(twolinerecipe)
    EOF
  
  test3:
    $(proxy) &lt;&lt;EOF
    $(threelinerecipe)
    EOF
  </code></pre>
  
  <p>The solution I would love to avoid: transform multiline macros into single lines.</p>
  
  <pre><code>define threelinerecipe :=
  echo l1;
  echo l2;
  echo l3
  endef
  
  test3:
    $(proxy) &lt;&lt;&lt; "$(strip $(threelinerecipe))"
  </code></pre>
  
  <p>This works (I use gmake 4.0 and bash as make's shell) but it requires changing my recipes and I have a lot.
  Strip removes the newlines, from the macro, then everything is written in a single line.</p>
  
  <p>My end goal is: <code>proxy := docker run ...</code></p>