title: make error: "g++: error: main.o: No such file or directory"
body: <p>I am new to Makefile and trying to create a cpp project with it.
  Now I have only "hello world" program (only main.cpp file).
  I can't stop getting this error when trying to compile with make:</p>
  
  <pre><code>g++ -std=c++0x -g -Wall -o sub_game  main.o
  g++: error: main.o: No such file or directory
  g++: fatal error: no input files
  compilation terminated.
  Makefile:38: recipe for target 'sub_game' failed
  make: *** [sub_game] Error 4
  </code></pre>
  
  <p>I don't understand what I am doing wrong, would appreciate your help.</p>
  
  <p>This is the  Makefile:</p>
  
  <pre><code># the compiler: gcc for C program, define as g++ for C++
  CC = g++
  
  # compiler flags:
  #  -g    adds debugging information to the executable file
  #  -Wall turns on most, but not all, compiler warnings
  CXXLAGS  = -std=c++0x -g -Wall
  
  # the build target executable:
  TARGET = sub_game 
  
  # define any libraries to link into executable:
  LIBS = -lpthread -lgtest
  
  # define the C source files
  SRCS = ../src
  
  # define the C object files 
  #
  # This uses Suffix Replacement within a macro:
  #   $(name:string1=string2)
  #         For each word in 'name' replace 'string1' with 'string2'
  # Below we are replacing the suffix .cc of all words in the macro SRCS
  # with the .o suffix
  #
  #OBJ = $(SRCS)/main.cc
  OBJ = main.o
  
  # define any directories containing header files other than /usr/include
  #
  INCLUDES = -I../include
  
  all : $(TARGET)
  
  $(TARGET) : $(OBJ)
              $(CC) $(CXXLAGS) -o $(TARGET) $(OBJ)
  
  main.o : $(SRCS)/main.cpp
  
  .PHONY : clean
  clean :
      rm $(TARGET) $(OBJ)
  </code></pre>
  
  <p>Thank you in advanced.</p>