From: lynn.lin@emc.com Date: Sun, 25 Jul 2010 12:37:35 GMT Subject: RE: [PATCH] Makefile: don't include git version file on 'make clean' Message-ID: <7F48A44C0E1FBF48B00D4DA49C85432E54F9A1@CORPUSMX100A.corp.emc.com> In-Reply-To: -----Original Message----- From: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] Sent: 2010年7月25日 20:34 To: Lin, Lynn Cc: schwab@linux-m68k.org; kpfleming@digium.com; git@vger.kernel.org Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean' On Sun, Jul 25, 2010 at 12:29, wrote: > My patch is to don't call GIT-VERSION-FILE target when you run 'make clean' Yes, but as I demonstrated it gets called anyway. Presumably because of the $(MAKE) -C ... clean rules. But I haven't looked into it. If we don't specify special goals, when we run any target ,it will call GIT-VERSIONF-FILE target as it include this target Example from GNU make manual: http://www.gnu.org/software/autoconf/manual/make/Goals.html An example of appropriate use is to avoid including .d files during clean rules (see Automatic Prerequisites), so make won't create them only to immediately remove them again: sources = foo.c bar.c ifneq ($(MAKECMDGOALS),clean) include $(sources:.c=.d) endif Thanks Lynn