Received: from eggs.gnu.org ([140.186.70.92]:50268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdde4-00082P-4h for qemu-devel@nongnu.org; Thu, 22 Dec 2011 03:05:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rdde2-0000Ad-SP for qemu-devel@nongnu.org; Thu, 22 Dec 2011 03:04:56 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:39492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdde2-00009j-MG for qemu-devel@nongnu.org; Thu, 22 Dec 2011 03:04:54 -0500 From: Stefan Weil Date: Thu, 22 Dec 2011 09:03:53 +0100 Message-Id: <1324541033-29004-1-git-send-email-sw@weilnetz.de> In-Reply-To: References: Subject: [Qemu-devel] [PATCH] w32: Build windows and console executables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, geleman@gmail.com, Stefan Weil System emulation executables with SDL are typically windows executables. Sometimes console executables are more useful, so create both variants if linker option -mwindows was detected. Signed-off-by: Stefan Weil --- Makefile.target | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/Makefile.target b/Makefile.target index 3261383..489a80c 100644 --- a/Makefile.target +++ b/Makefile.target @@ -27,10 +27,19 @@ ifdef CONFIG_USER_ONLY QEMU_PROG=qemu-$(TARGET_ARCH2) else # system emulator name +ifneq (,$(findstring -mwindows,$(LIBS))) +# Terminate program name with a 'w' because the linker builds a windows executable. +QEMU_PROG=qemu-system-$(TARGET_ARCH2)w$(EXESUF) +QEMU_PROGC=qemu-system-$(TARGET_ARCH2)$(EXESUF) +else # windows executable QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) +endif # windows executable endif PROGS=$(QEMU_PROG) +ifdef QEMU_PROGC +PROGS+=$(QEMU_PROGC) +endif STPFILES= ifndef CONFIG_HAIKU @@ -406,6 +415,11 @@ obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o $(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) $(call LINK,$^) +ifdef QEMU_PROGC +# The linker built a windows executable. Make also a console executable. +$(QEMU_PROGC): $(QEMU_PROG) + $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROG) $(QEMU_PROGC)," GEN $(QEMU_PROGC)") +endif gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") -- 1.7.0.4