From patchwork Mon Sep 6 11:48:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 157981 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 o86Bn7Ul015889 for ; Mon, 6 Sep 2010 11:49:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754670Ab0IFLss (ORCPT ); Mon, 6 Sep 2010 07:48:48 -0400 Received: from cantor.suse.de ([195.135.220.2]:39538 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754671Ab0IFLsr (ORCPT ); Mon, 6 Sep 2010 07:48:47 -0400 Received: from relay1.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 18C389417A; Mon, 6 Sep 2010 13:48:46 +0200 (CEST) Received: by sepie.suse.cz (Postfix, from userid 10020) id D6CE17652A; Mon, 6 Sep 2010 13:48:45 +0200 (CEST) From: Michal Marek To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/3] kbuild: Really don't clean bounds.h and asm-offsets.h Date: Mon, 6 Sep 2010 13:48:14 +0200 Message-Id: <1283773696-3911-2-git-send-email-mmarek@suse.cz> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1283773696-3911-1-git-send-email-mmarek@suse.cz> References: <1283773696-3911-1-git-send-email-mmarek@suse.cz> 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 (demeter1.kernel.org [140.211.167.41]); Mon, 06 Sep 2010 11:49:38 +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