summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2007-04-13 23:05:42 +0000
committerDave Chapman <dave@dchapman.com>2007-04-13 23:05:42 +0000
commit266707f81856e4a8310f6d8dacfc7b9a7033106c (patch)
treedf9b0663fdb6e0b58dbd9c032119b5fdd16f8797 /apps
parentbd6cb34f48cea2241078ad5421f069d1bec17cdb (diff)
Build libmad separately for mpegplayer. This provides flexibility to adjust things like IRAM usage independently - use #ifdef MPEGPLAYER in libmad to make any mpegplayer specific changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13147 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libmad/Makefile5
-rw-r--r--apps/plugins/mpegplayer/Makefile22
2 files changed, 20 insertions, 7 deletions
diff --git a/apps/codecs/libmad/Makefile b/apps/codecs/libmad/Makefile
index 13cde8f1f6..3a7be714ea 100644
--- a/apps/codecs/libmad/Makefile
+++ b/apps/codecs/libmad/Makefile
@@ -24,6 +24,11 @@ else
MADOPTS += -O2
endif
+# We build libmad separately for mpegplayer
+ifdef MPEGPLAYER
+EXTRA_DEFINES += -DMPEGPLAYER
+endif
+
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(MADOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
diff --git a/apps/plugins/mpegplayer/Makefile b/apps/plugins/mpegplayer/Makefile
index 28691f4b17..7f4e2e31aa 100644
--- a/apps/plugins/mpegplayer/Makefile
+++ b/apps/plugins/mpegplayer/Makefile
@@ -32,9 +32,17 @@ OUTPUT = $(OUTDIR)/mpegplayer.rock
all: $(OUTPUT)
+.PHONY: libmad-mpegplayer
+
+$(BUILDDIR)/libmad-mpegplayer.a: libmad-mpegplayer
+
+libmad-mpegplayer:
+ $(SILENT)mkdir -p $(OBJDIR)/libmad-mpegplayer
+ $(call PRINTS,MAKE in libmad for mpegplayer)$(MAKE) -C $(APPSDIR)/codecs/libmad MPEGPLAYER=1 OBJDIR=$(OBJDIR)/libmad-mpegplayer OUTPUT=$(BUILDDIR)/libmad-mpegplayer.a
+
ifndef SIMVER
-$(OBJDIR)/mpegplayer.elf: $(OBJS) $(LINKFILE)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lmad -lgcc\
+$(OBJDIR)/mpegplayer.elf: $(OBJS) $(LINKFILE) $(BUILDDIR)/libmad-mpegplayer.a
+ $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $(OBJS) -L$(BUILDDIR) -lplugin -lmad-mpegplayer -lgcc\
-T$(LINKFILE) -Wl,-Map,$(OBJDIR)/mpegplayer.map
$(OUTPUT): $(OBJDIR)/mpegplayer.elf
@@ -45,8 +53,8 @@ ifeq ($(SIMVER), x11)
###################################################
# This is the X11 simulator version
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -lmad -o $@
+$(OUTPUT): $(OBJS) $(BUILDDIR)/libmad-mpegplayer.a
+ $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -lmad-mpegplayer -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
@@ -60,8 +68,8 @@ ifeq ($(SIMVER), sdl)
###################################################
# This is the SDL simulator version
-$(OUTPUT): $(OBJS)
- $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -lmad -o $@
+$(OUTPUT): $(OBJS) $(BUILDDIR)/libmad-mpegplayer.a
+ $(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $(OBJS) -L$(BUILDDIR) -lplugin -lmad-mpegplayer -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
@@ -76,7 +84,7 @@ else # end of sdl-simulator
DLLTOOLFLAGS = --export-all
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
-$(OUTPUT): $(OBJS)
+$(OUTPUT): $(OBJS) $(BUILDDIR)/libmad-mpegplayer.a
$(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $(OBJS)
$(SILENT)@$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $(OBJS) \
$(BUILDDIR)/libplugin.a -o $@