]>
Commit | Line | Data |
---|---|---|
0cb3fb1e PB |
1 | # Makefile for QEMU. |
2 | ||
ad064840 | 3 | include config-host.mak |
766a487a | 4 | |
0cb3fb1e PB |
5 | .PHONY: all clean distclean dvi info install install-doc tar tarbin \ |
6 | speed test test2 html dvi info | |
7 | ||
6f30fa85 TS |
8 | BASE_CFLAGS= |
9 | BASE_LDFLAGS= | |
10 | ||
3142255c BS |
11 | BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS) |
12 | BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS) | |
13 | ||
6f30fa85 | 14 | CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
766a487a | 15 | LIBS= |
e35c55fe | 16 | TOOLS=qemu-img$(EXESUF) |
1f50f8d1 | 17 | ifdef CONFIG_STATIC |
6f30fa85 | 18 | BASE_LDFLAGS += -static |
1f50f8d1 | 19 | endif |
cc8ae6de | 20 | ifdef BUILD_DOCS |
acd935ef | 21 | DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 |
cc8ae6de PB |
22 | else |
23 | DOCS= | |
24 | endif | |
aa05ae6f | 25 | |
70956b77 | 26 | LIBS+=$(AIOLIBS) |
83f64091 | 27 | |
b9dea4fb PB |
28 | all: $(TOOLS) $(DOCS) recurse-all |
29 | ||
4aa42531 PB |
30 | subdir-%: dyngen$(EXESUF) |
31 | $(MAKE) -C $(subst subdir-,,$@) all | |
32 | ||
33 | recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) | |
83f64091 | 34 | |
18607dcb | 35 | qemu-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 |
6f30fa85 | 36 | $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS) |
47cea614 | 37 | |
11d9f695 | 38 | dyngen$(EXESUF): dyngen.c |
6f30fa85 | 39 | $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^ |
31e31b8a FB |
40 | |
41 | clean: | |
2d80ae89 FB |
42 | # avoid old build problems by removing potentially incorrect old files |
43 | 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 | 44 | rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ |
7d3505c5 | 45 | $(MAKE) -C tests clean |
626df76a | 46 | for d in $(TARGET_DIRS); do \ |
7d3505c5 | 47 | $(MAKE) -C $$d $@ || exit 1 ; \ |
626df76a | 48 | done |
31e31b8a | 49 | |
7d13299d | 50 | distclean: clean |
cc8ae6de | 51 | rm -f config-host.mak config-host.h $(DOCS) |
0cb3fb1e | 52 | rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr} |
76bc6838 | 53 | for d in $(TARGET_DIRS); do \ |
bc1b050d | 54 | rm -rf $$d || exit 1 ; \ |
76bc6838 | 55 | done |
7d13299d | 56 | |
fed4a9ad FB |
57 | KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ |
58 | ar de en-us fi fr-be hr it lv nl pl ru th \ | |
59 | common de-ch es fo fr-ca hu ja mk nl-be pt sl tr | |
60 | ||
38954dca PB |
61 | install-doc: $(DOCS) |
62 | mkdir -p "$(DESTDIR)$(docdir)" | |
63 | $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" | |
64 | ifndef CONFIG_WIN32 | |
65 | mkdir -p "$(DESTDIR)$(mandir)/man1" | |
66 | $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" | |
67 | endif | |
68 | ||
69 | install: all $(if $(BUILD_DOCS),install-doc) | |
1236cab7 | 70 | mkdir -p "$(DESTDIR)$(bindir)" |
6a882643 | 71 | $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)" |
1236cab7 | 72 | mkdir -p "$(DESTDIR)$(datadir)" |
ad064840 | 73 | for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ |
860c6c52 | 74 | video.x openbios-sparc32 pxe-ne2k_pci.bin \ |
eec85c2a | 75 | pxe-rtl8139.bin pxe-pcnet.bin; do \ |
6a882643 | 76 | $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ |
ad064840 | 77 | done |
11d9f695 | 78 | ifndef CONFIG_WIN32 |
1236cab7 | 79 | mkdir -p "$(DESTDIR)$(datadir)/keymaps" |
ad064840 | 80 | for x in $(KEYMAPS); do \ |
6a882643 | 81 | $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ |
ad064840 | 82 | done |
11d9f695 | 83 | endif |
626df76a | 84 | for d in $(TARGET_DIRS); do \ |
7d3505c5 | 85 | $(MAKE) -C $$d $@ || exit 1 ; \ |
626df76a | 86 | done |
612384d7 | 87 | |
367e86e8 | 88 | # various test targets |
82c7e2a4 | 89 | test speed test2: all |
7d3505c5 | 90 | $(MAKE) -C tests $@ |
31e31b8a | 91 | |
367e86e8 | 92 | TAGS: |
b9adb4a6 | 93 | etags *.[ch] tests/*.[ch] |
31e31b8a | 94 | |
6688bc6d FB |
95 | cscope: |
96 | rm -f ./cscope.* | |
97 | find . -name "*.[ch]" -print > ./cscope.files | |
98 | cscope -b | |
99 | ||
3ef693a0 | 100 | # documentation |
1f673135 | 101 | %.html: %.texi |
3ef693a0 FB |
102 | texi2html -monolithic -number $< |
103 | ||
f3548328 FB |
104 | %.info: %.texi |
105 | makeinfo $< -o $@ | |
106 | ||
107 | %.dvi: %.texi | |
108 | texi2dvi $< | |
109 | ||
5a67135a | 110 | qemu.1: qemu-doc.texi |
ad064840 | 111 | $(SRC_PATH)/texi2pod.pl $< qemu.pod |
5a67135a FB |
112 | pod2man --section=1 --center=" " --release=" " qemu.pod > $@ |
113 | ||
acd935ef | 114 | qemu-img.1: qemu-img.texi |
ad064840 | 115 | $(SRC_PATH)/texi2pod.pl $< qemu-img.pod |
acd935ef FB |
116 | pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@ |
117 | ||
0cb3fb1e PB |
118 | info: qemu-doc.info qemu-tech.info |
119 | ||
120 | dvi: qemu-doc.dvi qemu-tech.dvi | |
121 | ||
122 | html: qemu-doc.html qemu-tech.html | |
123 | ||
df5cf721 TS |
124 | VERSION ?= $(shell cat VERSION) |
125 | FILE = qemu-$(VERSION) | |
586314f2 | 126 | |
1e43adfc | 127 | # tar release (use 'make -k tar' on a checkouted tree) |
586314f2 FB |
128 | tar: |
129 | rm -rf /tmp/$(FILE) | |
1e43adfc | 130 | cp -r . /tmp/$(FILE) |
76b62fd0 | 131 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) |
586314f2 FB |
132 | rm -rf /tmp/$(FILE) |
133 | ||
76b62fd0 | 134 | # generate a binary distribution |
d691f669 | 135 | tarbin: |
76b62fd0 | 136 | ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ |
43095f31 | 137 | $(bindir)/qemu \ |
7efa4387 | 138 | $(bindir)/qemu-system-ppc \ |
d4082e95 JM |
139 | $(bindir)/qemu-system-ppc64 \ |
140 | $(bindir)/qemu-system-ppcemb \ | |
acd935ef | 141 | $(bindir)/qemu-system-sparc \ |
43095f31 | 142 | $(bindir)/qemu-system-x86_64 \ |
93856aac | 143 | $(bindir)/qemu-system-mips \ |
38260998 | 144 | $(bindir)/qemu-system-mipsel \ |
fbe4f65b TS |
145 | $(bindir)/qemu-system-mips64 \ |
146 | $(bindir)/qemu-system-mips64el \ | |
ea31eb5b | 147 | $(bindir)/qemu-system-arm \ |
7efa4387 FB |
148 | $(bindir)/qemu-i386 \ |
149 | $(bindir)/qemu-arm \ | |
ea31eb5b | 150 | $(bindir)/qemu-armeb \ |
7efa4387 FB |
151 | $(bindir)/qemu-sparc \ |
152 | $(bindir)/qemu-ppc \ | |
d4082e95 | 153 | $(bindir)/qemu-ppc64 \ |
ea31eb5b FB |
154 | $(bindir)/qemu-mips \ |
155 | $(bindir)/qemu-mipsel \ | |
cf6c1b16 | 156 | $(bindir)/qemu-alpha \ |
b932caba | 157 | $(bindir)/qemu-img \ |
7efa4387 FB |
158 | $(datadir)/bios.bin \ |
159 | $(datadir)/vgabios.bin \ | |
de9258a8 | 160 | $(datadir)/vgabios-cirrus.bin \ |
637f6cd7 | 161 | $(datadir)/ppc_rom.bin \ |
d5295253 | 162 | $(datadir)/video.x \ |
0986ac3b | 163 | $(datadir)/openbios-sparc32 \ |
19c80e50 FB |
164 | $(datadir)/pxe-ne2k_pci.bin \ |
165 | $(datadir)/pxe-rtl8139.bin \ | |
166 | $(datadir)/pxe-pcnet.bin \ | |
1f50f8d1 FB |
167 | $(docdir)/qemu-doc.html \ |
168 | $(docdir)/qemu-tech.html \ | |
acd935ef | 169 | $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 ) |
d691f669 | 170 | |
31e31b8a FB |
171 | ifneq ($(wildcard .depend),) |
172 | include .depend | |
173 | endif |