From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeuiE-0001qW-Ec for qemu-devel@nongnu.org; Tue, 21 May 2013 18:07:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ueui4-00022X-M9 for qemu-devel@nongnu.org; Tue, 21 May 2013 18:07:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ueui4-00022L-Dm for qemu-devel@nongnu.org; Tue, 21 May 2013 18:07:08 -0400 Date: Wed, 22 May 2013 01:07:09 +0300 From: "Michael S. Tsirkin" Message-ID: <20130521220709.GA26328@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCHv2 RFC] makefile: detect corrupted elf files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Paolo Bonzini , Anthony Liguori , Luiz Capitulino Once in a while make gets killed and doesn't clean up partial object files after it. Result is nasty errors from link. This hack checks object is well formed before linking, and rebuilds it if not. Signed-off-by: Michael S. Tsirkin --- v1 actually prints some noise on stderr, this shuts it up. Makefile.target | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.target b/Makefile.target index ce4391f..c506d4c 100644 --- a/Makefile.target +++ b/Makefile.target @@ -191,3 +191,10 @@ endif GENERATED_HEADERS += config-target.h Makefile: $(GENERATED_HEADERS) + +.SECONDEXPANSION: + +.PHONY: CORRUPTBINARY + +$(all-obj-y): % : $$(if $$(shell size % 2>/dev/null), , CORRUPTBINARY) + -- MST