From patchwork Thu Nov 19 19:07:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 38866 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CF1451007D1 for ; Fri, 20 Nov 2009 06:08:51 +1100 (EST) Received: from localhost ([127.0.0.1]:35447 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBCN6-0003J9-RT for incoming@patchwork.ozlabs.org; Thu, 19 Nov 2009 14:08:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBCML-00038P-MF for qemu-devel@nongnu.org; Thu, 19 Nov 2009 14:08:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBCMH-00035v-09 for qemu-devel@nongnu.org; Thu, 19 Nov 2009 14:08:01 -0500 Received: from [199.232.76.173] (port=39717 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBCMG-00035q-Ro for qemu-devel@nongnu.org; Thu, 19 Nov 2009 14:07:56 -0500 Received: from moutng.kundenserver.de ([212.227.17.8]:61344) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBCMG-000537-92 for qemu-devel@nongnu.org; Thu, 19 Nov 2009 14:07:56 -0500 Received: from flocke.weilnetz.de (p54ADD039.dip.t-dialin.net [84.173.208.57]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Ldbog-1NtdjH3cTS-00iCf8; Thu, 19 Nov 2009 20:07:54 +0100 Received: from stefan by flocke.weilnetz.de with local (Exim 4.69) (envelope-from ) id 1NBCMC-0002a5-Vr; Thu, 19 Nov 2009 20:07:52 +0100 From: Stefan Weil To: av1474@comtv.ru, herbszt@gmx.de, QEMU Developers Date: Thu, 19 Nov 2009 20:07:52 +0100 Message-Id: <1258657672-9897-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: References: X-Provags-ID: V01U2FsdGVkX18bMDGV90WaWaYEIak1mp3ig0nNY2hjiO5+Mx1 gQlRueFeMfImItdp77gLU5lcEKiyWuaXCZMTJnl+5rnz2nVgod 0lqTf52WOaZdyR9Ku6r+NWl2/YBwHmnYpEHfjZLI2Zz5LuyUyP AzA== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] Fix build for mingw32 on windows ($@ in macro) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Make using mingw32 on windows does not preserve $@ in macros when they are modified using this pattern: target: macro += something This behaviour results in an error when QEMU_CFLAGS containing "-MMD -MP -MT $@" is modified for compilation of source files which use SDL: $@ will expand to nothing, -MT no longer has the correct argument (it will take the next one from the command line) and the build will fail or run with a wrong command line. The problem is fixed by using a new macro QEMU_DGFLAGS which is not modified by a target rule. Signed-off-by: Stefan Weil Tested-by: Sebastian Herbszt --- rules.mak | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rules.mak b/rules.mak index 77a801b..16713ba 100644 --- a/rules.mak +++ b/rules.mak @@ -11,16 +11,17 @@ MAKEFLAGS += -rR %.m: %.mak: -QEMU_CFLAGS += -MMD -MP -MT $@ +# Flags for dependency generation +QEMU_DGFLAGS += -MMD -MP -MT $@ %.o: %.c $(GENERATED_HEADERS) - $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") + $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") %.o: %.S - $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") + $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") %.o: %.m - $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") + $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," LINK $(TARGET_DIR)$@")