title: Compile all CPP files using makefile under MinGW
body: <p>The directory structure of my C++ project is<br></p>
  
  <pre><code>/..
     makefile     &lt;- the makefile is in root
     /include     &lt;- subdirectory that has to be included while compiling
     /obj         &lt;- target place for all *.o and final executable
     /src         &lt;- sources
  </code></pre>
  
  <p>And my current makefile is:</p>
  
  <pre><code>CC=g++
  CFLAGS=-c -Wall -std=c++11
  
  INC=-Iinclude
  SRC=src
  TGT=obj
  
  all: myapp
  
  myapp: myapp.o
      $(CC) $(TGT)/myapp.o -o $(TGT)/myapp
  
  myapp.o:
      $(CC) $(CFLAGS) $(INC) $(SRC)/myapp.cpp -o $(TGT)/myapp.o
  
  clean:
      rm -rf $(TGT)
      mkdir $(TGT)
  </code></pre>
  
  <p>This worked for my first file. I am a total makefile novice - please help me compile all files under the <code>/src</code> directory and link them to an executable in <code>/obj</code> directory.</p>
  
  <p>the makefile has to work under Windows, I am using MinGW and MSYS</p>