[PATCH] build: target: improve UX of CONFIG_TARGET handling
Piotr Dymacz
pepe2k at gmail.com
Tue Mar 29 01:10:00 PDT 2022
Hi Petr,
On 29.03.2022 08:34, Petr Štetiar wrote:
> Make it clear, that for `make kernel_{menu,old}config` it's possible to
> use only following values for CONFIG_TARGET variable:
>
> * env
> * platform
> * subtarget
> * subtarget_platform
It seems I've been misusing 'target' for a long time and now I'm trying
to understand how this leads to the same behavior as 'platform' :)
Some recent changes show also one more invalid value: 'generic':
4c5d5c66ca ipq806x: 5:15: refresh config
5e43dd1fa7 kernel: bump 5.10 to 5.10.99
There are references to 'target' on our forum and even on the Wiki (!):
https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem#kernel_configuration_optional
Should we maybe make 'target' as a valid value?
--
Cheers,
Piotr
>
> This should prevent misuse like `make kernel_menuconfig CONFIG_TARGET=bcm2710` etc.
>
> Signed-off-by: Petr Štetiar <ynezz at true.cz>
> ---
> include/target.mk | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/include/target.mk b/include/target.mk
> index 72fe493776b9..444cc032400f 100644
> --- a/include/target.mk
> +++ b/include/target.mk
> @@ -177,18 +177,17 @@ LINUX_RECONFIG_TARGET = $(if $(USE_SUBTARGET_CONFIG),$(LINUX_SUBTARGET_CONFIG),$
> ifeq ($(CONFIG_TARGET),platform)
> LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG))
> LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG)
> -endif
> -ifeq ($(CONFIG_TARGET),subtarget)
> +else ifeq ($(CONFIG_TARGET),subtarget)
> LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_TARGET_CONFIG) $(LINUX_SUBTARGET_CONFIG))
> LINUX_RECONFIG_TARGET = $(LINUX_SUBTARGET_CONFIG)
> -endif
> -ifeq ($(CONFIG_TARGET),subtarget_platform)
> +else ifeq ($(CONFIG_TARGET),subtarget_platform)
> LINUX_RECONFIG_LIST = $(wildcard $(GENERIC_LINUX_CONFIG) $(LINUX_SUBTARGET_CONFIG) $(LINUX_TARGET_CONFIG))
> LINUX_RECONFIG_TARGET = $(LINUX_TARGET_CONFIG)
> -endif
> -ifeq ($(CONFIG_TARGET),env)
> +else ifeq ($(CONFIG_TARGET),env)
> LINUX_RECONFIG_LIST = $(LINUX_KCONFIG_LIST)
> LINUX_RECONFIG_TARGET = $(TOPDIR)/env/kernel-config
> +else ifneq ($(strip $(CONFIG_TARGET)),)
> + $(error ERROR: CONFIG_TARGET="$(CONFIG_TARGET)" invalid, use one of `platform`, `subtarget`, `subtarget_platform` or `env`)
> endif
>
> __linux_confcmd = $(2) $(patsubst %,+,$(wordlist 2,9999,$(1))) $(1)
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list