kqemu/qvm86 must now be compiled outside QEMU
[qemu] / Makefile
1 -include config-host.mak
2
3 CFLAGS=-Wall -O2 -g -fno-strict-aliasing 
4 ifdef CONFIG_DARWIN
5 CFLAGS+= -mdynamic-no-pic
6 endif
7 LDFLAGS=-g
8 LIBS=
9 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
10 TOOLS=qemu-img$(EXESUF)
11 ifdef CONFIG_STATIC
12 LDFLAGS+=-static
13 endif
14 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
15
16 all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
17         for d in $(TARGET_DIRS); do \
18         $(MAKE) -C $$d $@ || exit 1 ; \
19         done
20
21 qemu-img$(EXESUF): qemu-img.c block.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
22         $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
23
24 dyngen$(EXESUF): dyngen.c
25         $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
26
27 clean:
28 # avoid old build problems by removing potentially incorrect old files
29         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 
30         rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
31         $(MAKE) -C tests clean
32         for d in $(TARGET_DIRS); do \
33         $(MAKE) -C $$d $@ || exit 1 ; \
34         done
35
36 distclean: clean
37         rm -f config-host.mak config-host.h
38         for d in $(TARGET_DIRS); do \
39         rm -rf $$d || exit 1 ; \
40         done
41
42 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
43 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
44 common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
45
46 install: all 
47         mkdir -p "$(bindir)"
48         install -m 755 -s $(TOOLS) "$(bindir)"
49         mkdir -p "$(datadir)"
50         install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
51                        pc-bios/vgabios-cirrus.bin \
52                        pc-bios/ppc_rom.bin pc-bios/video.x \
53                        pc-bios/proll.elf \
54                        pc-bios/linux_boot.bin "$(datadir)"
55         mkdir -p "$(docdir)"
56         install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
57 ifndef CONFIG_WIN32
58         mkdir -p "$(mandir)/man1"
59         install qemu.1 qemu-img.1 "$(mandir)/man1"
60         mkdir -p "$(datadir)/keymaps"
61         install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
62 endif
63         for d in $(TARGET_DIRS); do \
64         $(MAKE) -C $$d $@ || exit 1 ; \
65         done
66
67 # various test targets
68 test speed test2: all
69         $(MAKE) -C tests $@
70
71 TAGS: 
72         etags *.[ch] tests/*.[ch]
73
74 cscope:
75         rm -f ./cscope.*
76         find . -name "*.[ch]" -print > ./cscope.files
77         cscope -b
78
79 # documentation
80 %.html: %.texi
81         texi2html -monolithic -number $<
82
83 qemu.1: qemu-doc.texi
84         ./texi2pod.pl $< qemu.pod
85         pod2man --section=1 --center=" " --release=" " qemu.pod > $@
86
87 qemu-img.1: qemu-img.texi
88         ./texi2pod.pl $< qemu-img.pod
89         pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
90
91 FILE=qemu-$(shell cat VERSION)
92
93 # tar release (use 'make -k tar' on a checkouted tree)
94 tar:
95         rm -rf /tmp/$(FILE)
96         cp -r . /tmp/$(FILE)
97         ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
98         rm -rf /tmp/$(FILE)
99
100 # generate a binary distribution
101 tarbin:
102         ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
103         $(bindir)/qemu \
104         $(bindir)/qemu-system-ppc \
105         $(bindir)/qemu-system-sparc \
106         $(bindir)/qemu-system-x86_64 \
107         $(bindir)/qemu-system-mips \
108         $(bindir)/qemu-system-arm \
109         $(bindir)/qemu-i386 \
110         $(bindir)/qemu-arm \
111         $(bindir)/qemu-armeb \
112         $(bindir)/qemu-sparc \
113         $(bindir)/qemu-ppc \
114         $(bindir)/qemu-mips \
115         $(bindir)/qemu-mipsel \
116         $(bindir)/qemu-img \
117         $(datadir)/bios.bin \
118         $(datadir)/vgabios.bin \
119         $(datadir)/vgabios-cirrus.bin \
120         $(datadir)/ppc_rom.bin \
121         $(datadir)/video.x \
122         $(datadir)/proll.elf \
123         $(datadir)/linux_boot.bin \
124         $(docdir)/qemu-doc.html \
125         $(docdir)/qemu-tech.html \
126         $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
127
128 ifneq ($(wildcard .depend),)
129 include .depend
130 endif