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:
parent
329c760f17
commit
fd9c9a7f4f
@ -74,7 +74,7 @@ endif
|
|||||||
|
|
||||||
NONFSDIRS = sched drivers configs $(ARCH_SRC) $(NUTTX_ADDONS)
|
NONFSDIRS = sched drivers configs $(ARCH_SRC) $(NUTTX_ADDONS)
|
||||||
FSDIRS = fs binfmt
|
FSDIRS = fs binfmt
|
||||||
CONTEXTDIRS = $(APPDIR)
|
CONTEXTDIRS = configs $(APPDIR)
|
||||||
USERDIRS =
|
USERDIRS =
|
||||||
OTHERDIRS = lib
|
OTHERDIRS = lib
|
||||||
|
|
||||||
|
@ -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.
|
# and symbolic links created by the context target.
|
||||||
|
|
||||||
clean_context:
|
clean_context:
|
||||||
|
$(Q) $(MAKE) -C configs TOPDIR="$(TOPDIR)" clean_context
|
||||||
$(call DELFILE, include/nuttx/config.h)
|
$(call DELFILE, include/nuttx/config.h)
|
||||||
$(call DELFILE, include/nuttx/version.h)
|
$(call DELFILE, include/nuttx/version.h)
|
||||||
$(call DELFILE, include/math.h)
|
$(call DELFILE, include/math.h)
|
||||||
|
@ -1859,6 +1859,9 @@ endif
|
|||||||
if ARCH_BOARD_SIM
|
if ARCH_BOARD_SIM
|
||||||
source "configs/sim/Kconfig"
|
source "configs/sim/Kconfig"
|
||||||
endif
|
endif
|
||||||
|
if ARCH_BOARD_CUSTOM
|
||||||
|
source "configs/dummy/Kconfig"
|
||||||
|
endif
|
||||||
|
|
||||||
config BOARD_CRASHDUMP
|
config BOARD_CRASHDUMP
|
||||||
bool "Enable Board level logging of crash dumps"
|
bool "Enable Board level logging of crash dumps"
|
||||||
|
@ -35,6 +35,28 @@
|
|||||||
|
|
||||||
-include $(TOPDIR)/Make.defs
|
-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
|
# Basic
|
||||||
|
|
||||||
CONFIG_ASRCS =
|
CONFIG_ASRCS =
|
||||||
@ -58,7 +80,7 @@ OBJS = $(AOBJS) $(COBJS)
|
|||||||
BIN = libconfigs$(LIBEXT)
|
BIN = libconfigs$(LIBEXT)
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
.PHONY: depend clean distclean
|
.PHONY: depend ccontext clean_context clean distclean
|
||||||
|
|
||||||
$(AOBJS): %$(OBJEXT): %.S
|
$(AOBJS): %$(OBJEXT): %.S
|
||||||
$(call ASSEMBLE, $<, $@)
|
$(call ASSEMBLE, $<, $@)
|
||||||
@ -77,7 +99,16 @@ endif
|
|||||||
|
|
||||||
depend: .depend
|
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 DELFILE, $(BIN))
|
||||||
$(call CLEAN)
|
$(call CLEAN)
|
||||||
|
|
||||||
|
2
configs/dummy/.gitignore
vendored
Normal file
2
configs/dummy/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/Kconfig
|
||||||
|
|
5
configs/dummy/dummy_kconfig
Normal file
5
configs/dummy/dummy_kconfig
Normal 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.
|
||||||
|
#
|
||||||
|
|
Loading…
Reference in New Issue
Block a user