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