title: Makefile that rebuilds all if compiled with dif flags
body: <p>So I am having a little bit of a tough time trying to figure out how to make my Makefile so that when I do <code>make</code> and it compiles a release version then later on do a <code>make debug</code> it compiles a debug version with the new <code>-DDEBUG</code> and <code>-g</code> set on gcc if the files have not been updated.</p>
  
  <p>For example:</p>
  
  <ol>
  <li>main.cpp is edited</li>
  <li>run <code>make</code></li>
  <li>compiles main.cpp</li>
  <li>run <code>make debug</code></li>
  <li>main.cpp is not recompiled because there were no changes even though the flags for compilation differ</li>
  </ol>
  
  <p>Note I don't want to have to do a clean each time either because I dont want to have to recompile files if I do 2 <code>make</code>s in a row so setting clean as a dependency is not going to be a valid answer here</p>