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