title: Make recursive all C files
body: <p>I really can't get into makefiles. In previous projects, I hardcoded all compile tasks in the <strong>Makefile</strong>:</p>
  
  <pre><code>all: compile_a compile_b compile_c
  
  compile_a:
      ${CC} ${CFLAGS} ${A_SRC} -o ${A_OUT}
  </code></pre>
  
  <p>and so on.</p>
  
  <p>But as the latest project has <em>more files</em> than every project before, I want to write better make tasks and of course LESS characters as make is not really friendly to my eyes (it makes them suffer)! :-P</p>
  
  <p>What I want:</p>
  
  <ul>
  <li>One task to rule them all (just <code>make projectname</code> or <code>make all</code>, you know?)</li>
  <li>One task for every C file to compile (I read something about this <code>%.o: %.c</code> syntax, but didn't really get it)</li>
  <li>One task for linking (how to get all .o files and link them without hardcoding each?)</li>
  <li>One task for cleaning (oh, i can do this!)</li>
  </ul>
  
  <p>The project structure is:</p>
  
  <pre><code>bin (binary goes here!)
  src
    some
    directories 
    are
    here
  </code></pre>
  
  <p>I don't know if I need a directory for object files, I put them in <code>./bin</code>, I think that's good enough, isn't it?</p>
  
  <p>Maybe I just need someone who can explain it with easy words!</p>
  
  <p>EDIT:
  As someone pointed out, there's no real question, so here it goes:</p>
  
  <ul>
  <li>how to recursively compile all C files to <code>bin/(filename).o</code></li>
  <li>how to link all <code>.o</code> files in 'bin/' without knowing their names</li>
  </ul>
  
  <p>maybe this helps.</p>