trying to build from makefile on osx

The Uzebox now have a fully functional emulator! Download and discuss it here.
Post Reply
powerpants
Posts: 30
Joined: Sat Nov 14, 2009 10:07 am

trying to build from makefile on osx

Post by powerpants »

but getting errors....

Code: Select all

~/Desktop/uzebox_src_dev_trunk_r151/tools/uzem > make
make debug
=================================
Building Debug...
Platform: Unix-MACOSX
=================================
g++ -c uzem.cpp -o Debug/uzem.o -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DMACOSX -D_GNU_SOURCE=1 -DGUI=1 -g -MD -MP -MF Debug/uzem.d -DUSE_PORT_PRINT=0 -DUSE_SPI_DEBUG=1 -DUSE_EEPROM_DEBUG=1 -DUSE_GDBSERVER_DEBUG=1
In file included from uzem.cpp:28:
avr8.h:41:52: error: sys/mmap.h: No such file or directory
In file included from uzem.cpp:28:
avr8.h: In constructor ‘avr8::avr8()’:
avr8.h:229: warning: deprecated conversion from string constant to ‘char*’
make[1]: *** [Debug/uzem.o] Error 1
make: *** [all] Error 2
What should I do?
User avatar
filipe
Posts: 42
Joined: Thu Dec 17, 2009 10:37 pm
Location: Cambridge, UK

Re: trying to build from makefile on osx

Post by filipe »

Hi,

I think no one was using Mac until now. At least since I worked on the Uzem, no one give me feedback about the build system changes.
About the error, the compiler is complaining about the mmap.h file. For linux is being included the mman.h, I don't know which one is used in Mac OS, but...

Looks like this header it's not being used anyway. Try this:

Remove the red lines in avr8.h and try to build:

#if defined(__WIN32__)
#include <windows.h> // Win32 memory mapped I/O
#include <winioctl.h>
#elif defined(LINUX)
#include <sys/mman.h> // Linux memory mapped I/O
#else
#include <sys/mmap.h> // Unix memory mapped I/O

#endif

-Filipe
powerpants
Posts: 30
Joined: Sat Nov 14, 2009 10:07 am

Re: trying to build from makefile on osx

Post by powerpants »

that worked, thanks!
tim1724
Posts: 30
Joined: Mon Dec 08, 2008 8:38 pm

Re: trying to build from makefile on osx

Post by tim1724 »

filipe wrote:Hi,

I think no one was using Mac until now. At least since I worked on the Uzem, no one give me feedback about the build system changes.
About the error, the compiler is complaining about the mmap.h file. For linux is being included the mman.h, I don't know which one is used in Mac OS, but...

Mac OS X uses mman.h, like Linux.

I run Uzem on Mac OS X, but haven't built an updated copy in a long time.
maik
Posts: 4
Joined: Wed Feb 25, 2009 8:02 pm

Re: trying to build from makefile on osx

Post by maik »

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
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: trying to build from makefile on osx

Post by uze6666 »

Added to the to do list, thanks!

-Uze
Post Reply