build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build

First decoupling changes related to CMAKE

BINDIR/APPSBINDIR:
Output path of Kconfig which dynamically generated by NuttX Kernel/Apps
This option is consistent with the TOPDIR/APPSDIR by default, and will
be changed when out-of-tree compilation is supported

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-02-07 13:56:13 +08:00 committed by Xiang Xiao
parent 2d536059f0
commit 74ce3b81d3
7 changed files with 44 additions and 20 deletions

18
Kconfig
View File

@ -9,6 +9,22 @@ config APPSDIR
string
option env="APPSDIR"
config APPSBINDIR
string
option env="APPSBINDIR"
---help---
Output path of Kconfig which dynamically generated by NuttX Apps
This option is consistent with the APPSDIR by default, and will
be changed when out-of-tree compilation is supported
config BINDIR
string
option env="BINDIR"
---help---
Output path of Kconfig which dynamically generated by NuttX Kernel
This option is consistent with the TOPDIR by default, and will
be changed when out-of-tree compilation is supported
menu "License Setup"
config ALLOW_BSD_COMPONENTS
bool "Use components that have BSD licenses"
@ -2124,7 +2140,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
source "$APPSDIR/Kconfig"
source "$APPSBINDIR/Kconfig"
endmenu
# Support optionally including external code

View File

@ -229,7 +229,7 @@ config ARCH_CHIP_CUSTOM_DIR_RELPATH
endmenu # Custom Chip Configuration
endif #ARCH_CHIP_CUSTOM
source "arch/dummy/Kconfig"
source "$BINDIR/arch/dummy/Kconfig"
config ARCH_TOOLCHAIN_IAR
bool

View File

@ -3641,7 +3641,7 @@ if ARCH_BOARD_MOTEINO_MEGA
source "boards/avr/atmega/moteino-mega/Kconfig"
endif
if ARCH_BOARD_CUSTOM
source "boards/dummy/Kconfig"
source "$BINDIR/boards/dummy/Kconfig"
endif
if ARCH_BOARD_DEMOS92S12NEC64
source "boards/hc/m9s12/demo9s12ne64/Kconfig"

View File

@ -4,6 +4,6 @@
#
if SPECIFIC_DRIVERS
source "drivers/platform/audio/Kconfig"
source "drivers/platform/sensors/Kconfig"
source "$BINDIR/drivers/platform/audio/Kconfig"
source "$BINDIR/drivers/platform/sensors/Kconfig"
endif

View File

@ -46,7 +46,7 @@ source "drivers/wireless/Kconfig"
source "drivers/contactless/Kconfig"
source "drivers/1wire/Kconfig"
source "drivers/syslog/Kconfig"
source "drivers/platform/Kconfig"
source "$BINDIR/drivers/platform/Kconfig"
source "drivers/rf/Kconfig"
source "drivers/rc/Kconfig"
source "drivers/motor/Kconfig"

View File

@ -602,43 +602,46 @@ pass2dep: context tools/mkdeps$(HOSTEXEEXT) tools/cnvwindeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See README.txt
# file in the NuttX tools GIT repository for additional information.
KCONFIG_ENV = APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR)
KCONFIG_ENV += APPSBINDIR=${CONFIG_APPS_DIR} BINDIR=${TOPDIR}
config:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-conf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf Kconfig
oldconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-conf --oldconfig Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf --oldconfig Kconfig
olddefconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-conf --olddefconfig Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf --olddefconfig Kconfig
menuconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-mconf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-mconf Kconfig
nconfig: apps_preconfig
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-nconf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-nconf Kconfig
qconfig: apps_preconfig
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-qconf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-qconf Kconfig
gconfig: apps_preconfig
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-gconf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-gconf Kconfig
savedefconfig: apps_preconfig
$(Q) APPSDIR=${CONFIG_APPS_DIR} EXTERNALDIR=$(EXTERNALDIR) kconfig-conf --savedefconfig defconfig.tmp Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf --savedefconfig defconfig.tmp Kconfig
$(Q) kconfig-tweak --file defconfig.tmp -u CONFIG_APPS_DIR
$(Q) grep "CONFIG_ARCH=" .config >> defconfig.tmp
$(Q) grep "^CONFIG_ARCH_CHIP_" .config >> defconfig.tmp; true

View File

@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR}) & \
set EXTERNALDIR=$(EXTERNALDIR) & \
set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR}) & \
set BINDIR=$(patsubst "%",%,${TOPDIR}) &
config:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-conf Kconfig
$(Q) $(KCONFIG_ENV) kconfig-conf Kconfig
oldconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-conf --oldconfig Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf --oldconfig Kconfig
olddefconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-conf --olddefconfig Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf --olddefconfig Kconfig
menuconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-mconf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-mconf Kconfig
nconfig:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-nconf Kconfig
$(Q) ${KCONFIG_ENV} kconfig-nconf Kconfig
savedefconfig: apps_preconfig
$(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-conf --savedefconfig defconfig.tmp Kconfig
$(Q) ${KCONFIG_ENV} kconfig-conf --savedefconfig defconfig.tmp Kconfig
$(Q) kconfig-tweak --file defconfig.tmp -u CONFIG_APPS_DIR
$(Q) grep "CONFIG_ARCH=" .config >> defconfig.tmp
-$(Q) grep "^CONFIG_ARCH_CHIP_" .config >> defconfig.tmp