title: Makefile for simple C++ OpenGL program
body: <p>I'm trying to write a makefile for an OpenGL program written in C++ (OSX).</p>
  
  <p>Right now, there is only the single file chess.cpp, but I expect to add other files to the project, so I'm trying to create a makefile that I can expand to handle new files as needed. I'm getting these errors: </p>
  
  <p><code>clang: error: no such file or directory: 'chess.o'</code></p>
  
  <p><code>clang: warning: -framework GLUT: 'linker' input unused</code></p>
  
  <p><code>clang: warning: -framework OpenGL: 'linker' input unused</code></p>
  
  <p><code>make: *** [chess.o] Error 1</code></p>
  
  <p>This is the makefile that I created. It's borrowed from something that I normally use for C programs, so if it looks strange, that could be why. How can I make this work for my C++ project?</p>
  
  <pre><code>CC = g++
  CFLAGS = -c -g -Wall -Wextra
  DEPS =
  LDFLAGS = -framework GLUT -framework OpenGL
  
  all: chess
  
  %.o: %.cpp $(DEPS)
          $(CC) -c -o $@ $&lt; $(CFLAGS)
  
  chess.o: chess.cpp
          $(CC) -c chess.cpp chess.o $(LDFLAGS)
  
  chess: chess.o
          $(CC) -o chess.o (LDFLAGS)
  
  clean:
          rm chess
          rm *.o
  </code></pre>