Browse Source

Reverted the patch by KevinOConnor, as it crashes some versions of avr-gcc and caused linking issues.

Daid 12 years ago
parent
commit
b264317fa0
1 changed files with 7 additions and 18 deletions
  1. 7
    18
      Marlin/Makefile

+ 7
- 18
Marlin/Makefile View File

149
 HARDWARE_VARIANT ?= SanguinoA
149
 HARDWARE_VARIANT ?= SanguinoA
150
 MCU              ?= atmega644
150
 MCU              ?= atmega644
151
 
151
 
152
-#
153
-Final OMCA board
152
+#Final OMCA board
154
 else ifeq  ($(HARDWARE_MOTHERBOARD),91)
153
 else ifeq  ($(HARDWARE_MOTHERBOARD),91)
155
 HARDWARE_VARIANT ?= Sanguino
154
 HARDWARE_VARIANT ?= Sanguino
156
 MCU              ?= atmega644p
155
 MCU              ?= atmega644p
241
 REMOVE = rm -f
240
 REMOVE = rm -f
242
 MV = mv -f
241
 MV = mv -f
243
 
242
 
244
-# Tool for testing compiler flags
245
-cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
246
-    ; then echo "$(2)"; else echo "$(3)"; fi ;)
247
-
248
 # Place -D or -U options here
243
 # Place -D or -U options here
249
 CDEFS    = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
244
 CDEFS    = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
250
 CXXDEFS  = $(CDEFS)
245
 CXXDEFS  = $(CDEFS)
275
 endif
270
 endif
276
 #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
271
 #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
277
 
272
 
278
-CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) \
279
-    $(call cc-option,$(CC),-flto -fwhole-program,)
280
-CXXFLAGS :=         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING) \
281
-    $(call cc-option,$(CC),-flto -fwhole-program,)
282
-#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs 
283
-LDFLAGS = -lm -Wl,--relax
273
+CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
274
+CXXFLAGS :=         $(CDEFS) $(CINCS) -O$(OPT) -Wall    $(CEXTRA) $(CTUNING)
275
+#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
276
+LDFLAGS = -lm
284
 
277
 
285
 
278
 
286
 # Programming support using avrdude. Settings and variables.
279
 # Programming support using avrdude. Settings and variables.
386
 	$(NM) -n $< > $@
379
 	$(NM) -n $< > $@
387
 
380
 
388
 	# Link: create ELF output file from library.
381
 	# Link: create ELF output file from library.
389
-$(BUILD_DIR)/$(TARGET).elf: $(BUILD_DIR)/$(TARGET).o
390
-	$(Pecho) "  CXX   $@"
391
-	$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $^ $(LDFLAGS)
392
-
393
-$(BUILD_DIR)/$(TARGET).o: $(OBJ) Configuration.h
382
+$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
394
 	$(Pecho) "  CXX   $@"
383
 	$(Pecho) "  CXX   $@"
395
-	$P $(CC) $(ALL_CXXFLAGS) -nostdlib -Wl,-r -o $@ $(OBJ)
384
+	$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $(OBJ) $(LDFLAGS)
396
 
385
 
397
 $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
386
 $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
398
 	$(Pecho) "  CC    $<"
387
 	$(Pecho) "  CC    $<"

Loading…
Cancel
Save