title: C++ Makefile missing separator in .dep
body: <p>On OS X Mavericks i am trying to build a project using the following Makefile:</p>
  
  <pre><code>CC=g++
  EXECUTABLE=minigi
  SRC_DIR=src
  INTERM_DIR=obj
  
  INCLUDES=-I $(SRC_DIR) -I /usr/local/Cg/examples/OpenGL/glew/include/
  LIBS=-L/usr/local/lang/NVIDIA_GPU_Computing_SDK/sdk/C/common/lib/linux/ -lpng -stdc++ -lGL -lGLU -lGLEW -lSDLmain -lSDL -lgomp
  CFLAGS_COMMON=$(INCLUDES)
  CFLAGS=$(CFLAGS_COMMON) -O3 -DNDEBUG -fopenmp
  #CFLAGS=$(CFLAGS_COMMON) -g -O0 -D_DEBUG 
  
  SOURCE_FILES=$(shell find $(SRC_DIR) -iname '*.cpp')
  DEP_FILES=$(SOURCE_FILES:$(SRC_DIR)/%.cpp=./$(INTERM_DIR)/%.dep)
  OBJ_FILES=$(SOURCE_FILES:$(SRC_DIR)/%.cpp=./$(INTERM_DIR)/%.o)
  
  all: $(EXECUTABLE)
  
  clean:
      rm -rf obj $(EXECUTABLE)
  
  .PHONY: clean all
  
  .SUFFIXES:
  .SUFFIXES:.o .dep .cpp .h
  
  $(INTERM_DIR)/%.dep: $(SRC_DIR)/%.cpp
      mkdir -p `dirname $@`
      printf `dirname $@`/ &gt; $@
      $(CC) $(CFLAGS_COMMON) $&lt; -MM | sed -r -e 's,^(.*)\.o\s*\:,\1.o $@ :,g' &gt;&gt; $@
  
  ifneq ($(MAKECMDGOALS),clean)
  -include $(DEP_FILES)
  endif
  
  $(INTERM_DIR)/%.o: $(SRC_DIR)/%.cpp
      mkdir -p $(INTERM_DIR)
      $(CC) $(CFLAGS) -c $&lt; -o $@
  
  $(EXECUTABLE): $(OBJ_FILES)
      $(CC) $^ $(LIBS) -o $@
  </code></pre>
  
  <p>However, when I type make I get the following error: </p>
  
  <pre><code>obj/app/sdl_gl_appliacation.dep:1: *** missing separator.  Stop.
  </code></pre>
  
  <p>The file obj/app/sdl_gl_application.dep looks as follows:</p>
  
  <pre><code>-n  obj/app/
  </code></pre>
  
  <p>As I know very little about makefiles (and did not write the posted one) every help would be appreciated.</p>
  
  <p>P.S. 
  I modified the line printf <code>dirname $@</code>/ > $@ . In the original file there was an echo -n but that is not working on OS X. </p>