title: Linking object build in sub directory in makefile
body: <p>I am trying to link all object I have build in my makefile during the executable compilation, but I cant seem to automate selecting the build directory.</p>
  
  <p>I have tried:</p>
  
  <pre><code>test: $(OBJECTS)
      $(CC) $(CFLAGS) $(INCDIR) $(LIBDIR) $(BUILDDIR)/$^ test.cpp -o test.exe
  </code></pre>
  
  <p>The problem is that <code>$(BUILDDIR)/$^</code> only inserts <code>$(BUILDDIR)</code> in front of the first object file.</p>
  
  <p>How should I be doing this?</p>