2003-06-29 16:33:04 +00:00
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
|
2006-02-21 01:23:30 +00:00
|
|
|
-I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR) \
|
|
|
|
-I$(BUILDDIR)/pluginbitmaps
|
2004-10-04 13:03:33 +00:00
|
|
|
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
|
2006-01-15 18:20:18 +00:00
|
|
|
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
ifdef APPEXTRA
|
2005-10-27 14:39:00 +00:00
|
|
|
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
|
2004-09-09 06:01:46 +00:00
|
|
|
endif
|
2004-07-08 13:12:16 +00:00
|
|
|
|
2005-02-16 01:38:22 +00:00
|
|
|
ifdef SOFTWARECODECS
|
2005-10-26 12:35:58 +00:00
|
|
|
CODECLIBS = -lmad -la52 -lffmpegFLAC -lTremor -lwavpack -lmusepack
|
2005-02-16 01:38:22 +00:00
|
|
|
endif
|
|
|
|
|
2006-01-22 21:30:32 +00:00
|
|
|
# Set up the bitmap libraries
|
2006-01-23 01:56:43 +00:00
|
|
|
BITMAPLIBS =
|
|
|
|
LINKBITMAPS =
|
|
|
|
ifneq ($(strip $(BMP2RB_MONO)),)
|
|
|
|
BITMAPLIBS += $(BUILDDIR)/libpluginbitmapsmono.a
|
|
|
|
LINKBITMAPS += -lpluginbitmapsmono
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(BMP2RB_NATIVE)),)
|
|
|
|
BITMAPLIBS += $(BUILDDIR)/libpluginbitmapsnative.a
|
|
|
|
LINKBITMAPS += -lpluginbitmapsnative
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(BMP2RB_REMOTEMONO)),)
|
|
|
|
BITMAPLIBS += $(BUILDDIR)/libpluginbitmapsremotemono.a
|
|
|
|
LINKBITMAPS += -lpluginbitmapsremotemono
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(BMP2RB_REMOTENATIVE)),)
|
|
|
|
BITMAPLIBS += $(BUILDDIR)/libpluginbitmapsremotenative.a
|
|
|
|
LINKBITMAPS += -lpluginbitmapsremotenative
|
|
|
|
endif
|
2006-01-22 21:30:32 +00:00
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
LDS := plugin.lds
|
|
|
|
LINKFILE := $(OBJDIR)/pluginlink.lds
|
2004-09-22 08:58:50 +00:00
|
|
|
DEPFILE = $(OBJDIR)/dep-plugins
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2005-03-06 23:31:36 +00:00
|
|
|
# This sets up 'SRC' based on the files mentioned in SOURCES
|
|
|
|
include $(TOOLSDIR)/makesrc.inc
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
|
2004-09-22 08:58:50 +00:00
|
|
|
SOURCES = $(SRC)
|
|
|
|
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
|
|
|
|
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
|
2005-02-18 13:47:17 +00:00
|
|
|
# as created by the cross-compiler for win32:
|
|
|
|
DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
|
2004-09-22 08:58:50 +00:00
|
|
|
DIRS = .
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2005-04-28 18:01:29 +00:00
|
|
|
#######################################
|
|
|
|
# Subdirs containing multi-file plugins
|
|
|
|
|
|
|
|
#for all targets
|
2005-05-08 19:39:07 +00:00
|
|
|
SUBDIRS += searchengine databox
|
2005-04-28 18:01:29 +00:00
|
|
|
|
2006-01-20 20:59:07 +00:00
|
|
|
#for any recorder, iRiver or iPod model
|
|
|
|
ifneq (,$(strip $(foreach tgt,RECORDER IRIVER IPOD_COLOR IPOD_VIDEO,$(findstring $(tgt),$(TARGET)))))
|
2006-01-12 00:35:50 +00:00
|
|
|
ifneq (-DIRIVER_IFP7XX,$(TARGET))
|
2005-05-08 19:39:07 +00:00
|
|
|
SUBDIRS += rockboy
|
2005-03-02 23:49:38 +00:00
|
|
|
endif
|
2006-01-12 00:35:50 +00:00
|
|
|
endif
|
2005-03-02 23:49:38 +00:00
|
|
|
|
2005-04-28 18:01:29 +00:00
|
|
|
|
2005-03-02 23:49:38 +00:00
|
|
|
.PHONY: $(SUBDIRS)
|
2006-02-09 04:27:57 +00:00
|
|
|
all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
|
2004-09-22 21:40:45 +00:00
|
|
|
|
2006-02-21 01:23:30 +00:00
|
|
|
$(DEPFILE): $(BITMAPLIBS)
|
|
|
|
|
|
|
|
dep: $(DEPFILE)
|
|
|
|
|
2006-01-16 22:45:44 +00:00
|
|
|
$(BUILDDIR)/credits.raw: $(DOCSDIR)/CREDITS
|
2005-09-02 05:39:09 +00:00
|
|
|
@echo "create credits.raw"
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)perl credits.pl < $< > $@
|
2005-09-02 05:39:09 +00:00
|
|
|
|
2006-01-16 22:45:44 +00:00
|
|
|
$(OBJDIR)/credits.o: credits.c $(BUILDDIR)/credits.raw
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)mkdir -p $(dir $@)
|
2005-09-02 05:39:09 +00:00
|
|
|
@echo "CC $<"
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@
|
2005-09-02 05:39:09 +00:00
|
|
|
|
2006-01-26 11:57:53 +00:00
|
|
|
build-bitmaps:
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(MAKE) -C bitmaps OBJDIR=$(OBJDIR)/bitmaps
|
|
|
|
|
|
|
|
$(BITMAPLIBS): build-bitmaps
|
2006-01-26 11:57:53 +00:00
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
ifndef SIMVER
|
2006-01-22 21:30:32 +00:00
|
|
|
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
|
2006-02-09 04:27:57 +00:00
|
|
|
@echo "LD $(notdir $@)"
|
|
|
|
$(SILENT)$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -lgcc -T$(LINKFILE) -Wl,--gc-sections -Wl,-Map,$(OBJDIR)/$*.map
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
|
2005-05-07 22:41:17 +00:00
|
|
|
@echo "OBJCOPY "`basename $@`
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(OC) -O binary $< $@
|
2005-02-18 13:47:17 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
ifeq ($(SIMVER), x11)
|
|
|
|
###################################################
|
|
|
|
# This is the X11 simulator version
|
|
|
|
|
2006-02-09 05:28:17 +00:00
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
|
2005-05-07 22:41:17 +00:00
|
|
|
@echo "LD "`basename $@`
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
|
2005-02-22 20:00:19 +00:00
|
|
|
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
|
2005-02-18 13:47:17 +00:00
|
|
|
# '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
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)chmod -x $@
|
2005-02-18 13:47:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
else # end of x11-simulator
|
2006-01-09 11:22:36 +00:00
|
|
|
ifeq ($(SIMVER), sdl)
|
|
|
|
###################################################
|
|
|
|
# This is the SDL simulator version
|
|
|
|
|
2006-02-09 05:28:17 +00:00
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
|
2006-01-09 11:22:36 +00:00
|
|
|
@echo "LD "`basename $@`
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(CC) $(CFLAGS) -shared $< -L$(BUILDDIR) $(CODECLIBS) -lplugin $(LINKBITMAPS) -o $@
|
2006-01-09 11:22:36 +00:00
|
|
|
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
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)chmod -x $@
|
2006-01-09 11:22:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
else # end of sdl-simulator
|
2005-02-18 13:47:17 +00:00
|
|
|
###################################################
|
|
|
|
# This is the win32 simulator version
|
|
|
|
DLLTOOLFLAGS = --export-all
|
|
|
|
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
|
|
|
|
|
2006-02-09 05:28:17 +00:00
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(BUILDDIR)/libplugin.a $(BITMAPLIBS)
|
2005-05-07 22:41:17 +00:00
|
|
|
@echo "DLL "`basename $@`
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
|
|
|
|
$(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(BUILDDIR)/libplugin.a $(BITMAPLIBS) \
|
2005-05-07 22:41:17 +00:00
|
|
|
$(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) -o $@
|
2005-02-22 20:00:19 +00:00
|
|
|
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
|
2005-02-22 12:19:12 +00:00
|
|
|
# '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
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)chmod -x $@
|
2005-02-22 12:19:12 +00:00
|
|
|
endif
|
2005-02-18 13:47:17 +00:00
|
|
|
endif # end of win32-simulator
|
2006-01-09 11:22:36 +00:00
|
|
|
endif
|
2005-02-18 13:47:17 +00:00
|
|
|
|
|
|
|
endif # end of simulator section
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
include $(TOOLSDIR)/make.inc
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2005-05-07 22:41:17 +00:00
|
|
|
$(BUILDDIR)/libplugin.a:
|
2005-06-22 19:41:30 +00:00
|
|
|
@echo "MAKE in plugin/lib"
|
2005-12-13 10:56:28 +00:00
|
|
|
$(SILENT)mkdir -p $(OBJDIR)/lib
|
|
|
|
$(SILENT)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2006-01-22 21:30:32 +00:00
|
|
|
$(BUILDDIR)/libpluginbitmapsnative.a:
|
|
|
|
@echo "MAKE in plugins/bitmaps/native"
|
|
|
|
$(SILENT)mkdir -p $(OBJDIR)/bitmaps/native
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(MAKE) -C bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native
|
2006-01-22 21:30:32 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/libpluginbitmapsmono.a:
|
|
|
|
@echo "MAKE in plugins/bitmaps/mono"
|
|
|
|
$(SILENT)mkdir -p $(OBJDIR)/bitmaps/mono
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(MAKE) -C bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono
|
2006-01-22 21:30:32 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/libpluginbitmapsremotenative.a:
|
|
|
|
@echo "MAKE in plugins/bitmaps/remote_native"
|
|
|
|
$(SILENT)mkdir -p $(OBJDIR)/bitmaps/remote_native
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(MAKE) -C bitmaps/remote_native OBJDIR=$(OBJDIR)/bitmaps/remote_native
|
2006-01-22 21:30:32 +00:00
|
|
|
|
|
|
|
$(BUILDDIR)/libpluginbitmapsremotemono.a:
|
|
|
|
@echo "MAKE in plugins/bitmaps/remote_mono"
|
|
|
|
$(SILENT)mkdir -p $(OBJDIR)/bitmaps/remote_mono
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(MAKE) -C bitmaps/remote_mono OBJDIR=$(OBJDIR)/bitmaps/remote_mono
|
2006-01-22 21:30:32 +00:00
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
$(LINKFILE): $(LDS)
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "build $@"
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@
|
2003-07-13 22:15:19 +00:00
|
|
|
|
2005-03-02 23:49:38 +00:00
|
|
|
$(SUBDIRS):
|
|
|
|
@echo "MAKE in $@"
|
2005-12-13 10:56:28 +00:00
|
|
|
$(SILENT)mkdir -p $(OBJDIR)/$@
|
|
|
|
$(SILENT)$(MAKE) -C $@ OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@
|
2005-03-02 23:49:38 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
clean:
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "cleaning plugins"
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
|
2005-09-02 05:39:09 +00:00
|
|
|
$(BUILDDIR)/credits.raw $(OBJS) $(DEFS)
|
2006-02-09 04:27:57 +00:00
|
|
|
$(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
|
|
|
|
$(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono
|
|
|
|
$(SILENT)$(MAKE) -C bitmaps/native clean OBJDIR=$(OBJDIR)/bitmaps/native
|
|
|
|
$(SILENT)$(MAKE) -C bitmaps/remote_mono clean OBJDIR=$(OBJDIR)/bitmaps/remote_mono
|
|
|
|
$(SILENT)$(MAKE) -C bitmaps/remote_native clean OBJDIR=$(OBJDIR)/bitmaps/remote_native
|
|
|
|
$(SILENT)$(MAKE) -C rockboy clean OBJDIR=$(OBJDIR)/rockboy
|
|
|
|
$(SILENT)$(MAKE) -C searchengine clean OBJDIR=$(OBJDIR)/searchengine
|
2006-02-21 01:23:30 +00:00
|
|
|
@rm -rf $(BUILDDIR)/pluginbitmaps
|
2004-09-22 21:40:45 +00:00
|
|
|
|
|
|
|
-include $(DEPFILE)
|