title: multiple targets build in makefile
body: <p>Any idea why something like this wouldnt work in makefile ?</p>
  
  <pre><code>all : $(GOAL_DB) $(GOAL)
  
  %.d: %.cpp      
      $(CC) $(CPPFLAGS_DB) $&lt;  &gt; $@
  %.o : %.cpp
      $(CC) $(FLAGS_DB) $&lt; -o $@
  
  $(GOAL_DB) : $(OFILES)
          $(CC) $(LFLAGS_DB) -o $@ $^ $(LIBS_DB)
      strip $(GOAL_DB)
      rm -f *.o *.d
  
  %.d: %.cpp     
      $(CC) $(CPPFLAGS) $&lt;  &gt; $@
  %.o : %.cpp
      $(CC) $(FLAGS) $&lt; -o $@
  $(GOAL) : $(OFILES)
          $(CC) $(LFLAGS) -o $@ $^ $(LIBS)
      strip $(GOAL)
      rm -f *.o *.d
  </code></pre>
  
  <p>I'm just trying to build two different targets using make all , GNU make. </p>
  
  <p>The first target builds fine , but it not creating new objects files for another target. </p>