title: How to compile all .c files in a directory and output each binary without the .c extension
body: <p>I have a directory with multiple c source files (every file is a small program by itself) which I would like to compile all at once and output the binary for each one in the subdirectory bin/. The name of the binary should be the one of the c source file, but without the .c extension.
  How could I accomplish something like that in a Makefile?</p>
  
  <p>Example:</p>
  
  <pre><code>-src
      ll.c
      lo.c
      -bin
          ll
          lo
  </code></pre>
  
  <p>The first thing I came up with is this:</p>
  
  <pre><code>CFLAGS=-Wall -g
  SRC=$(wildcard *.c)
  
  all: $(SRC)
      gcc $(CFLAGS) $(SRC) -o bin/$(SRC)
  </code></pre>
  
  <p>But this does not really work how I thought it would.</p>