build: add scriptconfig target dpp
authorStijn Tintel <stijn@linux-ipv6.be>
Wed, 2 Nov 2022 15:19:17 +0000 (17:19 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Thu, 15 Jun 2023 09:24:45 +0000 (12:24 +0300)
This makes it possible to use Kconfiglib with OpenWrt buildroot.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
include/toplevel.mk

index 328214be1bc59fedd17a8cbcb339b364e9f5ec9f..8c46f964cf197d14c8f0405a092791cf7fc8117f 100644 (file)
@@ -151,6 +151,15 @@ xconfig: scripts/config/qconf prepare-tmpinfo FORCE
        fi
        $< Config.in
 
+ifneq ($(filter scriptconfig,$(MAKECMDGOALS)),)
+  ifndef SCRIPT
+    $(error Use "make scriptconfig SCRIPT=/path/to/script")
+  endif
+endif
+
+scriptconfig: prepare-tmpinfo FORCE
+       $(STAGING_DIR_HOST)/bin/python3 $(SCRIPT) Config.in
+
 prepare_kernel_conf: .config toolchain/install FORCE
 
 ifeq ($(wildcard $(STAGING_DIR_HOST)/bin/quilt),)
@@ -266,6 +275,6 @@ distclean:
 ifeq ($(findstring v,$(DEBUG)),)
   .SILENT: symlinkclean clean dirclean distclean config-clean download help tmpinfo-clean .config scripts/config/mconf scripts/config/conf menuconfig $(STAGING_DIR_HOST)/.prereq-build tmp/.prereq-package prepare-tmpinfo
 endif
-.PHONY: help FORCE
+.PHONY: help scriptconfig FORCE
 .NOTPARALLEL: