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/
# 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)