10cb3fb1eSpbrook# Makefile for QEMU. 20cb3fb1eSpbrook 3ad064840Spbrookinclude config-host.mak 4766a487aSbellard 50cb3fb1eSpbrook.PHONY: all clean distclean dvi info install install-doc tar tarbin \ 60cb3fb1eSpbrook speed test test2 html dvi info 70cb3fb1eSpbrook 86f30fa85SthsBASE_CFLAGS= 96f30fa85SthsBASE_LDFLAGS= 106f30fa85Sths 116f30fa85SthsBASE_CFLAGS += $(OS_CFLAGS) 12fdbb4691Sbellardifeq ($(ARCH),sparc) 136f30fa85SthsBASE_CFLAGS += -mcpu=ultrasparc 14fdbb4691Sbellardendif 156f30fa85SthsCPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 16766a487aSbellardLIBS= 17e35c55feSbellardTOOLS=qemu-img$(EXESUF) 181f50f8d1Sbellardifdef CONFIG_STATIC 196f30fa85SthsBASE_LDFLAGS += -static 201f50f8d1Sbellardendif 21cc8ae6deSpbrookifdef BUILD_DOCS 22acd935efSbellardDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 23cc8ae6deSpbrookelse 24cc8ae6deSpbrookDOCS= 25cc8ae6deSpbrookendif 267d13299dSbellard 27*70956b77SthsLIBS+=$(AIOLIBS) 2883f64091Sbellard 29b9dea4fbSpbrookall: $(TOOLS) $(DOCS) recurse-all 30b9dea4fbSpbrook 314aa42531Spbrooksubdir-%: dyngen$(EXESUF) 324aa42531Spbrook $(MAKE) -C $(subst subdir-,,$@) all 334aa42531Spbrook 344aa42531Spbrookrecurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) 354aa42531Spbrook 3618607dcbSbellardqemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c 376f30fa85Sths $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS) 3847cea614Sbellard 3911d9f695Sbellarddyngen$(EXESUF): dyngen.c 406f30fa85Sths $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^ 4131e31b8aSbellard 4231e31b8aSbellardclean: 432d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files 442d80ae89Sbellard rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h 45acd935efSbellard rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ 467d3505c5Sbellard $(MAKE) -C tests clean 47626df76aSbellard for d in $(TARGET_DIRS); do \ 487d3505c5Sbellard $(MAKE) -C $$d $@ || exit 1 ; \ 49626df76aSbellard done 5031e31b8aSbellard 517d13299dSbellarddistclean: clean 52cc8ae6deSpbrook rm -f config-host.mak config-host.h $(DOCS) 530cb3fb1eSpbrook rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr} 5476bc6838Sbellard for d in $(TARGET_DIRS); do \ 55bc1b050dSbellard rm -rf $$d || exit 1 ; \ 5676bc6838Sbellard done 577d13299dSbellard 58fed4a9adSbellardKEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ 59fed4a9adSbellardar de en-us fi fr-be hr it lv nl pl ru th \ 60fed4a9adSbellardcommon de-ch es fo fr-ca hu ja mk nl-be pt sl tr 61fed4a9adSbellard 6238954dcaSpbrookinstall-doc: $(DOCS) 6338954dcaSpbrook mkdir -p "$(DESTDIR)$(docdir)" 6438954dcaSpbrook $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" 6538954dcaSpbrookifndef CONFIG_WIN32 6638954dcaSpbrook mkdir -p "$(DESTDIR)$(mandir)/man1" 6738954dcaSpbrook $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" 6838954dcaSpbrookendif 6938954dcaSpbrook 7038954dcaSpbrookinstall: all $(if $(BUILD_DOCS),install-doc) 711236cab7Spbrook mkdir -p "$(DESTDIR)$(bindir)" 726a882643Spbrook $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)" 731236cab7Spbrook mkdir -p "$(DESTDIR)$(datadir)" 74ad064840Spbrook for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ 75eec85c2aSths video.x openbios-sparc32 linux_boot.bin pxe-ne2k_pci.bin \ 76eec85c2aSths pxe-rtl8139.bin pxe-pcnet.bin; do \ 776a882643Spbrook $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ 78ad064840Spbrook done 7911d9f695Sbellardifndef CONFIG_WIN32 801236cab7Spbrook mkdir -p "$(DESTDIR)$(datadir)/keymaps" 81ad064840Spbrook for x in $(KEYMAPS); do \ 826a882643Spbrook $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ 83ad064840Spbrook done 8411d9f695Sbellardendif 85626df76aSbellard for d in $(TARGET_DIRS); do \ 867d3505c5Sbellard $(MAKE) -C $$d $@ || exit 1 ; \ 87626df76aSbellard done 88612384d7Sbellard 89367e86e8Sbellard# various test targets 9082c7e2a4Sbellardtest speed test2: all 917d3505c5Sbellard $(MAKE) -C tests $@ 9231e31b8aSbellard 93367e86e8SbellardTAGS: 94b9adb4a6Sbellard etags *.[ch] tests/*.[ch] 9531e31b8aSbellard 966688bc6dSbellardcscope: 976688bc6dSbellard rm -f ./cscope.* 986688bc6dSbellard find . -name "*.[ch]" -print > ./cscope.files 996688bc6dSbellard cscope -b 1006688bc6dSbellard 1013ef693a0Sbellard# documentation 1021f673135Sbellard%.html: %.texi 1033ef693a0Sbellard texi2html -monolithic -number $< 1043ef693a0Sbellard 105f3548328Sbellard%.info: %.texi 106f3548328Sbellard makeinfo $< -o $@ 107f3548328Sbellard 108f3548328Sbellard%.dvi: %.texi 109f3548328Sbellard texi2dvi $< 110f3548328Sbellard 1115a67135aSbellardqemu.1: qemu-doc.texi 112ad064840Spbrook $(SRC_PATH)/texi2pod.pl $< qemu.pod 1135a67135aSbellard pod2man --section=1 --center=" " --release=" " qemu.pod > $@ 1145a67135aSbellard 115acd935efSbellardqemu-img.1: qemu-img.texi 116ad064840Spbrook $(SRC_PATH)/texi2pod.pl $< qemu-img.pod 117acd935efSbellard pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@ 118acd935efSbellard 1190cb3fb1eSpbrookinfo: qemu-doc.info qemu-tech.info 1200cb3fb1eSpbrook 1210cb3fb1eSpbrookdvi: qemu-doc.dvi qemu-tech.dvi 1220cb3fb1eSpbrook 1230cb3fb1eSpbrookhtml: qemu-doc.html qemu-tech.html 1240cb3fb1eSpbrook 125df5cf721SthsVERSION ?= $(shell cat VERSION) 126df5cf721SthsFILE = qemu-$(VERSION) 127586314f2Sbellard 1281e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree) 129586314f2Sbellardtar: 130586314f2Sbellard rm -rf /tmp/$(FILE) 1311e43adfcSbellard cp -r . /tmp/$(FILE) 13276b62fd0Sbellard ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) 133586314f2Sbellard rm -rf /tmp/$(FILE) 134586314f2Sbellard 13576b62fd0Sbellard# generate a binary distribution 136d691f669Sbellardtarbin: 13776b62fd0Sbellard ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ 13843095f31Sbellard $(bindir)/qemu \ 1397efa4387Sbellard $(bindir)/qemu-system-ppc \ 140acd935efSbellard $(bindir)/qemu-system-sparc \ 14143095f31Sbellard $(bindir)/qemu-system-x86_64 \ 14293856aacSbellard $(bindir)/qemu-system-mips \ 14338260998Spbrook $(bindir)/qemu-system-mipsel \ 144ea31eb5bSbellard $(bindir)/qemu-system-arm \ 1457efa4387Sbellard $(bindir)/qemu-i386 \ 1467efa4387Sbellard $(bindir)/qemu-arm \ 147ea31eb5bSbellard $(bindir)/qemu-armeb \ 1487efa4387Sbellard $(bindir)/qemu-sparc \ 1497efa4387Sbellard $(bindir)/qemu-ppc \ 150ea31eb5bSbellard $(bindir)/qemu-mips \ 151ea31eb5bSbellard $(bindir)/qemu-mipsel \ 152b932cabaSbellard $(bindir)/qemu-img \ 1537efa4387Sbellard $(datadir)/bios.bin \ 1547efa4387Sbellard $(datadir)/vgabios.bin \ 155de9258a8Sbellard $(datadir)/vgabios-cirrus.bin \ 156637f6cd7Sbellard $(datadir)/ppc_rom.bin \ 157d5295253Sbellard $(datadir)/video.x \ 1580986ac3bSbellard $(datadir)/openbios-sparc32 \ 1597efa4387Sbellard $(datadir)/linux_boot.bin \ 16019c80e50Sbellard $(datadir)/pxe-ne2k_pci.bin \ 16119c80e50Sbellard $(datadir)/pxe-rtl8139.bin \ 16219c80e50Sbellard $(datadir)/pxe-pcnet.bin \ 1631f50f8d1Sbellard $(docdir)/qemu-doc.html \ 1641f50f8d1Sbellard $(docdir)/qemu-tech.html \ 165acd935efSbellard $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 ) 166d691f669Sbellard 16731e31b8aSbellardifneq ($(wildcard .depend),) 16831e31b8aSbellardinclude .depend 16931e31b8aSbellardendif 170