From a4e5a19e68a2ebf50b99122c75a9695b4dea0eb4 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 18 Nov 2020 21:07:49 -0500 Subject: [PATCH] scripts: Convert build from Linux Kconfig to new kconfiglib Signed-off-by: Kevin O'Connor --- Makefile | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 039b7889..955a752b 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,6 @@ OUT=out/ # Kconfig includes -export HOSTCC := $(CC) -export CONFIG_SHELL := sh -export KCONFIG_AUTOHEADER := autoconf.h export KCONFIG_CONFIG := $(CURDIR)/.config -include $(KCONFIG_CONFIG) @@ -98,22 +95,21 @@ $(OUT)klipper.elf: $(OBJS_klipper.elf) ################ Kconfig rules -define do-kconfig -$(Q)mkdir -p $(OUT)/scripts/kconfig/lxdialog -$(Q)mkdir -p $(OUT)/include/config -$(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/scripts/kconfig/Makefile srctree=$(CURDIR) src=scripts/kconfig obj=scripts/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1 -endef +$(OUT)autoconf.h: $(KCONFIG_CONFIG) + @echo " Building $@" + $(Q)mkdir -p $(OUT) + $(Q) KCONFIG_AUTOHEADER=$@ $(PYTHON) lib/kconfiglib/genconfig.py src/Kconfig -$(OUT)autoconf.h : $(KCONFIG_CONFIG) ; $(call do-kconfig, silentoldconfig) -$(KCONFIG_CONFIG): src/Kconfig ; $(call do-kconfig, olddefconfig) -%onfig: ; $(call do-kconfig, $@) -help: ; $(call do-kconfig, $@) +$(KCONFIG_CONFIG) olddefconfig: src/Kconfig + $(Q)$(PYTHON) lib/kconfiglib/olddefconfig.py src/Kconfig +menuconfig: + $(Q)$(PYTHON) lib/kconfiglib/menuconfig.py src/Kconfig ################ Generic rules # Make definitions -.PHONY : all clean distclean FORCE +.PHONY : all clean distclean olddefconfig menuconfig FORCE .DELETE_ON_ERROR: all: $(target-y)