title: Makefile to convert all *.c to *.o
body: <p>I am writing a Makefile for compiling all *.c files in a directory into 
  *.o . There are many *.c files so I don't want to do it on individual basis, </p>
  
  <p>I tried </p>
  
  <pre><code>%.o: %.c
          $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $&lt;
  </code></pre>
  
  <p>but this isn't working ... please help me understand what's going wrong here ...</p>