aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds/arm9/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/ds/arm9/makefile')
-rw-r--r--backends/platform/ds/arm9/makefile188
1 files changed, 69 insertions, 119 deletions
diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile
index c43c28c223..c9a665c442 100644
--- a/backends/platform/ds/arm9/makefile
+++ b/backends/platform/ds/arm9/makefile
@@ -111,7 +111,7 @@ USE_ARM_COSTUME_ASM = 1
#WRAP_MALLOC = 1
ifdef DS_BUILD_A
- DEFINES += -DDS_SCUMM_BUILD -DDS_BUILD_A -DUSE_ARM_GFX_ASM -DUSE_ARM_COSTUME_ASM
+ DEFINES = -DDS_BUILD_A -DUSE_ARM_GFX_ASM -DUSE_ARM_COSTUME_ASM
LOGO = logoa.bmp
ENABLE_SCUMM = $(ENABLED)
USE_ARM_GFX_ASM = 1
@@ -119,7 +119,7 @@ ifdef DS_BUILD_A
endif
ifdef DS_BUILD_B
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_B
+ DEFINES = -DDS_BUILD_B
LOGO = logob.bmp
ENABLE_SKY = $(ENABLED)
ENABLE_QUEEN = $(ENABLED)
@@ -127,14 +127,14 @@ ifdef DS_BUILD_B
endif
ifdef DS_BUILD_C
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_C
+ DEFINES = -DDS_BUILD_C
LOGO = logoc.bmp
ENABLE_AGOS = $(ENABLED)
BUILD=scummvm-C
endif
ifdef DS_BUILD_D
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_D
+ DEFINES = -DDS_BUILD_D
LOGO = logod.bmp
ENABLE_GOB = $(ENABLED)
ENABLE_CINE = $(ENABLED)
@@ -143,42 +143,42 @@ ifdef DS_BUILD_D
endif
ifdef DS_BUILD_E
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_E
+ DEFINES = -DDS_BUILD_E
LOGO = logoe.bmp
ENABLE_SAGA = $(ENABLED)
BUILD=scummvm-E
endif
ifdef DS_BUILD_F
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_F
+ DEFINES = -DDS_BUILD_F
LOGO = logof.bmp
ENABLE_KYRA = $(ENABLED)
BUILD=scummvm-F
endif
ifdef DS_BUILD_G
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_G
+ DEFINES = -DDS_BUILD_G
LOGO = logog.bmp
ENABLE_LURE = $(ENABLED)
BUILD=scummvm-G
endif
ifdef DS_BUILD_H
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_H
+ DEFINES = -DDS_BUILD_H
LOGO = logoh.bmp
ENABLE_PARALLACTION = $(ENABLED)
BUILD=scummvm-H
endif
ifdef DS_BUILD_I
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_I
+ DEFINES = -DDS_BUILD_I
LOGO = logoi.bmp
ENABLE_MADE = $(ENABLED)
BUILD=scummvm-I
endif
ifdef DS_BUILD_K
- DEFINES += -DDS_NON_SCUMM_BUILD -DDS_BUILD_K
+ DEFINES = -DDS_BUILD_K
LOGO = logok.bmp
ENABLE_CRUISE = $(ENABLED)
BUILD=scummvm-K
@@ -186,14 +186,14 @@ endif
#ifdef DS_BUILD_L
-# DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_L
+# DEFINES = -DDS_BUILD_L
# LOGO = logog.bmp
# ENABLE_DRASCULA = $(ENABLED)
# BUILD=scummvm-K
#endif
#ifdef DS_BUILD_M
-# DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_M
+# DEFINES = -DDS_BUILD_M
# LOGO = logog.bmp
# ENABLE_TUCKER = $(ENABLED)
# BUILD=scummvm-K
@@ -206,7 +206,6 @@ CXX = arm-eabi-g++
LD = arm-eabi-g++
CFLAGS = -Wno-multichar -Wall\
- -Wno-multichar -mcpu=arm9tdmi -mtune=arm9tdmi \
-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
-mthumb-interwork -DUSE_ARM_COSTUME_ASM=1 -DDISABLE_SID
@@ -252,9 +251,11 @@ ifdef WRAP_MALLOC
DEFINES += -DWRAP_MALLOC
endif
+BACKEND := ds
+
INCLUDES= -I$(portdir) -I$(srcdir) -I$(srcdir)/engines \
-I$(portdir)/data -I$(portdir)/../commoninclude \
- -I$(portdir)/source -I$(portdir)/source/mad -I$(portdir)/source/libcartreset \
+ -I$(portdir)/source -I$(portdir)/source/mad \
-I$(libndsdir)/include -include $(srcdir)/common/scummsys.h
LIBS = -lm -L$(libndsdir)/lib -L$(portdir)/lib -lnds9
@@ -271,12 +272,13 @@ PRE_OBJS_FLAGS = -Wl,--whole-archive
POST_OBJS_FLAGS = -Wl,--no-whole-archive
endif
-#-Lscumm -lscumm -Lbase -lbase -Lcommon -lcommon -Lgraphics -lgraphics -Lgui -lgui -Lsound -lsound
EXECUTABLE = scummvm.elf
+
PLUGIN_PREFIX =
PLUGIN_SUFFIX = .plg
PLUGIN_EXTRA_DEPS = $(srcdir)/backends/plugins/ds/plugin.ld $(srcdir)/backends/plugins/plugin.syms $(EXECUTABLE)
PLUGIN_LDFLAGS += -nostartfiles -Wl,-q,--target1-abs,--just-symbols,$(EXECUTABLE),-T$(srcdir)/backends/plugins/ds/plugin.ld,--retain-symbols-file,$(srcdir)/backends/plugins/plugin.syms -lstdc++ -lc -mthumb-interwork -mno-fpu#-Wl,--gc-sections -mno-crt0 $(DEVKITPRO)/devkitARM/arm-eabi/lib/ds_arm9_crt0.o
+
MKDIR = mkdir -p
RM = rm -f
RM_REC = rm -rf
@@ -286,72 +288,77 @@ OBJCOPY = arm-eabi-objcopy
AS = arm-eabi-as
HAVE_GCC3 = true
-PORT_OBJS := $(portdir)/source/blitters_arm.o $(portdir)/source/cdaudio.o $(portdir)/source/dsmain.o \
- $(portdir)/../../../fs/ds/ds-fs.o $(portdir)/source/gbampsave.o $(portdir)/source/scummhelp.o\
- $(portdir)/source/osystem_ds.o $(portdir)/source/ramsave.o\
- $(portdir)/source/touchkeyboard.o $(portdir)/source/zipreader.o\
- $(portdir)/source/dsoptions.o $(portdir)/source/keys.o $(portdir)/source/wordcompletion.o\
- $(portdir)/source/interrupt.o
+PORT_OBJS := \
+ $(portdir)/source/blitters_arm.o \
+ $(portdir)/source/cdaudio.o \
+ $(portdir)/source/dsmain.o \
+ $(portdir)/source/gbampsave.o \
+ $(portdir)/source/scummhelp.o \
+ $(portdir)/source/osystem_ds.o \
+ $(portdir)/source/touchkeyboard.o \
+ $(portdir)/source/zipreader.o \
+ $(portdir)/source/dsoptions.o \
+ $(portdir)/source/keys.o \
+ $(portdir)/source/wordcompletion.o \
+ $(portdir)/source/interrupt.o
ifdef USE_PROFILER
PORT_OBJS += $(portdir)/source/profiler/cyg-profile.o
endif
-DATA_OBJS := $(portdir)/data/icons.o $(portdir)/data/keyboard.o $(portdir)/data/keyboard_pal.o $(portdir)/data/default_font.o $(portdir)/data/8x8font_tga.o
-
-COMPRESSOR_OBJS :=
-#$(portdir)/source/compressor/lz.o
+DATA_OBJS := \
+ $(portdir)/data/icons.o \
+ $(portdir)/data/keyboard.o \
+ $(portdir)/data/keyboard_pal.o \
+ $(portdir)/data/default_font.o \
+ $(portdir)/data/8x8font_tga.o
+
+FAT_OBJS := \
+ $(portdir)/source/fat/disc_io.o \
+ $(portdir)/source/fat/gba_nds_fat.o \
+ $(portdir)/source/fat/io_fcsr.o \
+ $(portdir)/source/fat/io_m3cf.o \
+ $(portdir)/source/fat/io_mpcf.o \
+ $(portdir)/source/fat/io_sccf.o \
+ $(portdir)/source/fat/io_m3sd.o \
+ $(portdir)/source/fat/io_nmmc.o \
+ $(portdir)/source/fat/io_scsd.o \
+ $(portdir)/source/fat/io_scsd_asm.o \
+ $(portdir)/source/fat/io_njsd.o \
+ $(portdir)/source/fat/io_mmcf.o \
+ $(portdir)/source/fat/io_sd_common.o \
+ $(portdir)/source/fat/io_m3_common.o \
+ $(portdir)/source/fat/io_dldi.o \
+ $(portdir)/source/fat/m3sd.o
-FAT_OBJS := $(portdir)/source/fat/disc_io.o $(portdir)/source/fat/gba_nds_fat.o\
- $(portdir)/source/fat/io_fcsr.o $(portdir)/source/fat/io_m3cf.o\
- $(portdir)/source/fat/io_mpcf.o $(portdir)/source/fat/io_sccf.o\
- $(portdir)/source/fat/io_m3sd.o\
- $(portdir)/source/fat/io_nmmc.o $(portdir)/source/fat/io_scsd.o \
- $(portdir)/source/fat/io_scsd_asm.o \
- $(portdir)/source/fat/io_njsd.o \
- $(portdir)/source/fat/io_mmcf.o \
- $(portdir)/source/fat/io_sd_common.o \
- $(portdir)/source/fat/io_m3_common.o \
- $(portdir)/source/fat/io_dldi.o \
- $(portdir)/source/fat/m3sd.o
-
-
-# $(portdir)/source/fat/io_cf_common.o $(portdir)/source/fat/io_m3_common.o\
-# $(portdir)/source/fat/io_sd_common.o $(portdir)/source/fat/io_scsd_s.o \
-# $(portdir)/source/fat/io_sc_common.o $(portdir)/source/fat/io_sd_common.o
-
-LIBCARTRESET_OBJS :=
-#$(portdir)/source/libcartreset/cartreset.o
# Files in this list will be optimisied for speed, otherwise they will be optimised for space
-OPTLIST := actor.cpp ds_main.cpp osystem_ds.cpp blitters.cpp mame.cpp rate.cpp isomap.cpp image.cpp gfx.cpp sprite.cpp actor_path.cpp actor_walk.cpp script.cpp
+OPTLIST := actor.cpp dsmain.cpp osystem_ds.cpp blitters.cpp mame.cpp rate.cpp isomap.cpp image.cpp gfx.cpp sprite.cpp actor_path.cpp actor_walk.cpp script.cpp
#OPTLIST :=
# Compiler options for files which should be optimised for speed
ifdef DS_BUILD_E
-# Another attempt to save some RAM in ITE
-OPT_SPEED := -O3 -mthumb
+ # Another attempt to save some RAM in ITE
+ OPT_SPEED := -O3 -mthumb
else
-#OPT_SPEED := -O3
-
-OPT_SPEED := -Os -mthumb
-
+ OPT_SPEED := -O3
endif
# Compiler options for files which should be optimised for space
OPT_SIZE := -Os -mthumb
-#-mthumb -fno-gcse -fno-schedule-insns2
-
+OBJS := $(DATA_OBJS) $(PORT_OBJS) $(FAT_OBJS)
-OBJS := $(DATA_OBJS) $(LIBCARTRESET_OBJS) $(PORT_OBJS) $(COMPRESSOR_OBJS) $(FAT_OBJS)
MODULE_DIRS += .
+#ndsall: plugins
+# make -f makefile scummvm.nds
+
ndsall: plugins
- make -f makefile scummvm.nds
+ make -f makefile scummvm.nds scummvm.ds.gba
include $(srcdir)/Makefile.common
@@ -360,26 +367,13 @@ semiclean:
clean:
$(RM) $(OBJS) $(EXECUTABLE)
- rm -rf gui engines sound common plugins base backends graphics scummvm.nds scummvm.elf scummvm-stripped.elf scummvm.ds.gba *.h
-
-plugin_dist :
- for p in $(PLUGINS); do \
- arm-elf-strip -g -o "`basename \"$$p\" | LC_CTYPE=C tr '[:lower:]' '[:upper:]'`" "$$p"; \
- done
+ rm -rf *.h engines plugins scummvm.nds scummvm.ds.gba
dist : SCUMMVM.BIN plugins plugin_dist
#---------------------------------------------------------------------------------
# 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 . _)`"_raw_end[];" > `(echo $(<F) | tr . _)`.h
-# echo "extern const u8" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_raw[];" >> `(echo $(<F) | tr . _)`.h
-# echo "extern const u32" `(echo $(<F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_raw_size";" >> `(echo $(<F) | tr . _)`.h
-#endef
-
-
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
@@ -388,34 +382,10 @@ define bin2o
endef
-#define bin2o
-# @echo $(*)
-# cp $(<) $(*).tmp
-# $(OBJCOPY) -I binary -O elf32-littlearm -B arm \
-# --rename-section .data=.rodata \
-# --redefine-sym _binary_$(subst .,_,$(subst /,_,$(*)))_tmp_start=$(notdir $*)\
-# --redefine-sym _binary_$(subst .,_,$(subst /,_,$(*)))_tmp_end=$(notdir $*)_end\
-# $(*).tmp $(@)
-# echo "extern const u8" $(notdir $*)"[] __attribute__ ((aligned (4)));" > $(*).h
-# echo "extern const u32" $(notdir $(*))_size[]";" >> $(*).h
-#
-# echo $(*).h
-# rm $(*).tmp
-#endef
-
-
##############
# Replacement rule for the one in makefile.common
##############
%.o: %.cpp
-# echo !!!!!!!!!!!! $(notdir $<)
-# ifeq ( $(notdir $<), $(findstring $(notdir $<), $(OPTLIST)) )
-# OPTFLAG=-O3
-# else
-# OPTFLAG=-Os
-# endif
-# export OPTFLAG = ;
-# echo !!!!!!!! $(OPTFLAG)
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(if $(findstring $(notdir $<), $(OPTLIST)), $(OPT_SPEED), $(OPT_SIZE)) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
@@ -423,12 +393,6 @@ endef
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
-%.o : %.pcx
-#---------------------------------------------------------------------------------
- @echo $(notdir $<)
- @$(bin2o)
-
-#---------------------------------------------------------------------------------
%.o : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@@ -447,31 +411,17 @@ endef
@$(bin2o)
#---------------------------------------------------------------------------------
-%.o : %.map
-#---------------------------------------------------------------------------------
- @echo $(notdir $<)
- @$(bin2o)
-
-#---------------------------------------------------------------------------------
-%.o : %.mdl
-#---------------------------------------------------------------------------------
- @echo $(notdir $<)
- @$(bin2o)
-
-#---------------------------------------------------------------------------------
%.nds: %.bin
- @echo ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../$(LOGO) "$(shell basename $@);ScummVM $(VERSION);DS Port"
- ndstool -c $@ -9 scummvm.bin $(ARM7BIN) -b ../$(LOGO) "$(shell basename $@);ScummVM $(VERSION);DS Port"
- dsbuild $@ -l ndsloader.bin
+ ndstool -c $@ -9 $< $(ARM7BIN) -b ../$(LOGO) "$(@F);ScummVM $(VERSION);DS Port"
- padbin 16 $(basename $@).ds.gba
+%.ds.gba: %.nds
+ dsbuild $< -o $@ -l $(portdir)/ndsloader.bin
+ padbin 16 $@
#---------------------------------------------------------------------------------
-# FIXME: The following rule hardcodes the input & output filename -- shouldn't it use $< and $@ instead?
%.bin: %.elf
- $(OBJCOPY) -S scummvm.elf scummvm-stripped.elf
- $(OBJCOPY) -O binary scummvm-stripped.elf scummvm.bin
+ $(OBJCOPY) -S -O binary $< $@
#%.o: %.s
# $(MKDIR) $(*D)/$(DEPDIR)