Received: from eggs.gnu.org ([140.186.70.92]:36395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qlx7o-0003Zc-Lh for qemu-devel@nongnu.org; Wed, 27 Jul 2011 01:57:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qlx7n-0003Fd-L4 for qemu-devel@nongnu.org; Wed, 27 Jul 2011 01:57:44 -0400 From: Markus Armbruster References: <1311652562-10794-1-git-send-email-cerbere@gmail.com> <1311652562-10794-2-git-send-email-cerbere@gmail.com> Date: Wed, 27 Jul 2011 07:57:38 +0200 In-Reply-To: (Alexandre Raymond's message of "Tue, 26 Jul 2011 09:51:21 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] Makefile: distclean should clean all possible targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexandre Raymond Cc: qemu-trivial@nongnu.org, Qemu Developers Alexandre Raymond writes: > Hi Markus, > >> Well, I'd expect distclean to remove exactly what *this* makefile can >> build, and leave everything else alone. > > I was expecting "distclean" to bring back the source directory to > however it was after checkout, removing anything that might have been > created by the build/configure process. > > >> Your patch adds a special case to that simple rule: also remove >> not-configured target directories. =C2=A0Other not-configured stuff is s= till >> left behind. >> >> Special cases need special justification, hence my question above. > > This patch stems from the discussion in "Makefile: fix out-of-tree builds" > http://lists.gnu.org/archive/html/qemu-devel/2011-07/msg02707.html > > What happens is that SRC_PATH is set in the VPATH variable in the > Makefile, which causes it to search for files inside the source > directory (and outside the current build directory). > > Say you're building out-of-tree, and the Makefile happens to pick up > old files from your main source directory, it can lead to errors in > the build. If you are "unable" to delete old build data because you've > run a more restricted "configure" after an earlier build, this earlier > build data will not go away if you distclean. > > For example: [...] There are many more object files that are built conditionally. Why is it okay not to delete them? If you unwisely messed up your source tree by building in it, a simple and reliable way out is to git-clone yourself a new one. Or if you insist on recovering in-place, remove files outside .git that aren't in git.