Add logic to support custom board directories that include a Kconfig file. During the context phase of the build, any Kconfig file in the custom board directory is copied into configs/dummy, replacing the existing Kconfig file with the target Kconfig file.

This commit is contained in:
Gregory Nutt 2016-06-29 11:53:00 -06:00
parent 329c760f17
commit fd9c9a7f4f
6 changed files with 45 additions and 3 deletions

View File

@ -74,7 +74,7 @@ endif
NONFSDIRS = sched drivers configs $(ARCH_SRC) $(NUTTX_ADDONS)
FSDIRS = fs binfmt
CONTEXTDIRS = $(APPDIR)
CONTEXTDIRS = configs $(APPDIR)
USERDIRS =
OTHERDIRS = lib

View File

@ -344,6 +344,7 @@ context: check_context include/nuttx/config.h include/nuttx/version.h include/ma
# and symbolic links created by the context target.
clean_context:
$(Q) $(MAKE) -C configs TOPDIR="$(TOPDIR)" clean_context
$(call DELFILE, include/nuttx/config.h)
$(call DELFILE, include/nuttx/version.h)
$(call DELFILE, include/math.h)

View File

@ -1859,6 +1859,9 @@ endif
if ARCH_BOARD_SIM
source "configs/sim/Kconfig"
endif
if ARCH_BOARD_CUSTOM
source "configs/dummy/Kconfig"
endif
config BOARD_CRASHDUMP
bool "Enable Board level logging of crash dumps"

View File

@ -35,6 +35,28 @@
-include $(TOPDIR)/Make.defs
# Determine there is a Kconfig file for the any custom board configuration
ifeq ($(CONFIG_ARCH_BOARD_CUSTOM),y)
CUSTOM_DIR = $(patsubst "%",%,$(CONFIG_ARCH_BOARD_CUSTOM_DIR))
ifeq ($(CONFIG_ARCH_BOARD_CUSTOM_DIR_RELPATH),y)
CUSTOM_KPATH = $(TOPDIR)$(DELIM)$(CUSTOM_DIR)$(DELIM)Kconfig
else
CUSTOM_KPATH = $(CUSTOM_DIR)$(DELIM)Kconfig
endif
CUSTOM_KCONFIG = $(if $(wildcard $(CUSTOM_KPATH)),y,)
else
CUSTOM_KCONFIG =
endif
ifeq ($(CUSTOM_KCONFIG),y)
BOARD_KCONFIG = $(CUSTOM_KPATH)
else
BOARD_KCONFIG = $(TOPDIR)$(DELIM)configs$(DELIM)dummy$(DELIM)dummy_kconfig
endif
DUMMY_KCONFIG = $(TOPDIR)$(DELIM)configs$(DELIM)dummy$(DELIM)Kconfig
# Basic
CONFIG_ASRCS =
@ -58,7 +80,7 @@ OBJS = $(AOBJS) $(COBJS)
BIN = libconfigs$(LIBEXT)
all: $(BIN)
.PHONY: depend clean distclean
.PHONY: depend ccontext clean_context clean distclean
$(AOBJS): %$(OBJEXT): %.S
$(call ASSEMBLE, $<, $@)
@ -77,7 +99,16 @@ endif
depend: .depend
clean:
$(DUMMY_KCONFIG): $(BOARD_KCONFIG)
$(call DELFILE, $(DUMMY_KCONFIG))
$(Q) cp -f $(BOARD_KCONFIG) $(DUMMY_KCONFIG)
context: $(DUMMY_KCONFIG)
clean_context:
$(call DELFILE, $(DUMMY_KCONFIG))
clean: clean_context
$(call DELFILE, $(BIN))
$(call CLEAN)

2
configs/dummy/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/Kconfig

View File

@ -0,0 +1,5 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#