title: Why make cannot pick up environment variables
body: <p>I have tested a few makes and having issues of environment variables in the shell is not inside the Make file. I wonder what is wrong in my setup.  I tested on my mac os, redhat, and Ubuntu.  They all have the same behavior.  I wonder anyone can help with this.</p>
  
  <pre><code>GNU Make 4.1
  </code></pre>
  
  <p>Here is my simplest make file:</p>
  
  <pre><code>ifdef $(HOME)
   $(info $$HOME is $(HOME))
  else
   $(info $$HOME is undefined)
  endif
  
  all :
      echo do nothing
  </code></pre>
  
  <p>When typing make at the terminal I get</p>
  
  <pre><code>$HOME is undefined
  echo do nothing
  do nothing
  </code></pre>
  
  <p>echo $HOME</p>
  
  <pre><code>/Users/myusername
  </code></pre>
  
  <p>Here is the definition from make's manual book <a href="https://www.gnu.org/software/make/manual/html_node/Environment.html" rel="nofollow">https://www.gnu.org/software/make/manual/html_node/Environment.html</a></p>
  
  <p>Variables in make can come from the environment in which make is run. Every environment variable that make sees when it starts up is transformed into a make variable with the same name and value. But an explicit assignment in the makefile, or with a command argument, overrides the environment.</p>