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
This commit is contained in:
Dave Chapman 2006-04-01 13:32:16 +00:00
parent 8c15138008
commit 3d253c6ccf
3 changed files with 49 additions and 33 deletions

View file

@ -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)

32
apps/plugins/SUBDIRS Normal file
View file

@ -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 */

14
tools/makesubdirs.inc Normal file
View file

@ -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 "^\#")