From: Stefan Weil <weil@mail.berlios.de>
To: av1474@comtv.ru, herbszt@gmx.de, QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] Fix build for mingw32 on windows ($@ in macro)
Date: Thu, 19 Nov 2009 20:07:52 +0100 [thread overview]
Message-ID: <1258657672-9897-1-git-send-email-weil@mail.berlios.de> (raw)
In-Reply-To: <AEB6CD253AD84E9CB90053B0DD7A7E80@FSCPC>
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 <weil@mail.berlios.de>
---
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)$@")
--
1.5.6.5
next prev parent reply other threads:[~2009-11-19 19:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-14 16:39 [Qemu-devel] Build failure on mingw Sebastian Herbszt
[not found] ` <Pine.LNX.4.64.0911142108210.2712@linmac.oyster.ru>
2009-11-16 19:38 ` [Qemu-devel] " Sebastian Herbszt
2009-11-16 19:54 ` malc
2009-11-17 21:22 ` Sebastian Herbszt
2009-11-19 19:07 ` Stefan Weil [this message]
2009-11-19 20:13 ` [Qemu-devel] Re: [PATCH] Fix build for mingw32 on windows ($@ in macro) Sebastian Herbszt
2009-11-19 21:32 ` malc
2009-11-20 6:40 ` Stefan Weil
2009-11-20 1:26 ` [Qemu-devel] " Jamie Lokier
2009-11-20 7:33 ` Stefan Weil
2009-11-20 14:55 ` Jamie Lokier
2009-11-20 18:26 ` Stefan Weil
2009-11-20 16:58 ` Sebastian Herbszt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1258657672-9897-1-git-send-email-weil@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=av1474@comtv.ru \
--cc=herbszt@gmx.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).