aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-07-05 10:07:06 +0000
committerMax Horn2010-07-05 10:07:06 +0000
commitdb1fa71745a6604612f295c4f5a33169bde75a75 (patch)
treed441a254dc5448d8c388ffff6240aac4bf6c17b3
parent179a2b4e88842b04eec46aa29c7c4a88123b5a50 (diff)
downloadscummvm-rg350-db1fa71745a6604612f295c4f5a33169bde75a75.tar.gz
scummvm-rg350-db1fa71745a6604612f295c4f5a33169bde75a75.tar.bz2
scummvm-rg350-db1fa71745a6604612f295c4f5a33169bde75a75.zip
NDS: Enable compilation of backend specific files
Also tried to enable the conversion of .raw/.pal/.bin files, but this does not currently work (probably something really silly, but I don't have the time to debug this right now). svn-id: r50671
-rw-r--r--backends/platform/ds/ds.mk10
-rw-r--r--backends/platform/ds/module.mk33
2 files changed, 37 insertions, 6 deletions
diff --git a/backends/platform/ds/ds.mk b/backends/platform/ds/ds.mk
index 555e7ece06..40a7e14965 100644
--- a/backends/platform/ds/ds.mk
+++ b/backends/platform/ds/ds.mk
@@ -18,7 +18,7 @@ OPT_SIZE := -Os -mthumb
#-mthumb -fno-gcse -fno-schedule-insns2
-OBJS := $(DATA_OBJS) $(LIBCARTRESET_OBJS) $(PORT_OBJS) $(COMPRESSOR_OBJS) $(FAT_OBJS)
+#OBJS := $(DATA_OBJS) $(LIBCARTRESET_OBJS) $(PORT_OBJS) $(COMPRESSOR_OBJS) $(FAT_OBJS)
# TODO: Handle files in OPTLIST.
@@ -99,10 +99,10 @@ $(ndsdir)/arm7/source/main.o: CXXFLAGS=$(ARM7_CXXFLAGS)
$(ndsdir)/arm7/source/main.o: CPPFLAGS=
# Rule for creating ARM7 .bin files from .elf files
-%.bin: %.elf
- @echo ------
- @echo Building $@...
- $(OBJCOPY) -O binary $< $@
+#%.bin: %.elf
+# @echo ------
+# @echo Building $@...
+# $(OBJCOPY) -O binary $< $@
# Rule for creating ARM7 .elf files by linking .o files together with a special linker script
%.elf:
diff --git a/backends/platform/ds/module.mk b/backends/platform/ds/module.mk
index 16630dc070..676fd20628 100644
--- a/backends/platform/ds/module.mk
+++ b/backends/platform/ds/module.mk
@@ -59,7 +59,38 @@ LIBCARTRESET_OBJS :=
#arm9/source/libcartreset/cartreset.o
-MODULE_OBJS :=
+#MODULE_OBJS := $(PORT_OBJS) $(DATA_OBJS) $(FAT_OBJS)
+MODULE_OBJS := $(DATA_OBJS) $(LIBCARTRESET_OBJS) $(PORT_OBJS) $(COMPRESSOR_OBJS) $(FAT_OBJS)
+
+
+#---------------------------------------------------------------------------------
+# canned command sequence for binary data
+#---------------------------------------------------------------------------------
+define bin2o
+ bin2s $< | $(AS) -mthumb -mthumb-interwork -o $(@)
+ echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(<F) | tr . _)`.h
+ echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(<F) | tr . _)`.h
+ echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(<F) | tr . _)`.h
+endef
+
+#---------------------------------------------------------------------------------
+%.o : %.bin
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+#---------------------------------------------------------------------------------
+%.o : %.raw
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+#---------------------------------------------------------------------------------
+%.o : %.pal
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+