aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-07-15 23:49:57 +0200
committerStefan Weil <sw@weilnetz.de>2013-07-29 11:43:37 +0200
commitf53ec6999287bfdc4f0dfdb6427baa1853f8952a (patch)
treedea3333d37675077086d1285ce94626420aed56b /Makefile
parent461bdb3414c40d6806194bf68c91521496b1042d (diff)
w32, w64: Add build rule for installer
The new rules in Makefile allow building installers for QEMU on Windows using NSIS, a package which is also available for Linux distributions (so cross builds are possible). The rules for NSIS are in qemu.nsi which also uses two new images. Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c06bfaba20..29f10436f8 100644
--- a/Makefile
+++ b/Makefile
@@ -437,6 +437,61 @@ qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
qemu-img.texi qemu-nbd.texi qemu-options.texi \
qemu-monitor.texi qemu-img-cmds.texi
+ifdef CONFIG_WIN32
+
+INSTALLER = qemu-setup-$(VERSION)$(EXESUF)
+
+nsisflags = -V2 -NOCD
+
+ifneq ($(wildcard $(SRC_PATH)/dll),)
+ifeq ($(ARCH),x86_64)
+# 64 bit executables
+DLL_PATH = $(SRC_PATH)/dll/w64
+nsisflags += -DW64
+else
+# 32 bit executables
+DLL_PATH = $(SRC_PATH)/dll/w32
+endif
+endif
+
+.PHONY: installer
+installer: $(INSTALLER)
+
+INSTDIR=/tmp/qemu-nsis
+
+$(INSTALLER): $(SRC_PATH)/qemu.nsi
+ make install prefix=${INSTDIR}
+ifdef SIGNCODE
+ (cd ${INSTDIR}; \
+ for i in *.exe; do \
+ $(SIGNCODE) $${i}; \
+ done \
+ )
+endif # SIGNCODE
+ (cd ${INSTDIR}; \
+ for i in qemu-system-*.exe; do \
+ arch=$${i%.exe}; \
+ arch=$${arch#qemu-system-}; \
+ echo Section \"$$arch\" Section_$$arch; \
+ echo SetOutPath \"\$$INSTDIR\"; \
+ echo File \"\$${BINDIR}\\$$i\"; \
+ echo SectionEnd; \
+ done \
+ ) >${INSTDIR}/system-emulations.nsh
+ makensis $(nsisflags) \
+ $(if $(BUILD_DOCS),-DCONFIG_DOCUMENTATION="y") \
+ $(if $(CONFIG_GTK),-DCONFIG_GTK="y") \
+ -DBINDIR="${INSTDIR}" \
+ $(if $(DLL_PATH),-DDLLDIR="$(DLL_PATH)") \
+ -DSRCDIR="$(SRC_PATH)" \
+ -DOUTFILE="$(INSTALLER)" \
+ $(SRC_PATH)/qemu.nsi
+ rm -r ${INSTDIR}
+ifdef SIGNCODE
+ $(SIGNCODE) $(INSTALLER)
+endif # SIGNCODE
+endif # CONFIG_WIN
+
# Add a dependency on the generated files, so that they are always
# rebuilt before other object files
ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))