util/kconfig/Makefile: Add savedefconfig target

Add a savedefconfig target and the help for it to the kconfig
makefile.

The main advantage I found for using defconfigs instead of the full
.config is that they require less maintenence, so long as reasonable
default values are set when adding new config options.  When the
defconfig is expanded, it will use default values for all options not
saved in the defconfig.  This cuts the size of a saved config from
500ish lines to roughly 20 lines.

savedefconfig was added to the linux kernel in commit id
7cf3d73b4360e91b14326632ab1aeda4cb26308d

Change-Id: I45f3dc87b773fb6e9ee53e32fdcafff1f53074d2
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: http://review.coreboot.org/10462
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/util/kconfig/Makefile b/util/kconfig/Makefile
index f6ce818..a216fd3 100644
--- a/util/kconfig/Makefile
+++ b/util/kconfig/Makefile
@@ -76,11 +76,14 @@
 	$(Q)rm -f $(obj)/config.pot
 # --- UNUSED, ignore ----------------------------------------------------------
 
-PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
+PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig savedefconfig
 
 allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(objk)/conf
 	$< --$@ $(Kconfig)
 
+savedefconfig: $(objk)/conf
+	$< --$@=defconfig $(Kconfig)
+
 defconfig: $(objk)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
 	$< -d $(Kconfig)
@@ -104,6 +107,7 @@
 	@echo  '  localyesconfig  - Update current config converting local mods to core'
 	@echo  '  silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
 	@echo  '  defconfig	  - New config with default answer to all options'
+	@echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
 	@echo  '  allnoconfig	  - New config where all options are answered with no'
 	@echo  '  allyesconfig	  - New config where all options are accepted with yes'
 	@echo  '  allmodconfig	  - New config selecting modules when possible'