From patchwork Fri Feb 25 02:35:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Mahoney X-Patchwork-Id: 588891 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1P2Z7JN032605 for ; Fri, 25 Feb 2011 02:35:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854Ab1BYCfH (ORCPT ); Thu, 24 Feb 2011 21:35:07 -0500 Received: from cantor.suse.de ([195.135.220.2]:39993 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852Ab1BYCfG (ORCPT ); Thu, 24 Feb 2011 21:35:06 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id D7D6C93F19; Fri, 25 Feb 2011 03:35:04 +0100 (CET) Message-ID: <4D671556.80607@suse.com> Date: Thu, 24 Feb 2011 21:35:02 -0500 From: Jeff Mahoney User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 SUSE/3.1.7 Thunderbird/3.1.7 MIME-Version: 1.0 To: Linux Kernel Mailing List Cc: Roman Zippel , linux-kbuild@vger.kernel.org Subject: [PATCH] Add ``cloneconfig'' target X-Enigmail-Version: 1.1.2 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 25 Feb 2011 02:35:08 +0000 (UTC) --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -99,6 +99,23 @@ PHONY += allnoconfig allyesconfig allmod 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)$< -D .config.running arch/$(SRCARCH)/Kconfig + PHONY += listnewconfig oldnoconfig savedefconfig defconfig