summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/Makefile36
-rw-r--r--apps/plugins/SUBDIRS32
-rw-r--r--tools/makesubdirs.inc14
3 files changed, 49 insertions, 33 deletions
diff --git a/apps/plugins/Makefile b/apps/plugins/Makefile
index 5e2ea7b..2dd8ab2 100644
--- a/apps/plugins/Makefile
+++ b/apps/plugins/Makefile
@@ -48,6 +48,9 @@ DEPFILE = $(OBJDIR)/dep-plugins
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
+# This sets up 'SUBDIRS' based on the directories mentioned in SUBDIRS
+include $(TOOLSDIR)/makesubdirs.inc
+
ROCKS := $(SRC:%.c=$(OBJDIR)/%.rock)
SOURCES = $(SRC)
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
@@ -56,39 +59,6 @@ OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
DIRS = .
-#######################################
-# Subdirs containing multi-file plugins
-
-#for all targets
-# SUBDIRS += searchengine databox
-SUBDIRS += databox
-
-#for any recorder, iRiver or iPod model
-ifneq (,$(strip $(foreach tgt,RECORDER IRIVER IPOD_COLOR IPOD_VIDEO GIGABEAT,$(findstring $(tgt),$(TARGET)))))
-ifneq (-DIRIVER_IFP7XX,$(TARGET))
- SUBDIRS += rockboy
-endif
-endif
-
-# chessbox is too big to fit in the 32KB Archos plugin buffer, so we only
-# build for IRIVER and IPOD targets
-ifneq (,$(strip $(foreach tgt,RECORDER ONDIO IRIVER IPOD IAUDIO GIGABEAT,$(findstring $(tgt),$(TARGET)))))
-ifneq (-DIRIVER_IFP7XX,$(TARGET))
- SUBDIRS += chessbox
-endif
-endif
-
-# For all the colour targets and iriver H1x0
-ifneq (,$(strip $(foreach tgt,IPOD_VIDEO IPOD_NANO IPOD_COLOR IRIVER \
- IAUDIO_X5 GIGABEAT,$(findstring $(tgt),$(TARGET)))))
- SUBDIRS += pacbox
-endif
-
-# Build Doom for the H300 and color ipods
-ifneq (,$(strip $(foreach tgt, IRIVER_H300 IPOD_NANO IPOD_COLOR IPOD_VIDEO IAUDIO_X5,$(findstring $(tgt),$(TARGET)))))
- SUBDIRS += doom
-endif
-
.PHONY: $(SUBDIRS)
all: $(BUILDDIR)/libplugin.a $(ROCKS) $(SUBDIRS) $(DEPFILE)
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
new file mode 100644
index 0000000..01d9540
--- /dev/null
+++ b/apps/plugins/SUBDIRS
@@ -0,0 +1,32 @@
+#ifndef IRIVER_IFP7XX_SERIES
+
+/* For all targets */
+databox
+
+/* For various targets... */
+#if (CONFIG_KEYPAD == RECORDER_PAD) || \
+ (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
+ (CONFIG_KEYPAD == IRIVER_H300_PAD) || \
+ defined(IPOD_COLOR) || \
+ defined(IPOD_VIDEO) || \
+ defined(TOSHIBA_GIGABEAT_F)
+rockboy
+#endif
+
+/* For all targets with a bitmap display */
+#ifdef HAVE_LCD_BITMAP
+chessbox
+#endif
+
+/* For all the colour targets and iriver H1x0 */
+#if defined(HAVE_LCD_COLOR) || defined(IRIVER_H100_SERIES)
+pacbox
+#endif
+
+/* For all the color targets apart from the Gigabeat */
+#if defined(HAVE_LCD_COLOR) && !defined(TOSHIBA_GIGABEAT_F)
+doom
+#endif
+
+
+#endif /* IRIVER_IFP7XX_SERIES */
diff --git a/tools/makesubdirs.inc b/tools/makesubdirs.inc
new file mode 100644
index 0000000..b233430
--- /dev/null
+++ b/tools/makesubdirs.inc
@@ -0,0 +1,14 @@
+# -*- Makefile -*-
+
+# return the list of extra sub-directories to build in the SUBDIRS variable
+
+# This uses the native 'gcc' compiler and not $(CC) since we use the -include
+# option and older gcc compiler doesn't have that. We use one such older
+# compiler for the win32 cross-compiles on Linux.
+#
+# The weird grep -v thing in here is due to Apple's stupidities and is needed
+# to make this do right when used on Mac OS X.
+
+SUBDIRS := $(shell cat SUBDIRS | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) \
+$(TARGET) $(DEFINES) $(EXTRA_DEFINES) -E -P -include "config.h" - | \
+grep -v "^\#")