title: Makefile seems to be compiling files in the wrong order
body: <p>I created a makefile on my own as a tutorial testing various features. It seems that I have an error though since it gives me the output:</p>
  
  <pre><code>    g++  src/test1.o -o dcpu-16
  src/test1.o: In function `_fini':
  (.fini+0x0): multiple definition of `_fini'
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
  src/test1.o: In function `data_start':
  (.data+0x0): multiple definition of `__data_start'
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
  src/test1.o: In function `data_start':
  (.data+0x8): multiple definition of `__dso_handle'
  /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o:(.data+0x0): first defined here
  src/test1.o:(.rodata+0x0): multiple definition of `_IO_stdin_used'
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
  src/test1.o: In function `_start':
  (.text+0x10): multiple definition of `_start'
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o:(.text+0x0): first defined here
  src/test1.o: In function `_init':
  (.init+0x0): multiple definition of `_init'
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
  /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
  src/test1.o:(.data+0x10): first defined here
  /usr/bin/ld: error in src/test1.o(.eh_frame); no .eh_frame_hdr table will be created.
  collect2: error: ld returned 1 exit status
  makefile:35: recipe for target 'dcpu-16' failed
  make: *** [dcpu-16] Error 1
  </code></pre>
  
  <p>The makefile used is this:</p>
  
  <pre><code>WARNINGS := -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align \
              -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations \
              -Wredundant-decls -Wnested-externs -Winline -Wno-long-long \
              -Wuninitialized -Wconversion -Wstrict-prototypes -Wno-unused-function
  
  CC   := gcc
  CXX  := g++ 
  LD   := g++
  CP   := cp
  
  SOURCES:=$(shell find src/ -name "*.cpp")
  
  OBJECTS=$(SOURCES:.cpp=.o)
  DEPFILES := $(OBJECTS:.o=.d)
  GARBAGE := core core.* *.stackdump ./tags $(EXECUTABLE)
  
  EXECUTABLE=dcpu-16
  
  OPTFLAGS  := -g -O3
  CFLAGS   += $(OPTFLAGS) $(WARNINGS)
  CXXFLAGS += $(CFLAGS)
  LDFLAGS=
  
  ifeq ($(DEBUG_BUILD),1)
      CFLAGS +=-DDEBUG_BUILD
  endif
  
  .PHONY: clean all
  
  default: $(EXECUTABLE)
  
  all: $(SOURCES) $(EXECUTABLE)
  
  $(EXECUTABLE): $(OBJECTS)
      $(LD) $(LDFLAGS) $(OBJECTS) -o $@
  
  .cpp.o:
      $(LD) $(CFLAGS) -c $&lt; -o $@
  
  clean: 
      rm -rf $(EXECUTABLE) $(OBJECTS) $(GARBAGE) $(DEPFILES)
  </code></pre>
  
  <p>What is it that I messed up exactly on the makefile above and is it any good in general or has it any other flaws other than the immediate compilation issue?</p>