title: Mingw and make variables
body: <p>I'm trying to compile an open source project on windows under mingw/msys.</p>
  
  <p>The makefile contains (among others) this line</p>
  
  <pre><code>@${MAKE} --no-print-directory -C . -f physfs.make
  </code></pre>
  
  <p>physfs.make contains (among others) these lines:</p>
  
  <pre><code>ifndef CC
    CC = gcc
  endif
  </code></pre>
  
  <p>when I ran make I get the following error:</p>
  
  <pre><code>Creating obj/Debug/physfs
  physfs.c
  make[1]: cc: Command not found
  make[1]: *** [obj/Debug/physfs/physfs.o] Error 127
  make: *** [physfs] Error 2
  </code></pre>
  
  <p>If I comment the ifndef / endif pair leaving CC = gcc intact, the build works. If instead of make I issue this command:</p>
  
  <pre><code>make -e CC=gcc
  </code></pre>
  
  <p>the build works as well. But when I run the following command in msys:</p>
  
  <pre><code>echo $CC
  </code></pre>
  
  <p>nothing is displayed.</p>
  
  <p>I think there is something basic about how environment variables work in MSYS and make that I don't understand.</p>
  
  <p>Could please some help me troubleshoot this issue, so I can understand <em>why</em> simple 'make' command complains and why the ifndef block doesn't function as I expect it to function.</p>