2008-05-31 19:39:42 +00:00
|
|
|
srcdir ?= .
|
|
|
|
DEPDIR := .deps
|
|
|
|
|
2008-05-06 03:11:01 +00:00
|
|
|
#DYNAMIC_MODULES = 1
|
2008-05-31 19:08:52 +00:00
|
|
|
libndsdir = $(DEVKITPRO)/libnds
|
|
|
|
#libndsdir = /home/neil/devkitpror21/libnds
|
2006-07-09 11:47:17 +00:00
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
# Select the build you want by uncommenting one of the following lines:
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
|
2007-12-21 18:36:40 +00:00
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),a)
|
|
|
|
DS_BUILD_A = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),b)
|
|
|
|
DS_BUILD_B = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),c)
|
|
|
|
DS_BUILD_C = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),d)
|
|
|
|
DS_BUILD_D = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),e)
|
|
|
|
DS_BUILD_E = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),f)
|
|
|
|
DS_BUILD_F = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SCUMM_BUILD),g)
|
|
|
|
DS_BUILD_G = 1
|
|
|
|
endif
|
|
|
|
|
2008-05-31 19:08:52 +00:00
|
|
|
#DS_BUILD_A = 1
|
2006-08-19 11:10:19 +00:00
|
|
|
#DS_BUILD_B = 1
|
2006-11-03 23:16:29 +00:00
|
|
|
#DS_BUILD_C = 1
|
2008-05-15 22:12:51 +00:00
|
|
|
#DS_BUILD_D = 1
|
2007-08-18 11:10:41 +00:00
|
|
|
#DS_BUILD_E = 1
|
|
|
|
#DS_BUILD_F = 1
|
2007-12-21 18:36:40 +00:00
|
|
|
#DS_BUILD_G = 1
|
|
|
|
|
|
|
|
# To do:
|
|
|
|
# - FAT cache?
|
|
|
|
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
# Uncomment the following line to build in support for MP3 audio
|
|
|
|
# using libmad:
|
2007-06-30 23:03:03 +00:00
|
|
|
|
|
|
|
ifdef DS_BUILD_F
|
|
|
|
# TODO: Fix this. When libmad is compiled in, the Kyrandia resource loading
|
|
|
|
# searches through it's entire index to find an mp3 each time a voice sample is requested
|
|
|
|
# this causes a nasty pause.
|
2008-01-27 19:47:41 +00:00
|
|
|
else
|
2007-10-13 15:40:11 +00:00
|
|
|
ifdef DS_BUILD_E
|
|
|
|
# TODO: Inherit the earth uses so much RAM that I have removed libmad in order to
|
2008-01-27 19:47:41 +00:00
|
|
|
# claw some back.
|
2007-10-13 15:40:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
USE_MAD = 1
|
|
|
|
endif
|
2007-06-30 23:03:03 +00:00
|
|
|
endif
|
2006-07-09 11:47:17 +00:00
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
# Uncomment the following line to enable support for the
|
|
|
|
# ace DS Debugger (remembering to make the same change in the arm7 makefile):
|
|
|
|
#USE_DEBUGGER = 1
|
2007-06-30 23:03:03 +00:00
|
|
|
|
|
|
|
# Uncomment the following line to enable the profiler
|
|
|
|
#USE_PROFILER = 1
|
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
# NOTE: The header and libs for the debugger is assumed to be in the libnds
|
|
|
|
# folder.
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
VPATH = $(srcdir)
|
|
|
|
|
|
|
|
# Command to build libmad is:
|
|
|
|
# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
|
|
|
|
|
2007-08-18 11:10:41 +00:00
|
|
|
USE_ARM_SOUND_ASM = 1
|
2007-06-30 23:03:03 +00:00
|
|
|
ARM = 1
|
2008-05-15 22:12:51 +00:00
|
|
|
USE_ARM_COSTUME_ASM = 1
|
2006-08-19 11:10:19 +00:00
|
|
|
|
|
|
|
ifdef DS_BUILD_A
|
2008-05-15 22:12:51 +00:00
|
|
|
DEFINES = -DDS_SCUMM_BUILD -DDS_BUILD_A -DUSE_ARM_GFX_ASM -DUSE_ARM_COSTUME_ASM
|
2006-11-03 23:16:29 +00:00
|
|
|
LOGO = logoa.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_SCUMM = STATIC_PLUGIN
|
2008-05-15 22:12:51 +00:00
|
|
|
DEFINES += -DENABLE_SCUMM=STATIC_PLUGIN
|
|
|
|
MODULES += engines/scumm
|
|
|
|
|
2007-07-10 20:20:50 +00:00
|
|
|
USE_ARM_GFX_ASM = 1
|
2006-08-19 11:10:19 +00:00
|
|
|
BUILD=scummvm-A
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef DS_BUILD_B
|
2006-11-03 23:16:29 +00:00
|
|
|
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_B
|
|
|
|
LOGO = logob.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_SKY = STATIC_PLUGIN
|
|
|
|
ENABLE_QUEEN = STATIC_PLUGIN
|
2006-07-09 11:47:17 +00:00
|
|
|
BUILD=scummvm-B
|
|
|
|
endif
|
|
|
|
|
2008-01-27 19:47:41 +00:00
|
|
|
ifdef DS_BUILD_C
|
2006-11-03 23:16:29 +00:00
|
|
|
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_C
|
|
|
|
LOGO = logoc.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_AGOS = STATIC_PLUGIN
|
2006-08-19 11:10:19 +00:00
|
|
|
BUILD=scummvm-C
|
2006-07-09 11:47:17 +00:00
|
|
|
endif
|
|
|
|
|
2007-04-06 18:34:53 +00:00
|
|
|
ifdef DS_BUILD_D
|
|
|
|
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_D
|
2007-10-13 15:40:11 +00:00
|
|
|
LOGO = logod.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_GOB = STATIC_PLUGIN
|
|
|
|
ENABLE_CINE = STATIC_PLUGIN
|
|
|
|
ENABLE_AGI = STATIC_PLUGIN
|
2007-06-30 23:03:03 +00:00
|
|
|
BUILD=scummvm-D
|
2007-04-06 18:34:53 +00:00
|
|
|
endif
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
ifdef DS_BUILD_E
|
|
|
|
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_E
|
2007-10-13 15:40:11 +00:00
|
|
|
LOGO = logoe.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_SAGA = STATIC_PLUGIN
|
2007-06-30 23:03:03 +00:00
|
|
|
BUILD=scummvm-E
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef DS_BUILD_F
|
|
|
|
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_F
|
2007-10-13 15:40:11 +00:00
|
|
|
LOGO = logof.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_KYRA = STATIC_PLUGIN
|
2007-06-30 23:03:03 +00:00
|
|
|
BUILD=scummvm-F
|
|
|
|
endif
|
2006-08-19 11:10:19 +00:00
|
|
|
|
2007-12-21 18:36:40 +00:00
|
|
|
ifdef DS_BUILD_G
|
|
|
|
DEFINES = -DDS_NON_SCUMM_BUILD -DDS_BUILD_G
|
|
|
|
LOGO = logog.bmp
|
2008-05-06 03:00:26 +00:00
|
|
|
ENABLE_LURE = STATIC_PLUGIN
|
2007-12-21 18:36:40 +00:00
|
|
|
BUILD=scummvm-G
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
ARM7BIN := -7 $(CURDIR)/../../arm7/arm7.bin
|
2008-01-28 00:14:17 +00:00
|
|
|
ICON := -b ../../../logo.bmp "ScummVM;By Neil Millstone;"
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
CC = arm-eabi-gcc
|
|
|
|
CXX = arm-eabi-g++
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
CFLAGS = -Wno-multichar -Wall\
|
2006-07-09 11:47:17 +00:00
|
|
|
-Wno-multichar -mcpu=arm9tdmi -mtune=arm9tdmi \
|
2008-01-28 00:14:17 +00:00
|
|
|
-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
|
2008-05-15 22:12:51 +00:00
|
|
|
-mthumb-interwork -DUSE_ARM_COSTUME_ASM=1
|
|
|
|
|
|
|
|
# -ffast-math
|
2006-11-03 23:16:29 +00:00
|
|
|
|
|
|
|
ifdef USE_DEBUGGER
|
2008-05-15 22:12:51 +00:00
|
|
|
DEFINES += -DUSE_DEBUGGER
|
2006-11-03 23:16:29 +00:00
|
|
|
CFLAGS += -g
|
|
|
|
endif
|
2007-06-30 23:03:03 +00:00
|
|
|
|
|
|
|
ifdef USE_PROFILER
|
|
|
|
CFLAGS += -mpoke-function-name -finstrument-functions -g
|
|
|
|
DEFINES += -DUSE_PROFILER
|
|
|
|
endif
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-05-31 19:29:12 +00:00
|
|
|
CXXFLAGS= $(CFLAGS) -Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-reorder \
|
2007-12-21 18:36:40 +00:00
|
|
|
-fno-exceptions -fno-rtti -mthumb-interwork
|
|
|
|
|
|
|
|
# -mthumb
|
|
|
|
|
|
|
|
# -fno-gcse\
|
|
|
|
# -fno-schedule-insns2
|
|
|
|
|
|
|
|
# -fno-inline-functions-called-once\
|
|
|
|
# -fno-gcse-lm\
|
|
|
|
# -fno-rerun-cse-after-loop\
|
|
|
|
# -fno-cse-follow-jumps -fno-cse-skip-blocks\
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
ASFLAGS = -mcpu=arm9tdmi -mthumb-interwork
|
2007-06-30 23:03:03 +00:00
|
|
|
DEFINES += -D__DS__ -DNDS -DARM9 -DNONSTANDARD_PORT -DDISABLE_FANCY_THEMES -DDISABLE_DEFAULT_SAVEFILEMANAGER -DARM
|
2006-07-09 11:47:17 +00:00
|
|
|
ifdef USE_MAD
|
|
|
|
DEFINES += -DUSE_MAD
|
|
|
|
endif
|
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
|
2007-12-21 18:36:40 +00:00
|
|
|
LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -Wl,--wrap,time -mno-fpu -Wl,-Map,map.txt
|
2006-07-09 11:47:17 +00:00
|
|
|
|
2008-05-31 19:24:50 +00:00
|
|
|
INCLUDES= -I./ -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/common -I$(portdir)/source \
|
|
|
|
-I$(portdir)/data -I$(libndsdir)/include -I$(portdir)/../commoninclude\
|
|
|
|
-I$(libndsdir)/include -I$(libndsdir)/include/nds -I$(srcdir)/engines -I$(portdir)/source/mad\
|
2007-10-13 15:40:11 +00:00
|
|
|
-I$(portdir)/source/libcartreset -include $(srcdir)/common/scummsys.h
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
LIBS = -lm -L$(libndsdir)/lib -L$(portdir)/lib -lnds9
|
|
|
|
ifdef USE_MAD
|
|
|
|
LIBS += -lmad
|
|
|
|
endif
|
2006-11-03 23:16:29 +00:00
|
|
|
ifdef USE_DEBUGGER
|
|
|
|
LIBS += -ldsdebugger -ldswifi9
|
|
|
|
endif
|
2006-07-09 11:47:17 +00:00
|
|
|
|
|
|
|
#-Lscumm -lscumm -Lbase -lbase -Lcommon -lcommon -Lgraphics -lgraphics -Lgui -lgui -Lsound -lsound
|
|
|
|
EXECUTABLE = scummvm.elf
|
|
|
|
PLUGIN_PREFIX =
|
|
|
|
PLUGIN_SUFFIX = .plg
|
|
|
|
PLUGIN_EXTRA_DEPS = plugin.x plugin.syms scummvm.elf
|
|
|
|
PLUGIN_LDFLAGS = -nostartfiles -Wl,-q,-Tplugin.x,--just-symbols,scummvm.elf,--retain-symbols-file,plugin.syms -L$(ronindir)/lib
|
|
|
|
MKDIR = mkdir -p
|
|
|
|
RM = rm -f
|
|
|
|
RM_REC = rm -rf
|
|
|
|
AR = arm-eabi-ar cru
|
|
|
|
RANLIB = arm-eabi-ranlib
|
|
|
|
OBJCOPY = arm-eabi-objcopy
|
|
|
|
AS = arm-eabi-as
|
|
|
|
HAVE_GCC3 = true
|
|
|
|
DISABLE_SCALERS = true
|
|
|
|
|
2008-05-06 03:11:01 +00:00
|
|
|
ifdef DYNAMIC_MODULES
|
2006-07-09 11:47:17 +00:00
|
|
|
DEFINES += -DDYNAMIC_MODULES
|
|
|
|
PRE_OBJS_FLAGS = -Wl,--whole-archive
|
|
|
|
POST_OBJS_FLAGS = -Wl,--no-whole-archive
|
|
|
|
endif
|
|
|
|
|
2007-12-06 21:01:54 +00:00
|
|
|
PORT_OBJS := $(portdir)/source/blitters_arm.o $(portdir)/source/cdaudio.o $(portdir)/source/dsmain.o \
|
2006-07-09 11:47:17 +00:00
|
|
|
$(portdir)/../../../fs/ds/ds-fs.o $(portdir)/source/gbampsave.o $(portdir)/source/scummhelp.o\
|
|
|
|
$(portdir)/source/osystem_ds.o $(portdir)/source/portdefs.o $(portdir)/source/ramsave.o\
|
|
|
|
$(portdir)/source/scummconsole.o $(portdir)/source/touchkeyboard.o $(portdir)/source/zipreader.o\
|
2007-06-30 23:03:03 +00:00
|
|
|
$(portdir)/source/dsoptions.o $(portdir)/source/keys.o $(portdir)/source/wordcompletion.o
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
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
|
2008-01-27 19:47:41 +00:00
|
|
|
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
COMPRESSOR_OBJS := $(portdir)/source/compressor/lz.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 \
|
2006-12-01 22:36:54 +00:00
|
|
|
$(portdir)/source/fat/io_scsd_asm.o \
|
2006-11-03 23:16:29 +00:00
|
|
|
$(portdir)/source/fat/io_njsd.o \
|
|
|
|
$(portdir)/source/fat/io_mmcf.o \
|
|
|
|
$(portdir)/source/fat/io_sd_common.o \
|
2006-12-01 22:36:54 +00:00
|
|
|
$(portdir)/source/fat/io_m3_common.o \
|
2007-01-19 21:47:10 +00:00
|
|
|
$(portdir)/source/fat/io_dldi.o \
|
2006-12-01 22:36:54 +00:00
|
|
|
$(portdir)/source/fat/m3sd.o
|
2006-11-03 23:16:29 +00:00
|
|
|
|
2007-01-19 21:47:10 +00:00
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
# $(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 \
|
2008-01-27 19:47:41 +00:00
|
|
|
# $(portdir)/source/fat/io_sc_common.o $(portdir)/source/fat/io_sd_common.o
|
2006-11-03 23:16:29 +00:00
|
|
|
|
2007-01-19 21:47:10 +00:00
|
|
|
LIBCARTRESET_OBJS := $(portdir)/source/libcartreset/cartreset.o
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-12-21 18:36:40 +00:00
|
|
|
# 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 fmopl.cpp rate.cpp mixer.cpp isomap.cpp image.cpp gfx.cpp sprite.cpp actor_path.cpp actor_walk.cpp
|
2008-01-27 19:47:41 +00:00
|
|
|
#OPTLIST :=
|
2007-12-21 18:36:40 +00:00
|
|
|
|
|
|
|
# Compiler options for files which should be optimised for speed
|
2008-05-15 22:12:51 +00:00
|
|
|
OPT_SPEED := -O2
|
2007-12-21 18:36:40 +00:00
|
|
|
|
|
|
|
# Compiler options for files which should be optimised for space
|
2008-05-15 22:12:51 +00:00
|
|
|
OPT_SIZE := -Os
|
2007-12-21 18:36:40 +00:00
|
|
|
|
|
|
|
|
2008-05-15 22:12:51 +00:00
|
|
|
#-mthumb -fno-gcse -fno-schedule-insns2
|
2006-07-09 11:47:17 +00:00
|
|
|
|
2008-05-15 22:12:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
OBJS := $(DATA_OBJS) $(LIBCARTRESET_OBJS) $(PORT_OBJS) $(COMPRESSOR_OBJS) $(FAT_OBJS)
|
|
|
|
|
2008-01-27 19:47:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
MODULE_DIRS += .
|
|
|
|
|
|
|
|
ndsall:
|
|
|
|
@[ -d $(BUILD) ] || mkdir -p $(BUILD)
|
|
|
|
make -C ./$(BUILD) -f ../makefile scummvm.nds
|
|
|
|
|
|
|
|
include $(srcdir)/Makefile.common
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(OBJS) $(EXECUTABLE)
|
|
|
|
rm -fr $(BUILD)
|
|
|
|
|
|
|
|
plugin_dist :
|
|
|
|
find . -name '*.plg' | while read p; do \
|
|
|
|
sh-elf-strip -g -o "`basename \"$$p\" | tr '[:lower:]' '[:upper:]'`" "$$p"; \
|
|
|
|
done
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
#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
|
2008-01-27 19:47:41 +00:00
|
|
|
#
|
2006-07-09 11:47:17 +00:00
|
|
|
# echo $(*).h
|
|
|
|
# rm $(*).tmp
|
|
|
|
#endef
|
|
|
|
|
2007-06-30 23:03:03 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
##############
|
|
|
|
# Replacement rule for the one in makefile.common
|
|
|
|
##############
|
|
|
|
ifndef HAVE_GCC3
|
|
|
|
# If you use GCC, disable the above and enable this for intelligent
|
2008-01-27 19:47:41 +00:00
|
|
|
# dependency tracking.
|
2008-05-15 10:34:43 +00:00
|
|
|
#.cpp.o:
|
2008-05-15 22:12:51 +00:00
|
|
|
%.o:%.cpp
|
2006-07-09 11:47:17 +00:00
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2007-04-06 18:34:53 +00:00
|
|
|
# $(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
|
2006-07-09 11:47:17 +00:00
|
|
|
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
|
|
|
|
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
|
|
|
|
else
|
|
|
|
# If you even have GCC 3.x, you can use this build rule, which is safer; the above
|
|
|
|
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
|
|
|
|
# Also, with this GCC inserts additional dummy rules for the involved headers,
|
|
|
|
# which ensures a smooth compilation even if said headers become obsolete.
|
2008-05-15 10:34:43 +00:00
|
|
|
#.cpp.o:
|
2008-05-15 22:12:51 +00:00
|
|
|
%.o:%.cpp
|
2007-06-30 23:03:03 +00:00
|
|
|
# echo !!!!!!!!!!!! $(notdir $<)
|
|
|
|
# ifeq ( $(notdir $<), $(findstring $(notdir $<), $(OPTLIST)) )
|
|
|
|
# OPTFLAG=-O3
|
|
|
|
# else
|
|
|
|
# OPTFLAG=-Os
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# export OPTFLAG = ;
|
|
|
|
# echo !!!!!!!! $(OPTFLAG)
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
$(MKDIR) $(*D)/$(DEPDIR)
|
2008-05-31 19:37:19 +00:00
|
|
|
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(if $(findstring $(notdir $<), $(OPTLIST)), $(OPT_SPEED), $(OPT_SIZE)) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2006-07-09 11:47:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2006-11-03 23:16:29 +00:00
|
|
|
#---------------------------------------------------------------------------------
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.o : %.pcx
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
@$(bin2o)
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.o : %.bin
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
@$(bin2o)
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.o : %.raw
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
@$(bin2o)
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.o : %.pal
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
@$(bin2o)
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.o : %.map
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
@$(bin2o)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.o : %.mdl
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
@echo $(notdir $<)
|
|
|
|
@$(bin2o)
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.nds: %.bin
|
2007-12-16 21:41:10 +00:00
|
|
|
@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"
|
2006-11-03 23:16:29 +00:00
|
|
|
dsbuild $@ -l ../ndsloader.bin
|
|
|
|
|
2006-07-09 11:47:17 +00:00
|
|
|
padbin 16 $(basename $@).ds.gba
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------
|
|
|
|
%.bin: %.elf
|
|
|
|
$(OBJCOPY) -S scummvm.elf scummvm-stripped.elf
|
|
|
|
$(OBJCOPY) -O binary scummvm-stripped.elf scummvm.bin
|
|
|
|
|
|
|
|
#%.o: %.s
|
|
|
|
# $(MKDIR) $(*D)/$(DEPDIR)
|
|
|
|
# $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
|
2008-01-27 19:47:41 +00:00
|
|
|
|