summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/Makefile
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-09-15 11:11:16 +0000
committerDave Chapman <dave@dchapman.com>2006-09-15 11:11:16 +0000
commit05a7f14f8dbf46fa64c035127ff1e04cfffb841b (patch)
treec107a0038736337811de70dd0e48e670d35246a2 /apps/plugins/zxbox/Makefile
parent1350d57751f30f1700912e6abaa1d845af973f75 (diff)
downloadrockbox-05a7f14f8dbf46fa64c035127ff1e04cfffb841b.zip
rockbox-05a7f14f8dbf46fa64c035127ff1e04cfffb841b.tar.gz
rockbox-05a7f14f8dbf46fa64c035127ff1e04cfffb841b.tar.bz2
rockbox-05a7f14f8dbf46fa64c035127ff1e04cfffb841b.tar.xz
Initial commit of zxbox - a ZX Spectrum emulator ported by Anton Romanov. It theoretically runs on all targets, but I have not included it in the Archos builds because it is just too slow to be usable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10950 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/zxbox/Makefile')
-rw-r--r--apps/plugins/zxbox/Makefile89
1 files changed, 89 insertions, 0 deletions
diff --git a/apps/plugins/zxbox/Makefile b/apps/plugins/zxbox/Makefile
new file mode 100644
index 0000000..d9f75d4
--- /dev/null
+++ b/apps/plugins/zxbox/Makefile
@@ -0,0 +1,89 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+#
+
+INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
+ -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) -I. $(TARGET_INC)
+CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
+ -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
+
+
+ifdef APPEXTRA
+ INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
+endif
+
+LINKFILE := $(OBJDIR)/link.lds
+DEPFILE = $(OBJDIR)/dep-zxbox
+
+# This sets up 'SRC' based on the files mentioned in SOURCES
+include $(TOOLSDIR)/makesrc.inc
+
+SOURCES = $(SRC)
+OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
+OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
+DIRS = .
+
+ifndef SIMVER
+ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
+ LDS := archos.lds
+ OUTPUT = $(OUTDIR)/zxbox.ovl
+else ## iRiver/iPod/... targets
+ LDS := ../plugin.lds
+ OUTPUT = $(OUTDIR)/zxbox.rock
+endif
+else ## simulators
+ OUTPUT = $(OUTDIR)/zxbox.rock
+endif
+
+all: $(OUTPUT)
+
+ifndef SIMVER
+$(OBJDIR)/zxbox.elf: $(OBJS) $(LINKFILE)
+ @echo "LD "`basename $@`
+ @$(CC) $(GCCOPTS) -O -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lgcc \
+ -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/zxbox.map
+
+$(OUTPUT): $(OBJDIR)/zxbox.elf
+ @echo "OBJCOPY "`basename $@`
+ @$(OC) -O binary $< $@
+else
+
+ifeq ($(SIMVER), sdl)
+###################################################
+# This is the SDL simulator version
+
+$(OUTPUT): $(OBJS)
+ @echo "LD $<"
+ @$(CC) $(CFLAGS) -shared $(OBJS) -L$(BUILDDIR) -lplugin -o $@
+ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
+# 'x' must be kept or you'll have "Win32 error 5"
+# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
+# #define ERROR_ACCESS_DENIED 5L
+else
+ @chmod -x $@
+endif
+
+endif
+endif # end of simulator section
+
+
+include $(TOOLSDIR)/make.inc
+
+# MEMORYSIZE should be passed on to this makefile with the chosen memory size
+# given in number of MB
+$(LINKFILE): $(LDS)
+ @echo "build "`basename $@`
+ @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) \
+ $(DEFINES) -E -P - >$@
+
+clean:
+ @echo "cleaning zxbox"
+ @rm -rf $(OBJDIR)/zxbox
+ @rm -f $(OBJDIR)/zxbox.* $(DEPFILE)
+
+-include $(DEPFILE)
+