summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-04-01 13:32:16 +0000
committerDave Chapman <dave@dchapman.com>2006-04-01 13:32:16 +0000
commit3d253c6ccfa735a4831b1f825a4ed870d7ac8ccb (patch)
treef0a2f2554da51f16583baf15b4ddec18e6dee4c2
parent8c15138008b108a0ab3d90ef9f09c6d3fc59f740 (diff)
downloadrockbox-3d253c6ccfa735a4831b1f825a4ed870d7ac8ccb.tar.gz
rockbox-3d253c6ccfa735a4831b1f825a4ed870d7ac8ccb.zip
Add apps/plugins/SUBDIRS file for specifying when to build each of the multi-file plugins instead of specifying it directly in the Makefile
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9397 a1c6a512-1295-4272-9138-f99709370657
-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 5e2ea7bbfd..2dd8ab2e8d 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 0000000000..01d9540531
--- /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 0000000000..b233430f78
--- /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 "^\#")