浏览代码

core: introduce a generated kconfig snippet

Add the infrastructure for adding generated kconfig snippet in the
menuconfig.

For now, the kconfig snippet is generated empty, the recipe for filling
it in will be introduced in sub-sequent patches.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Yann E. MORIN 9 年之前
父节点
当前提交
4802db3dad
共有 3 个文件被更改,包括 18 次插入1 次删除
  1. 6 0
      Config.in
  2. 9 1
      Makefile
  3. 3 0
      docs/manual/manual.mk

+ 6 - 0
Config.in

@@ -18,6 +18,10 @@ config BR2_EXTERNAL
 	string
 	string
 	option env="BR2_EXTERNAL"
 	option env="BR2_EXTERNAL"
 
 
+config BR2_BUILD_DIR
+	string
+	option env="BUILD_DIR"
+
 # Hidden config symbols for packages to check system gcc version
 # Hidden config symbols for packages to check system gcc version
 config BR2_HOST_GCC_VERSION
 config BR2_HOST_GCC_VERSION
 	string
 	string
@@ -763,3 +767,5 @@ menu "User-provided options"
 source "$BR2_EXTERNAL/Config.in"
 source "$BR2_EXTERNAL/Config.in"
 
 
 endmenu
 endmenu
+
+source "$BR2_BUILD_DIR/.br2-external.in"

+ 9 - 1
Makefile

@@ -761,7 +761,7 @@ HOSTCFLAGS = $(CFLAGS_FOR_BUILD)
 export HOSTCFLAGS
 export HOSTCFLAGS
 
 
 .PHONY: prepare-kconfig
 .PHONY: prepare-kconfig
-prepare-kconfig: outputmakefile
+prepare-kconfig: outputmakefile $(BUILD_DIR)/.br2-external.in
 
 
 $(BUILD_DIR)/buildroot-config/%onf:
 $(BUILD_DIR)/buildroot-config/%onf:
 	mkdir -p $(@D)/lxdialog
 	mkdir -p $(@D)/lxdialog
@@ -780,6 +780,7 @@ COMMON_CONFIG_ENV = \
 	BR2_CONFIG=$(BR2_CONFIG) \
 	BR2_CONFIG=$(BR2_CONFIG) \
 	BR2_EXTERNAL=$(BR2_EXTERNAL) \
 	BR2_EXTERNAL=$(BR2_EXTERNAL) \
 	HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
 	HOST_GCC_VERSION="$(HOSTCC_VERSION)" \
+	BUILD_DIR=$(BUILD_DIR) \
 	SKIP_LEGACY=
 	SKIP_LEGACY=
 
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig
 xconfig: $(BUILD_DIR)/buildroot-config/qconf prepare-kconfig
@@ -880,6 +881,13 @@ ifeq ($(NEED_WRAPPER),y)
 	$(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
 	$(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
 endif
 endif
 
 
+# Even though the target is a real file, we mark it as PHONY as we
+# want it to be re-generated each time make is invoked, in case the
+# value of BR2_EXTERNAL is changed.
+.PHONY: $(BUILD_DIR)/.br2-external.in
+$(BUILD_DIR)/.br2-external.in: $(BUILD_DIR)
+	@touch $@
+
 # printvars prints all the variables currently defined in our
 # printvars prints all the variables currently defined in our
 # Makefiles. Alternatively, if a non-empty VARS variable is passed,
 # Makefiles. Alternatively, if a non-empty VARS variable is passed,
 # only the variables matching the make pattern passed in VARS are
 # only the variables matching the make pattern passed in VARS are

+ 3 - 0
docs/manual/manual.mk

@@ -7,6 +7,9 @@
 MANUAL_SOURCES = $(sort $(wildcard docs/manual/*.txt) $(wildcard docs/images/*))
 MANUAL_SOURCES = $(sort $(wildcard docs/manual/*.txt) $(wildcard docs/images/*))
 MANUAL_RESOURCES = $(TOPDIR)/docs/images
 MANUAL_RESOURCES = $(TOPDIR)/docs/images
 
 
+# Ensure the kconfig snippet is generated (for MANUAL_GEN_LISTS, below):
+MANUAL_DEPENDENCIES += prepare-kconfig
+
 # Our manual needs to generate lists
 # Our manual needs to generate lists
 define MANUAL_GEN_LISTS
 define MANUAL_GEN_LISTS
 	$(Q)$(call MESSAGE,"Updating the manual lists...")
 	$(Q)$(call MESSAGE,"Updating the manual lists...")