title: How to load and export variables from an .env file in Makefile?
body: <p>What is the best way to use a <code>.env</code> in a Makefile, i.e. loading that file and exporting all variables for subshells in <code>make</code>?</p>
  
  <p>It would be great if the proposed solution would work with <code>make</code> only, e.g. not using any third party tools. Also <code>.env</code> files support multiline variables like:</p>
  
  <p><code>
  FOO="this\nis\na\nmultiline\nvar"
  </code></p>
  
  <p>this is why <a href="https://stackoverflow.com/questions/30300830/load-env-file-in-makefile">this solution</a> is probably not adequate.</p>