mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
configure: add ability to select plugins to build in --plugins flag
Use ":" as the separator. Useful for plugin development and debugging. Example: ../tools/configure --target=hibyr1 --type=ADS --plugins="properties.c:imageviewer" This creates a debug simulator build for Hiby R1 with the properties.c file and the imageviewer directory plugins enabled. Change-Id: If974cfb0c54bd2c1a53ae11cc3f942c698ef2fe4
This commit is contained in:
parent
dd21a1d1d9
commit
aea9e1b63f
2 changed files with 33 additions and 0 deletions
|
|
@ -20,11 +20,15 @@ ifeq ($(APP_TYPE),ctru-app)
|
||||||
is_app_build =
|
is_app_build =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef SELECTED_PLUGINS_SRC
|
||||||
|
PLUGINS_SRC = $(SELECTED_PLUGINS_SRC)
|
||||||
|
else
|
||||||
ifdef is_app_build
|
ifdef is_app_build
|
||||||
PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES.app_build)
|
PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES.app_build)
|
||||||
else
|
else
|
||||||
PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
|
PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
|
||||||
endif
|
endif
|
||||||
|
endif # ifdef SELECTED_PLUGINS_SRC
|
||||||
OTHER_SRC += $(PLUGINS_SRC)
|
OTHER_SRC += $(PLUGINS_SRC)
|
||||||
ROCKS1 := $(PLUGINS_SRC:.c=.rock)
|
ROCKS1 := $(PLUGINS_SRC:.c=.rock)
|
||||||
ROCKS1 := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(ROCKS1))
|
ROCKS1 := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(ROCKS1))
|
||||||
|
|
@ -58,11 +62,15 @@ endif
|
||||||
OTHER_SRC += $(ROOTDIR)/apps/plugins/plugin_crt0.c
|
OTHER_SRC += $(ROOTDIR)/apps/plugins/plugin_crt0.c
|
||||||
PLUGIN_CRT0 := $(BUILDDIR)/apps/plugins/plugin_crt0.o
|
PLUGIN_CRT0 := $(BUILDDIR)/apps/plugins/plugin_crt0.o
|
||||||
# multifile plugins (subdirs):
|
# multifile plugins (subdirs):
|
||||||
|
ifdef SELECTED_PLUGINS_SUBDIRS
|
||||||
|
PLUGINSUBDIRS := $(SELECTED_PLUGINS_SUBDIRS)
|
||||||
|
else
|
||||||
ifdef is_app_build
|
ifdef is_app_build
|
||||||
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS.app_build)
|
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS.app_build)
|
||||||
else
|
else
|
||||||
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
|
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
|
||||||
endif
|
endif
|
||||||
|
endif # ifdef SELECTED_PLUGINS_SUBDIRS
|
||||||
|
|
||||||
PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB) $(FIXEDPOINTLIB)
|
PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB) $(FIXEDPOINTLIB)
|
||||||
|
|
||||||
|
|
|
||||||
25
tools/configure
vendored
25
tools/configure
vendored
|
|
@ -1557,6 +1557,7 @@ ARG_THREAD_SUPPORT=
|
||||||
ARG_32BIT=
|
ARG_32BIT=
|
||||||
ARG_ADDR_SAN=
|
ARG_ADDR_SAN=
|
||||||
ARG_UBSAN=
|
ARG_UBSAN=
|
||||||
|
ARG_PLUGINS=
|
||||||
err=
|
err=
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
|
|
@ -1573,6 +1574,7 @@ for arg in "$@"; do
|
||||||
--ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
|
--ttsopts=*) ARG_TTSOPTS=`echo "$arg" | cut -d = -f 2`;;
|
||||||
--type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
|
--type=*) ARG_TYPE=`echo "$arg" | cut -d = -f 2`;;
|
||||||
--voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
|
--voice=*) ARG_VOICE=`echo "$arg" | cut -d = -f 2`;;
|
||||||
|
--plugins=*) ARG_PLUGINS=`echo "$arg" | cut -d = -f 2`;;
|
||||||
--thumb) ARG_ARM_THUMB=1;;
|
--thumb) ARG_ARM_THUMB=1;;
|
||||||
--no-thumb) ARG_ARM_THUMB=0;;
|
--no-thumb) ARG_ARM_THUMB=0;;
|
||||||
--32-bit) ARG_32BIT=1;;
|
--32-bit) ARG_32BIT=1;;
|
||||||
|
|
@ -4828,11 +4830,34 @@ cmdline=`echo $cmdline | sed -e s,--target=[a-zA-Z_0-9]\*,,g \
|
||||||
-e s,--type=[a-zA-Z0-9]\*,,g`
|
-e s,--type=[a-zA-Z0-9]\*,,g`
|
||||||
cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
|
cmdline="$cmdline --target=\$(MODELNAME) --ram=\$(MEMORYSIZE) --rbdir=\$(RBDIR) --type=$btype$advopts"
|
||||||
|
|
||||||
|
if [ -n "$ARG_PLUGINS" ]; then
|
||||||
|
echo "Selected plugins: $ARG_PLUGINS"
|
||||||
|
plugins="yes"
|
||||||
|
|
||||||
|
selected_src=""
|
||||||
|
selected_subdirs=""
|
||||||
|
chk_plugin_dir="${rootdir}/apps/plugins"
|
||||||
|
|
||||||
|
IFS=":"
|
||||||
|
for p in $ARG_PLUGINS; do
|
||||||
|
if [ -d "$chk_plugin_dir/$p" ]; then
|
||||||
|
selected_subdirs="$selected_subdirs \$(ROOTDIR)/apps/plugins/$p"
|
||||||
|
elif [ -f "$chk_plugin_dir/$p" ]; then
|
||||||
|
selected_src="$selected_src \$(ROOTDIR)/apps/plugins/$p"
|
||||||
|
else
|
||||||
|
echo "Warning: Plugin '$p' found neither as file nor directory in $chk_plugin_dir. Use ':' as the separator."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
### end of cmdline
|
### end of cmdline
|
||||||
|
|
||||||
cat > Makefile <<EOF
|
cat > Makefile <<EOF
|
||||||
## Automatically generated. http://www.rockbox.org/
|
## Automatically generated. http://www.rockbox.org/
|
||||||
|
|
||||||
|
export SELECTED_PLUGINS_SRC=${selected_src}
|
||||||
|
export SELECTED_PLUGINS_SUBDIRS=${selected_subdirs}
|
||||||
|
|
||||||
export ROOTDIR=${rootdir}
|
export ROOTDIR=${rootdir}
|
||||||
export FIRMDIR=\$(ROOTDIR)/firmware
|
export FIRMDIR=\$(ROOTDIR)/firmware
|
||||||
export APPSDIR=${appsdir}
|
export APPSDIR=${appsdir}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue