From patchwork Thu Mar 11 10:18:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 84845 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2BAIKDQ009719 for ; Thu, 11 Mar 2010 10:18:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756679Ab0CKKST (ORCPT ); Thu, 11 Mar 2010 05:18:19 -0500 Received: from cantor.suse.de ([195.135.220.2]:54735 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756640Ab0CKKST (ORCPT ); Thu, 11 Mar 2010 05:18:19 -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 B3D8E9417A; Thu, 11 Mar 2010 11:18:17 +0100 (CET) Received: by sepie.suse.cz (Postfix, from userid 10020) id 46B807649A; Thu, 11 Mar 2010 11:18:17 +0100 (CET) From: Michal Marek To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: Really don't clean bounds.h and asm-offsets.h Date: Thu, 11 Mar 2010 11:18:10 +0100 Message-Id: <1268302690-28218-1-git-send-email-mmarek@suse.cz> X-Mailer: git-send-email 1.6.6.1 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.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Mar 2010 10:18:20 +0000 (UTC) diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 0135155..fcd1a98 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -779,6 +779,13 @@ This will delete the directory debian, including all subdirectories. Kbuild will assume the directories to be in the same relative path as the Makefile if no absolute path is specified (path does not start with '/'). +To exclude certain files from make clean, use the $(no-clean-files) variable. +This is only a special case used in the top level Kbuild file: + + Example: + #Kbuild + no-clean-files := $(bounds-file) $(offsets-file) + Usually kbuild descends down in subdirectories due to "obj-* := dir/", but in the architecture makefiles where the kbuild infrastructure is not sufficient this sometimes needs to be explicit. diff --git a/Kbuild b/Kbuild index e3737ad..18a8bfb 100644 --- a/Kbuild +++ b/Kbuild @@ -94,5 +94,5 @@ PHONY += missing-syscalls missing-syscalls: scripts/checksyscalls.sh FORCE $(call cmd,syscalls) -# Delete all targets during make clean -clean-files := $(addprefix $(objtree)/,$(filter-out $(bounds-file) $(offsets-file),$(targets))) +# Keep these two files during make clean +no-clean-files := $(bounds-file) $(offsets-file) diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 6f89fbb..686cb0d 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -45,6 +45,8 @@ __clean-files := $(extra-y) $(always) \ $(host-progs) \ $(hostprogs-y) $(hostprogs-m) $(hostprogs-) +__clean-files := $(filter-out $(no-clean-files), $(__clean-files)) + # as clean-files is given relative to the current directory, this adds # a $(obj) prefix, except for absolute paths