|
@@ -149,8 +149,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),90)
|
149
|
149
|
HARDWARE_VARIANT ?= SanguinoA
|
150
|
150
|
MCU ?= atmega644
|
151
|
151
|
|
152
|
|
-#
|
153
|
|
-Final OMCA board
|
|
152
|
+#Final OMCA board
|
154
|
153
|
else ifeq ($(HARDWARE_MOTHERBOARD),91)
|
155
|
154
|
HARDWARE_VARIANT ?= Sanguino
|
156
|
155
|
MCU ?= atmega644p
|
|
@@ -241,10 +240,6 @@ AVRDUDE = avrdude
|
241
|
240
|
REMOVE = rm -f
|
242
|
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
|
243
|
# Place -D or -U options here
|
249
|
244
|
CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
|
250
|
245
|
CXXDEFS = $(CDEFS)
|
|
@@ -275,12 +270,10 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
|
275
|
270
|
endif
|
276
|
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
|
279
|
# Programming support using avrdude. Settings and variables.
|
|
@@ -386,13 +379,9 @@ extcoff: $(TARGET).elf
|
386
|
379
|
$(NM) -n $< > $@
|
387
|
380
|
|
388
|
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
|
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
|
386
|
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
|
398
|
387
|
$(Pecho) " CC $<"
|