From 8636a172146f3b78474c61a7021ca2628b3370b1 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 7 Apr 2020 17:07:22 -0300 Subject: build: simplify building *config targets Instead of passing pkg-config location through a variable when building qconf (make xconfig), prepend its parent directory to the PATH, as it is being done for other conf targets. Use a Makefile pattern rule to group all 'scripts/config/%onf' (currently conf, mconf, qconf) targets in a single rule. Add -O2 to CFLAGS when building them as well. Signed-off-by: Eneas U de Queiroz --- include/toplevel.mk | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'include/toplevel.mk') diff --git a/include/toplevel.mk b/include/toplevel.mk index 2b3b55db9f..2965f75c7c 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -100,21 +100,14 @@ prepare-tmpinfo: FORCE fi ifneq ($(DISTRO_PKG_CONFIG),) -scripts/config/mconf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH) +scripts/config/%onf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH) endif -scripts/config/mconf: - @$(_SINGLE)$(SUBMAKE) -s -C scripts/config all CC="$(HOSTCC_WRAPPER)" +scripts/config/%onf: CFLAGS+= -O2 +scripts/config/%onf: + @$(_SINGLE)$(SUBMAKE) -s -C scripts/config $(notdir $@) CC="$(HOSTCC_WRAPPER)" $(eval $(call rdep,scripts/config,scripts/config/mconf)) -scripts/config/qconf: - @$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf \ - CC="$(HOSTCC_WRAPPER)" \ - DISTRO-PKG-CONFIG="$(DISTRO_PKG_CONFIG)" - -scripts/config/conf: - @$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)" - config: scripts/config/conf prepare-tmpinfo FORCE [ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \ $< Config.in -- cgit v1.2.3