aboutsummaryrefslogtreecommitdiff
path: root/Demos/Host
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-08-08 08:30:42 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-08-08 08:30:42 +0000
commit3162f7d6f88ae1459d9330bf2ef6612ff6a64c71 (patch)
tree654ff1e6ea5334bfbac0f02058af3b43f0ef3d07 /Demos/Host
parentcb4474c0df0a1091170857e5708bba6e28e08aa5 (diff)
Fix invocations of avr-size in all makefiles broken on unpatched *nix systems, due to the recent update to the latest WinAVR makefile template.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1435 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Demos/Host')
-rw-r--r--Demos/Host/ClassDriver/JoystickHostWithParser/makefile5
-rw-r--r--Demos/Host/ClassDriver/KeyboardHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/KeyboardHostWithParser/makefile5
-rw-r--r--Demos/Host/ClassDriver/MIDIHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/MassStorageHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/MouseHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/MouseHostWithParser/makefile5
-rw-r--r--Demos/Host/ClassDriver/PrinterHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/RNDISEthernetHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/StillImageHost/makefile5
-rw-r--r--Demos/Host/ClassDriver/VirtualSerialHost/makefile5
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/makefile5
-rw-r--r--Demos/Host/LowLevel/GenericHIDHost/makefile5
-rw-r--r--Demos/Host/LowLevel/JoystickHostWithParser/makefile5
-rw-r--r--Demos/Host/LowLevel/KeyboardHost/makefile5
-rw-r--r--Demos/Host/LowLevel/KeyboardHostWithParser/makefile5
-rw-r--r--Demos/Host/LowLevel/MIDIHost/makefile5
-rw-r--r--Demos/Host/LowLevel/MassStorageHost/makefile5
-rw-r--r--Demos/Host/LowLevel/MouseHost/makefile5
-rw-r--r--Demos/Host/LowLevel/MouseHostWithParser/makefile5
-rw-r--r--Demos/Host/LowLevel/PrinterHost/makefile5
-rw-r--r--Demos/Host/LowLevel/RNDISEthernetHost/makefile5
-rw-r--r--Demos/Host/LowLevel/StillImageHost/makefile5
-rw-r--r--Demos/Host/LowLevel/VirtualSerialHost/makefile5
24 files changed, 96 insertions, 24 deletions
diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/makefile b/Demos/Host/ClassDriver/JoystickHostWithParser/makefile
index 3d408ae6..2d353d6a 100644
--- a/Demos/Host/ClassDriver/JoystickHostWithParser/makefile
+++ b/Demos/Host/ClassDriver/JoystickHostWithParser/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/KeyboardHost/makefile b/Demos/Host/ClassDriver/KeyboardHost/makefile
index e9372119..1931bc46 100644
--- a/Demos/Host/ClassDriver/KeyboardHost/makefile
+++ b/Demos/Host/ClassDriver/KeyboardHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile b/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile
index d5325bb3..775d9701 100644
--- a/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile
+++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/MIDIHost/makefile b/Demos/Host/ClassDriver/MIDIHost/makefile
index c2a987e0..451a9081 100644
--- a/Demos/Host/ClassDriver/MIDIHost/makefile
+++ b/Demos/Host/ClassDriver/MIDIHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/MassStorageHost/makefile b/Demos/Host/ClassDriver/MassStorageHost/makefile
index e8ccd7be..44115faf 100644
--- a/Demos/Host/ClassDriver/MassStorageHost/makefile
+++ b/Demos/Host/ClassDriver/MassStorageHost/makefile
@@ -489,7 +489,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/MouseHost/makefile b/Demos/Host/ClassDriver/MouseHost/makefile
index f12dd887..c5d29edc 100644
--- a/Demos/Host/ClassDriver/MouseHost/makefile
+++ b/Demos/Host/ClassDriver/MouseHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/makefile b/Demos/Host/ClassDriver/MouseHostWithParser/makefile
index ecbdc2f6..aa4bf7a4 100644
--- a/Demos/Host/ClassDriver/MouseHostWithParser/makefile
+++ b/Demos/Host/ClassDriver/MouseHostWithParser/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/PrinterHost/makefile b/Demos/Host/ClassDriver/PrinterHost/makefile
index 3434ad5d..60ecddd6 100644
--- a/Demos/Host/ClassDriver/PrinterHost/makefile
+++ b/Demos/Host/ClassDriver/PrinterHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/makefile b/Demos/Host/ClassDriver/RNDISEthernetHost/makefile
index 3f1b082f..05d56d67 100644
--- a/Demos/Host/ClassDriver/RNDISEthernetHost/makefile
+++ b/Demos/Host/ClassDriver/RNDISEthernetHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/StillImageHost/makefile b/Demos/Host/ClassDriver/StillImageHost/makefile
index f34358f1..4efef10d 100644
--- a/Demos/Host/ClassDriver/StillImageHost/makefile
+++ b/Demos/Host/ClassDriver/StillImageHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/makefile b/Demos/Host/ClassDriver/VirtualSerialHost/makefile
index 6399d2da..d16e8320 100644
--- a/Demos/Host/ClassDriver/VirtualSerialHost/makefile
+++ b/Demos/Host/ClassDriver/VirtualSerialHost/makefile
@@ -488,7 +488,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/Incomplete/BluetoothHost/makefile b/Demos/Host/Incomplete/BluetoothHost/makefile
index 50de5a14..ae632ff5 100644
--- a/Demos/Host/Incomplete/BluetoothHost/makefile
+++ b/Demos/Host/Incomplete/BluetoothHost/makefile
@@ -498,7 +498,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/GenericHIDHost/makefile b/Demos/Host/LowLevel/GenericHIDHost/makefile
index d8fcddf7..e9dbab5a 100644
--- a/Demos/Host/LowLevel/GenericHIDHost/makefile
+++ b/Demos/Host/LowLevel/GenericHIDHost/makefile
@@ -489,7 +489,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/makefile b/Demos/Host/LowLevel/JoystickHostWithParser/makefile
index b9a82370..a56fdf28 100644
--- a/Demos/Host/LowLevel/JoystickHostWithParser/makefile
+++ b/Demos/Host/LowLevel/JoystickHostWithParser/makefile
@@ -490,7 +490,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/KeyboardHost/makefile b/Demos/Host/LowLevel/KeyboardHost/makefile
index 877f0e2e..02b19f91 100644
--- a/Demos/Host/LowLevel/KeyboardHost/makefile
+++ b/Demos/Host/LowLevel/KeyboardHost/makefile
@@ -489,7 +489,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile
index a100eeaf..ded32f8e 100644
--- a/Demos/Host/LowLevel/KeyboardHostWithParser/makefile
+++ b/Demos/Host/LowLevel/KeyboardHostWithParser/makefile
@@ -490,7 +490,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/MIDIHost/makefile b/Demos/Host/LowLevel/MIDIHost/makefile
index 27b899fd..ca8f9933 100644
--- a/Demos/Host/LowLevel/MIDIHost/makefile
+++ b/Demos/Host/LowLevel/MIDIHost/makefile
@@ -489,7 +489,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/MassStorageHost/makefile b/Demos/Host/LowLevel/MassStorageHost/makefile
index 3728b760..a17934d1 100644
--- a/Demos/Host/LowLevel/MassStorageHost/makefile
+++ b/Demos/Host/LowLevel/MassStorageHost/makefile
@@ -491,7 +491,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/MouseHost/makefile b/Demos/Host/LowLevel/MouseHost/makefile
index 5aeaf872..a6a21830 100644
--- a/Demos/Host/LowLevel/MouseHost/makefile
+++ b/Demos/Host/LowLevel/MouseHost/makefile
@@ -489,7 +489,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/MouseHostWithParser/makefile b/Demos/Host/LowLevel/MouseHostWithParser/makefile
index 84a5f728..0c882582 100644
--- a/Demos/Host/LowLevel/MouseHostWithParser/makefile
+++ b/Demos/Host/LowLevel/MouseHostWithParser/makefile
@@ -490,7 +490,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/PrinterHost/makefile b/Demos/Host/LowLevel/PrinterHost/makefile
index 66efd03e..f8698cf0 100644
--- a/Demos/Host/LowLevel/PrinterHost/makefile
+++ b/Demos/Host/LowLevel/PrinterHost/makefile
@@ -490,7 +490,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/makefile b/Demos/Host/LowLevel/RNDISEthernetHost/makefile
index 06aed481..98faa823 100644
--- a/Demos/Host/LowLevel/RNDISEthernetHost/makefile
+++ b/Demos/Host/LowLevel/RNDISEthernetHost/makefile
@@ -490,7 +490,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/StillImageHost/makefile b/Demos/Host/LowLevel/StillImageHost/makefile
index de242d8e..4434d760 100644
--- a/Demos/Host/LowLevel/StillImageHost/makefile
+++ b/Demos/Host/LowLevel/StillImageHost/makefile
@@ -490,7 +490,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
diff --git a/Demos/Host/LowLevel/VirtualSerialHost/makefile b/Demos/Host/LowLevel/VirtualSerialHost/makefile
index 6e15fafa..d3842011 100644
--- a/Demos/Host/LowLevel/VirtualSerialHost/makefile
+++ b/Demos/Host/LowLevel/VirtualSerialHost/makefile
@@ -489,7 +489,10 @@ end:
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
-ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
+ELFSIZE = $(SIZE) $(MCU_FLAG) $(FORMAT_FLAG) $(TARGET).elf
+MCU_FLAG = $(shell $(SIZE) --help | grep -- --mcu > /dev/null && echo --mcu=$(MCU) )
+FORMAT_FLAG = $(shell $(SIZE) --help | grep -- --format=.*avr > /dev/null && echo --format=avr )
+
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \