title: Creating my own makefile [Error 255]
body: <p>I have been enjoying the luxury of coding with an IDE that writes my makefile's for me, Iv decided that I have been 'short cutting' for far to long, so I have read a few manuals and watched a few videos on makefiles and have a makefile semi-done, the only trouble that I'm having is I'm not sure how to link libraries.</p>
  
  <pre><code>CPPS := $(shell ls src/*cpp)
  TEMP := $(subst src/,obj/,$(CPPS))
  OBJS := $(subst .cpp,.o,$(TEMP))
  HEADERS := $(shell ls inc/*.h)
  EXEC := bin/testfile
  
  all: $(EXEC)
  
  $(EXEC) : $(OBJS) $(HEADERS)
  g++ -I inc/ $(OBJS) -o $(EXEC) -lSDL -lGLU
  $(EXEC)
  
  obj/%.o: src/%.cpp
  g++ -Wall -I inc/ -c $&lt; -o $@
  </code></pre>
  
  <p>ps: just incase I am saying the wrong thing when I say 'Library flags' I mean <code>-lSDL -lGLU</code> etc...</p>
  
  <p>Wherever I put them they dont seem to work.</p>
  
  <p>This is the error I get when I insert the lib flags,
  <code>make: *** [bin/testfile] Error 255</code></p>
  
  <blockquote>
    <p>The Error 255 is produced by make as a result of its command shell not being able to find a command for a particular rule.</p>
  </blockquote>
  
  <p>If i dont include them I get standard 'undefined' messages.</p>
  
  <p>Any help with this would be greatly appreciated! Thank you</p>