]> git.proxmox.com Git - qemu.git/blame - Makefile
updated guest kernel patch for qemu-fast (Martin Koniczek)
[qemu.git] / Makefile
CommitLineData
8d5f07fa 1-include config-host.mak
766a487a 2
d5249393 3CFLAGS=-Wall -O2 -g -fno-strict-aliasing
83fb7adf
FB
4ifdef CONFIG_DARWIN
5CFLAGS+= -mdynamic-no-pic
6endif
67b915a5
FB
7ifdef CONFIG_WIN32
8CFLAGS+=-fpack-struct
9endif
31e31b8a 10LDFLAGS=-g
766a487a 11LIBS=
d5249393 12DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
e35c55fe 13TOOLS=qemu-img$(EXESUF)
1f50f8d1
FB
14ifdef CONFIG_STATIC
15LDFLAGS+=-static
16endif
acd935ef 17DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
aa05ae6f 18
8d5f07fa 19all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
626df76a 20 for d in $(TARGET_DIRS); do \
7d3505c5 21 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 22 done
33e3963e 23
e35c55fe 24qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c
b932caba 25 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
47cea614 26
11d9f695
FB
27dyngen$(EXESUF): dyngen.c
28 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
31e31b8a
FB
29
30clean:
2d80ae89
FB
31# avoid old build problems by removing potentially incorrect old files
32 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
acd935ef 33 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
7d3505c5 34 $(MAKE) -C tests clean
626df76a 35 for d in $(TARGET_DIRS); do \
7d3505c5 36 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 37 done
31e31b8a 38
7d13299d 39distclean: clean
c72a345f 40 rm -f config-host.mak config-host.h
76bc6838 41 for d in $(TARGET_DIRS); do \
bc1b050d 42 rm -rf $$d || exit 1 ; \
76bc6838 43 done
7d13299d 44
626df76a 45install: all
11d9f695 46 mkdir -p "$(bindir)"
11d9f695 47 install -m 755 -s $(TOOLS) "$(bindir)"
7efa4387 48 mkdir -p "$(datadir)"
a735aa31 49 install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
de9258a8 50 pc-bios/vgabios-cirrus.bin \
637f6cd7 51 pc-bios/ppc_rom.bin \
8d5f07fa 52 pc-bios/proll.bin \
7efa4387 53 pc-bios/linux_boot.bin "$(datadir)"
1f50f8d1
FB
54 mkdir -p "$(docdir)"
55 install -m 644 qemu-doc.html qemu-tech.html "$(docdir)"
11d9f695
FB
56ifndef CONFIG_WIN32
57 mkdir -p "$(mandir)/man1"
acd935ef 58 install qemu.1 qemu-img.1 "$(mandir)/man1"
11d9f695 59endif
626df76a 60 for d in $(TARGET_DIRS); do \
7d3505c5 61 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 62 done
612384d7 63
367e86e8 64# various test targets
82c7e2a4 65test speed test2: all
7d3505c5 66 $(MAKE) -C tests $@
31e31b8a 67
367e86e8 68TAGS:
b9adb4a6 69 etags *.[ch] tests/*.[ch]
31e31b8a 70
3ef693a0 71# documentation
1f673135 72%.html: %.texi
3ef693a0
FB
73 texi2html -monolithic -number $<
74
5a67135a
FB
75qemu.1: qemu-doc.texi
76 ./texi2pod.pl $< qemu.pod
77 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
78
acd935ef
FB
79qemu-img.1: qemu-img.texi
80 ./texi2pod.pl $< qemu-img.pod
81 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
82
1e43adfc 83FILE=qemu-$(shell cat VERSION)
586314f2 84
1e43adfc 85# tar release (use 'make -k tar' on a checkouted tree)
586314f2
FB
86tar:
87 rm -rf /tmp/$(FILE)
1e43adfc 88 cp -r . /tmp/$(FILE)
76b62fd0 89 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
586314f2
FB
90 rm -rf /tmp/$(FILE)
91
76b62fd0 92# generate a binary distribution
d691f669 93tarbin:
76b62fd0 94 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
7efa4387
FB
95 $(bindir)/qemu $(bindir)/qemu-fast \
96 $(bindir)/qemu-system-ppc \
acd935ef 97 $(bindir)/qemu-system-sparc \
7efa4387
FB
98 $(bindir)/qemu-i386 \
99 $(bindir)/qemu-arm \
100 $(bindir)/qemu-sparc \
101 $(bindir)/qemu-ppc \
b932caba 102 $(bindir)/qemu-img \
7efa4387
FB
103 $(datadir)/bios.bin \
104 $(datadir)/vgabios.bin \
de9258a8 105 $(datadir)/vgabios-cirrus.bin \
637f6cd7 106 $(datadir)/ppc_rom.bin \
8d5f07fa 107 $(datadir)/proll.bin \
7efa4387 108 $(datadir)/linux_boot.bin \
1f50f8d1
FB
109 $(docdir)/qemu-doc.html \
110 $(docdir)/qemu-tech.html \
acd935ef 111 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
d691f669 112
31e31b8a
FB
113ifneq ($(wildcard .depend),)
114include .depend
115endif