Browse Source

add Makefile target for saving the kernel configuration to an external file

Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Mario Haustein 7 years ago
parent
commit
a17b603f1c
3 changed files with 16 additions and 1 deletions
  1. 1 1
      Makefile
  2. 5 0
      Makefile.adk
  3. 10 0
      mk/build.mk

+ 1 - 1
Makefile

@@ -4,5 +4,5 @@
 # GNU make and BSD make compatible make file wrapper
 MAKECMDGOALS+= ${.TARGETS}
 
-all v allmodconfig allnoconfig allyesconfig help pkg-help dev-help targethelp kernelconfig image menuconfig defconfig oldconfig download clean cleankernel cleansystem cleandir distclean hostclean hostpackage fetch package extract patch dep menu newpackage host-update-patches update-patches:
+all v allmodconfig allnoconfig allyesconfig help pkg-help dev-help targethelp kernelconfig savekconfig image menuconfig defconfig oldconfig download clean cleankernel cleansystem cleandir distclean hostclean hostpackage fetch package extract patch dep menu newpackage host-update-patches update-patches:
 	@./scripts/prereq.sh ${MAKECMDGOALS}

+ 5 - 0
Makefile.adk

@@ -47,6 +47,8 @@ help:
 	@echo 'Common targets:'
 	@echo '  download     - fetches all needed distfiles'
 	@echo '  kernelconfig - view the target kernel configuration'
+	@echo '  savekconfig  - save changes of "make kernelconfig" to an external'
+	@echo '                 configuration file (if configured)'
 	@echo ''
 	@echo 'Cleaning targets:'
 	@echo '  clean        - Remove firmware and build directories'
@@ -130,6 +132,9 @@ targethelp:
 kernelconfig:
 	@${GMAKE_INV} kernelconfig
 
+savekconfig:
+	@${GMAKE_INV} savekconfig
+
 newpackage:
 	@${GMAKE_INV} newpackage
 

+ 10 - 0
mk/build.mk

@@ -227,6 +227,16 @@ kernelconfig:
 		${KERNEL_MAKE_OPTS} \
 		menuconfig
 
+ifeq ($(ADK_TARGET_KERNEL_USE_CUSTOMCONFIG),y)
+savekconfig:
+	@echo "Saving kernel configuration to $(ADK_TOPDIR)/$(ADK_TARGET_KERNEL_CUSTOMCONFIG_PATH)"
+	$(CP) $(LINUX_DIR)/.config $(ADK_TOPDIR)/$(ADK_TARGET_KERNEL_CUSTOMCONFIG_PATH)
+else
+savekconfig:
+	@echo "You have to enable ADK_TARGET_KERNEL_USE_CUSTOMCONFIG to be able to save the current kernel configuration."
+endif
+
+
 # create a new package from package/.template
 newpackage:
 	@echo "Creating new package $(PKG)"