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