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