Post
by maik » Wed Jul 28, 2010 1:03 pm
I ran into the same problem and I have patched avr8.h accordingly.
I have also patched the Makefiles of all demos, so they now take platform specifics of avr-size into account. Also they use the local version of packrom now.
Hope this helps.
Cheers,
Maik
Here's the patch:
Index: tools/uzem/avr8.h
===================================================================
--- tools/uzem/avr8.h (revision 175)
+++ tools/uzem/avr8.h (working copy)
@@ -37,6 +37,8 @@
#include <winioctl.h>
#elif defined(LINUX)
#include <sys/mman.h> // Linux memory mapped I/O
+#elif defined(__APPLE__) & defined(__MACH__)
+ #include <sys/mman.h> // Mac OS X memory mapped I/O
#else
#include <sys/mmap.h> // Unix memory mapped I/O
#endif
Index: demos/Bootloader_Pragma/default/Makefile
===================================================================
--- demos/Bootloader_Pragma/default/Makefile (revision 175)
+++ demos/Bootloader_Pragma/default/Makefile (working copy)
@@ -43,6 +43,13 @@
## Objects explicitly added by the user
LINKONLYOBJECTS =
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) ${PROJECT}.hex ${PROJECT}.eep ${PROJECT}.lss size
@@ -81,7 +88,7 @@
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/BitmapDemo/default/Makefile
===================================================================
--- demos/BitmapDemo/default/Makefile (revision 175)
+++ demos/BitmapDemo/default/Makefile (working copy)
@@ -52,6 +52,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).uze size
@@ -89,11 +96,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(PROJECT).hex $@ $(INFO)
+ -../../../bin/packrom $(PROJECT).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Mode9Demo/default/Makefile
===================================================================
--- demos/Mode9Demo/default/Makefile (revision 175)
+++ demos/Mode9Demo/default/Makefile (working copy)
@@ -54,6 +54,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -91,11 +98,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/MusicDemo/default/Makefile
===================================================================
--- demos/MusicDemo/default/Makefile (revision 175)
+++ demos/MusicDemo/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -90,11 +97,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Arkanoid/default/Makefile
===================================================================
--- demos/Arkanoid/default/Makefile (revision 175)
+++ demos/Arkanoid/default/Makefile (working copy)
@@ -54,6 +54,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -101,11 +108,11 @@
%.uze: $(TARGET)
@echo
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Bootloader/default/Makefile
===================================================================
--- demos/Bootloader/default/Makefile (revision 175)
+++ demos/Bootloader/default/Makefile (working copy)
@@ -44,6 +44,13 @@
## Objects explicitly added by the user
LINKONLYOBJECTS =
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) Bootloader.hex Bootloader.eep Bootloader.lss size
@@ -75,7 +82,7 @@
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/SuperMarioDemo/default/Makefile
===================================================================
--- demos/SuperMarioDemo/default/Makefile (revision 175)
+++ demos/SuperMarioDemo/default/Makefile (working copy)
@@ -55,6 +55,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -92,11 +99,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Maze/default/Makefile
===================================================================
--- demos/Maze/default/Makefile (revision 175)
+++ demos/Maze/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -90,11 +97,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/DrMario/default/Makefile
===================================================================
--- demos/DrMario/default/Makefile (revision 175)
+++ demos/DrMario/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -90,11 +97,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Uzeamp/default/Makefile
===================================================================
--- demos/Uzeamp/default/Makefile (revision 175)
+++ demos/Uzeamp/default/Makefile (working copy)
@@ -55,6 +55,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -99,11 +106,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Tutorial/default/Makefile
===================================================================
--- demos/Tutorial/default/Makefile (revision 175)
+++ demos/Tutorial/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -90,11 +97,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/SDCardDemo/default/Makefile
===================================================================
--- demos/SDCardDemo/default/Makefile (revision 175)
+++ demos/SDCardDemo/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -93,11 +100,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Whack-a-Mole/default/Makefile
===================================================================
--- demos/Whack-a-Mole/default/Makefile (revision 175)
+++ demos/Whack-a-Mole/default/Makefile (working copy)
@@ -54,6 +54,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -94,11 +101,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/VectorDemo/default/Makefile
===================================================================
--- demos/VectorDemo/default/Makefile (revision 175)
+++ demos/VectorDemo/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -91,11 +98,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/VideoDemo/default/Makefile
===================================================================
--- demos/VideoDemo/default/Makefile (revision 175)
+++ demos/VideoDemo/default/Makefile (working copy)
@@ -52,6 +52,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss $(PROJECT).uze size
@@ -95,11 +102,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(PROJECT).hex $@ $(INFO)
+ -../../../bin/packrom $(PROJECT).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/Megatris/default/Makefile
===================================================================
--- demos/Megatris/default/Makefile (revision 175)
+++ demos/Megatris/default/Makefile (working copy)
@@ -53,6 +53,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: ../data/graphics.inc $(TARGET) $(GAME).hex $(GAME).eep $(GAME).lss $(GAME).uze size
@@ -98,11 +105,11 @@
avr-objdump -h -S $< > $@
%.uze: $(TARGET)
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean
Index: demos/SpriteDemo/default/Makefile
===================================================================
--- demos/SpriteDemo/default/Makefile (revision 175)
+++ demos/SpriteDemo/default/Makefile (working copy)
@@ -54,6 +54,13 @@
## Include Directories
INCLUDES = -I"$(KERNEL_DIR)"
+UNAME := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+
+AVR_SIZE_FLAGS := -C --mcu=${MCU}
+ifeq ($(UNAME),Darwin)
+ AVR_SIZE_FLAGS := -A
+endif
+
## Build
all: $(TARGET) SpriteDemo.hex SpriteDemo.eep SpriteDemo.lss $(GAME).uze size
@@ -92,11 +99,11 @@
%.uze: $(TARGET)
@echo
- -packrom $(GAME).hex $@ $(INFO)
+ -../../../bin/packrom $(GAME).hex $@ $(INFO)
size: ${TARGET}
@echo
- @avr-size -C --mcu=${MCU} ${TARGET}
+ @avr-size ${AVR_SIZE_FLAGS} ${TARGET}
## Clean target
.PHONY: clean