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