- Update to 3.3-rc2.
[linux-flexiantxendom0-3.2.10.git] / scripts / kconfig / Makefile
index 7966265..9829863 100644 (file)
@@ -75,6 +75,23 @@ PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
 
 allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
        $< --$@ $(Kconfig)
+UNAME_RELEASE := $(shell uname -r)
+CLONECONFIG := $(firstword $(wildcard /proc/config.gz \
+                                     /lib/modules/$(UNAME_RELEASE)/.config \
+                                     /etc/kernel-config \
+                                     /boot/config-$(UNAME_RELEASE)))
+cloneconfig: $(obj)/conf
+       $(Q)case "$(CLONECONFIG)" in                            \
+       '')     echo -e "The configuration of the running"      \
+                       "kernel could not be determined\n";     \
+               false ;;                                        \
+       *.gz)   gzip -cd $(CLONECONFIG) > .config.running ;;    \
+       *)      cat $(CLONECONFIG) > .config.running ;;         \
+       esac &&                                                 \
+       echo -e "Cloning configuration file $(CLONECONFIG)\n"
+       $(Q)$< --defconfig=.config.running arch/$(SRCARCH)/Kconfig
+
 
 PHONY += listnewconfig oldnoconfig savedefconfig defconfig