From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55649 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0GNz-0001yW-Lh for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:17:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0GNy-0007mR-LT for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:17:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13998) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0GNy-0007lu-Ek for qemu-devel@nongnu.org; Mon, 27 Sep 2010 12:17:02 -0400 Message-ID: <4CA0C377.2080806@redhat.com> Date: Mon, 27 Sep 2010 18:16:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <4CA06938.7030106@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/2] trace: avoid unnecessary recompilation if nothing changed List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Markus Armbruster , qemu-devel On 09/27/2010 06:13 PM, Blue Swirl wrote: >> Indeed, see how it's done for config-*.h. >> >> # Uses generic rule in rules.mak >> trace.h: trace.h-timestamp >> trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak >> $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -h< $< > $@," GEN trace.h) >> @cmp $@ trace.h>/dev/null 2>&1 || cp $@ trace.h >> >> (untested). > > I just copied the rule from %/config-devices.mak. Is also that rule > then incorrect? config-devices.mak will cause the Makefile to be reread, but no recompilations, so it's fine not to use a timestamp file. Headers are more complicated. > Perhaps there could be a macro for this, not unlike move-if-change > script in various GNU packages? The problem is not really the move-if-change script, but rather the timestamping rules. You can use $(eval) for that but it quickly becomes unmanageable. Paolo