scripts: Convert build from Linux Kconfig to new kconfiglib

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-11-18 21:07:49 -05:00
parent 928fc0df72
commit a4e5a19e68
1 changed files with 9 additions and 13 deletions

View File

@ -8,9 +8,6 @@
OUT=out/ OUT=out/
# Kconfig includes # Kconfig includes
export HOSTCC := $(CC)
export CONFIG_SHELL := sh
export KCONFIG_AUTOHEADER := autoconf.h
export KCONFIG_CONFIG := $(CURDIR)/.config export KCONFIG_CONFIG := $(CURDIR)/.config
-include $(KCONFIG_CONFIG) -include $(KCONFIG_CONFIG)
@ -98,22 +95,21 @@ $(OUT)klipper.elf: $(OBJS_klipper.elf)
################ Kconfig rules ################ Kconfig rules
define do-kconfig $(OUT)autoconf.h: $(KCONFIG_CONFIG)
$(Q)mkdir -p $(OUT)/scripts/kconfig/lxdialog @echo " Building $@"
$(Q)mkdir -p $(OUT)/include/config $(Q)mkdir -p $(OUT)
$(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/scripts/kconfig/Makefile srctree=$(CURDIR) src=scripts/kconfig obj=scripts/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1 $(Q) KCONFIG_AUTOHEADER=$@ $(PYTHON) lib/kconfiglib/genconfig.py src/Kconfig
endef
$(OUT)autoconf.h : $(KCONFIG_CONFIG) ; $(call do-kconfig, silentoldconfig) $(KCONFIG_CONFIG) olddefconfig: src/Kconfig
$(KCONFIG_CONFIG): src/Kconfig ; $(call do-kconfig, olddefconfig) $(Q)$(PYTHON) lib/kconfiglib/olddefconfig.py src/Kconfig
%onfig: ; $(call do-kconfig, $@)
help: ; $(call do-kconfig, $@)
menuconfig:
$(Q)$(PYTHON) lib/kconfiglib/menuconfig.py src/Kconfig
################ Generic rules ################ Generic rules
# Make definitions # Make definitions
.PHONY : all clean distclean FORCE .PHONY : all clean distclean olddefconfig menuconfig FORCE
.DELETE_ON_ERROR: .DELETE_ON_ERROR:
all: $(target-y) all: $(target-y)