Add support for savedefconfig
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 21 Aug 2010 16:50:44 +0000 (18:50 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 1 Sep 2010 10:27:25 +0000 (12:27 +0200)
savedefconfig allows to create a minimal defconfig file from an
existing configuration. For example :

 make O=/path/to/some/buildroot/build/directory savedefconfig

will generate a minimal 'defconfig' file in the main Buildroot source
directory.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile

index abe1aa02eddec8e7999c2f51edfb376e76a4b477..c897db76c5e8bbd1b0498e59eda2bb5b912bb24d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ CONFIG=package/config
 DATE:=$(shell date +%Y%m%d)
 
 noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \
-       defconfig %_defconfig allyesconfig allnoconfig release \
+       defconfig %_defconfig savedefconfig allyesconfig allnoconfig release \
        randpackageconfig allyespackageconfig allnopackageconfig \
        source-check help
 
@@ -547,6 +547,10 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf
        @mkdir -p $(BUILD_DIR)/buildroot-config
        @$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
+savedefconfig: $(BUILD_DIR)/buildroot-config/conf
+       @mkdir -p $(BUILD_DIR)/buildroot-config
+       @$(COMMON_CONFIG_ENV) $< --savedefconfig=$(TOPDIR)/defconfig $(CONFIG_CONFIG_IN)
+
 # check if download URLs are outdated
 source-check: allyesconfig
        $(MAKE) $(EXTRAMAKEARGS) _source-check