support building external code into the OS, similar to how "external" apps work

This works by having the build system look for nuttx/external/Kconfig
to determine whether this directory is present or not. nuttx/external
is gitignored in order to be added by the final user but not to be
commited into the repo. Tipically this will by a symbolic link, just like
apps/external.

Inside external/ a Makefile should be placed with the same structure
than any nuttx/ subdirectory (eg: nuttx/drivers/). The
nuttx/external/Kconfig will be sourced and any options defined there will
appear at the bottom of menuconfig (unless options are conditioned on
menus, in which case they will appear accordingly).

The purpose is to allow arch/board independent code, which for any
reason is not to be upstreamed (propietary, not relevant for mainline,
testing, etc), to be built into the OS during OS building stage. This
way the user does not need to fork the NuttX repo to do so. This feature
complements well with external apps and custom board support.
This commit is contained in:
Matias N
2020-09-14 16:51:31 -03:00
committed by Xiang Xiao
parent 166242c171
commit 9ce4de634d
11 changed files with 73 additions and 14 deletions
+12
View File
@@ -1826,3 +1826,15 @@ endmenu
menu "Application Configuration"
source "$APPSDIR/Kconfig"
endmenu
# Support optionally including external code
# into the OS build. EXTERNALDIR will be used
# to either point to 'nuttx/external' or
# 'nuttx/.external-dummy', if 'nuttx/external'
# does not contain a Kconfig file
config EXTERNALDIR
string
option env="EXTERNALDIR"
source "$EXTERNALDIR/Kconfig"