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 \
|
2004-10-04 13:03:33 +00:00
|
|
|
-I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib
|
|
|
|
CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
|
|
|
|
-DMEM=${MEMORYSIZE} -DPLUGIN
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2004-09-22 08:58:50 +00:00
|
|
|
ifdef APPEXTRA
|
|
|
|
INCLUDES += -I$(APPSDIR)/$(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-04-12 21:29:48 +00:00
|
|
|
CODECLIBS = -lmad -la52 -lFLAC -lTremor -lwavpack -lmusepack
|
2005-02-16 01:38:22 +00:00
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
SUBDIRS += searchengine
|
|
|
|
|
2005-03-02 23:49:38 +00:00
|
|
|
#for any recorder and iRiver model
|
|
|
|
ifneq (,$(strip $(foreach tgt,RECORDER IRIVER,$(findstring $(tgt),$(TARGET)))))
|
2005-04-28 18:01:29 +00:00
|
|
|
SUBDIRS += rockboy
|
2005-03-02 23:49:38 +00:00
|
|
|
endif
|
|
|
|
|
2005-04-28 18:01:29 +00:00
|
|
|
|
2005-03-02 23:49:38 +00:00
|
|
|
.PHONY: $(SUBDIRS)
|
|
|
|
all: $(OBJDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
|
2004-09-22 21:40:45 +00:00
|
|
|
|
2005-02-18 13:47:17 +00:00
|
|
|
ifndef SIMVER
|
2005-03-06 15:42:06 +00:00
|
|
|
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(LINKFILE) $(OBJDIR)/libplugin.a
|
|
|
|
@echo "LD $@"
|
|
|
|
@$(CC) $(GCCOPTS) -O -nostdlib -o $@ $< -L$(OBJDIR) $(CODECLIBS) -lplugin -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$*.map
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.elf
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "OBJCOPY $<"
|
|
|
|
@$(OC) -O binary $< $@
|
2005-02-18 13:47:17 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
ifeq ($(SIMVER), x11)
|
|
|
|
###################################################
|
|
|
|
# This is the X11 simulator version
|
|
|
|
|
2005-03-05 23:31:40 +00:00
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(OBJDIR)/libplugin.a
|
2005-02-18 13:47:17 +00:00
|
|
|
@echo "LD $@"
|
2005-02-18 14:36:55 +00:00
|
|
|
@$(CC) $(CFLAGS) -shared $< -L$(OBJDIR) $(CODECLIBS) -lplugin -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
|
|
|
|
@chmod -x $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
else # end of x11-simulator
|
|
|
|
###################################################
|
|
|
|
# This is the win32 simulator version
|
|
|
|
DLLTOOLFLAGS = --export-all
|
|
|
|
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
|
|
|
|
|
2005-03-05 23:31:40 +00:00
|
|
|
$(OBJDIR)/%.rock : $(OBJDIR)/%.o $(OBJDIR)/libplugin.a
|
2005-02-18 13:47:17 +00:00
|
|
|
@echo "DLL $@"
|
|
|
|
@$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $<
|
2005-02-23 00:53:43 +00:00
|
|
|
@$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/libplugin.a \
|
|
|
|
$(patsubst -l%,$(OBJDIR)/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
|
2005-02-18 13:47:17 +00:00
|
|
|
@chmod -x $@
|
2005-02-22 12:19:12 +00:00
|
|
|
endif
|
2005-02-18 13:47:17 +00:00
|
|
|
endif # end of win32-simulator
|
|
|
|
|
|
|
|
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
|
|
|
|
2004-05-18 23:17:53 +00:00
|
|
|
$(OBJDIR)/libplugin.a:
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "MAKE in lib"
|
2004-09-22 08:58:50 +00:00
|
|
|
@$(MAKE) -C lib TARGET=$(TARGET) DEBUG=$(DEBUG) OBJDIR=$(OBJDIR) VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE}
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
# MEM should be passed on to this makefile with the chosen memory size given
|
|
|
|
# in number of MB
|
|
|
|
$(LINKFILE): $(LDS)
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "build $@"
|
2005-02-04 08:33:46 +00:00
|
|
|
@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 $@"
|
|
|
|
@mkdir -p $(OBJDIR)/$@
|
|
|
|
@$(MAKE) -C $@ TARGET=$(TARGET) DEBUG=$(DEBUG) OUTDIR=$(OBJDIR) OBJDIR=$(OBJDIR)/$@ VERSION=$(VERSION) EXTRA_DEFINES="$(EXTRA_DEFINES)" MEM=${MEMORYSIZE}
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
clean:
|
2004-09-06 07:05:12 +00:00
|
|
|
@echo "cleaning plugins"
|
2005-02-18 13:47:17 +00:00
|
|
|
@rm -f $(ROCKS) $(LINKFILE) $(OBJDIR)/*.rock $(DEPFILE) $(ELFS) \
|
2005-03-06 15:42:06 +00:00
|
|
|
$(OBJS) $(DEFS)
|
2004-09-06 07:05:12 +00:00
|
|
|
@$(MAKE) -C lib clean
|
2005-03-02 23:49:38 +00:00
|
|
|
@$(MAKE) -C rockboy clean
|
2005-04-30 09:40:15 +00:00
|
|
|
@$(MAKE) -C searchengine clean
|
2004-09-22 21:40:45 +00:00
|
|
|
|
|
|
|
-include $(DEPFILE)
|