title: CFLAGS are ignored in Makefile
body: <p>I am using the following makefile to build my project:</p>
  
  <pre><code>CC      = /usr/bin/g++
  CFLAGS  = -Wall -pedantic -std=c++0x
  LDFLAGS = 
  
  OBJ = main.o pnmhandler.o pixmap.o color.o 
  
  pnm: $(OBJ)
      $(CC) $(CFLAGS) -o pnm $(OBJ) $(LDFLAGS)
  
  %.o: %.c
      $(CC) $(CFLAGS) -c $&lt;
  </code></pre>
  
  <p>As I run make I get the following error:</p>
  
  <blockquote>
    <p>/usr/include/c++/4.9.1/bits/c++0x_warning.h:32:2: error: #error This
    file requires compiler and library support for the ISO C++ 2011
    standard. This support is currently experimental, and must be enabled
    with the -std=c++11 or -std=gnu++11 compiler options.</p>
  </blockquote>
  
  <p>As I can read from the following line, the CFLAGS are not properly included, but I have no idea what I am doing wrong:</p>
  
  <blockquote>
    <p>g++    -c -o main.o main.cpp</p>
  </blockquote>
  
  <p>Also tried <code>-std=c++11</code> and <code>-std=gnu++11</code>, without any results. Any ideas?</p>
  
  <p>If I run <code>make -Bn</code>, I get:</p>
  
  <pre><code>g++    -c -o main.o main.cpp
  g++    -c -o pnmhandler.o pnmhandler.cpp
  g++    -c -o pixmap.o pixmap.cpp
  g++    -c -o color.o color.cpp
  /usr/bin/g++ -Wall -pedantic -std=c++0x -o pnm main.o pnmhandler.o pixmap.o color.o  
  </code></pre>
  
  <p><strong>EDIT:</strong> Replacing the rule <code>%.o: %.c</code> with <code>%.o: %.cpp</code> fixes my problem.</p>