Special Mask Mode for i8259 PIC (Sebastian Reichelt).
[qemu/mini2440/sniper_sniper_test.git] / Makefile
blob3756da89e7752f38e8e991e0f082af6485c6bbb5
1 # Makefile for QEMU.
3 include config-host.mak
5 .PHONY: all clean distclean dvi info install install-doc tar tarbin \
6 speed test html dvi info
8 VPATH=$(SRC_PATH):$(SRC_PATH)/hw
10 CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
11 LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
13 CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@
14 CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
15 LIBS=
16 ifdef CONFIG_STATIC
17 LDFLAGS += -static
18 endif
19 ifdef BUILD_DOCS
20 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8
21 else
22 DOCS=
23 endif
25 LIBS+=$(AIOLIBS)
27 all: $(TOOLS) $(DOCS) recurse-all
29 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
31 subdir-%: dyngen$(EXESUF)
32 $(MAKE) -C $(subst subdir-,,$@) all
34 $(filter %-softmmu,$(SUBDIR_RULES)): libqemu_common.a
35 $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
37 recurse-all: $(SUBDIR_RULES)
39 #######################################################################
40 # BLOCK_OBJS is code used by both qemu system emulation and qemu-img
42 BLOCK_OBJS=cutils.o qemu-malloc.o
43 BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o
44 BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
45 BLOCK_OBJS+=block-qcow2.o block-parallels.o block-nbd.o
47 ######################################################################
48 # libqemu_common.a: Target independent part of system emulation. The
49 # long term path is to suppress *all* target specific code in case of
50 # system emulation, i.e. a single QEMU executable should support all
51 # CPUs and machines.
53 OBJS=nbd.o $(BLOCK_OBJS)
54 OBJS+=readline.o console.o
55 OBJS+=block.o
57 OBJS+=irq.o
58 OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
59 OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
60 OBJS+=tmp105.o lm832x.o
61 OBJS+=scsi-disk.o cdrom.o
62 OBJS+=scsi-generic.o
63 OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o
64 OBJS+=usb-serial.o usb-net.o
65 OBJS+=sd.o ssi-sd.o
67 ifdef CONFIG_BRLAPI
68 OBJS+= baum.o
69 LIBS+=-lbrlapi
70 endif
72 ifdef CONFIG_WIN32
73 OBJS+=tap-win32.o
74 endif
76 AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
77 ifdef CONFIG_SDL
78 AUDIO_OBJS += sdlaudio.o
79 endif
80 ifdef CONFIG_OSS
81 AUDIO_OBJS += ossaudio.o
82 endif
83 ifdef CONFIG_COREAUDIO
84 AUDIO_OBJS += coreaudio.o
85 AUDIO_PT = yes
86 endif
87 ifdef CONFIG_ALSA
88 AUDIO_OBJS += alsaaudio.o
89 endif
90 ifdef CONFIG_DSOUND
91 AUDIO_OBJS += dsoundaudio.o
92 endif
93 ifdef CONFIG_FMOD
94 AUDIO_OBJS += fmodaudio.o
95 audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
96 endif
97 ifdef CONFIG_ESD
98 AUDIO_PT = yes
99 AUDIO_PT_INT = yes
100 AUDIO_OBJS += esdaudio.o
101 endif
102 ifdef CONFIG_PA
103 AUDIO_PT = yes
104 AUDIO_PT_INT = yes
105 AUDIO_OBJS += paaudio.o
106 endif
107 ifdef AUDIO_PT
108 LDFLAGS += -pthread
109 endif
110 ifdef AUDIO_PT_INT
111 AUDIO_OBJS += audio_pt_int.o
112 endif
113 AUDIO_OBJS+= wavcapture.o
114 OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
116 ifdef CONFIG_SDL
117 OBJS+=sdl.o x_keymap.o
118 endif
119 ifdef CONFIG_CURSES
120 OBJS+=curses.o
121 endif
122 OBJS+=vnc.o d3des.o
124 ifdef CONFIG_COCOA
125 OBJS+=cocoa.o
126 endif
128 ifdef CONFIG_SLIRP
129 CPPFLAGS+=-I$(SRC_PATH)/slirp
130 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
131 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
132 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
133 OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
134 endif
136 cocoa.o: cocoa.m
137 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
139 sdl.o: sdl.c keymaps.c sdl_keysym.h
140 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $<
142 vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
143 $(CC) $(CFLAGS) $(CPPFLAGS) $(CONFIG_VNC_TLS_CFLAGS) -c -o $@ $<
145 curses.o: curses.c keymaps.c curses_keys.h
146 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
148 audio/sdlaudio.o: audio/sdlaudio.c
149 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) -c -o $@ $<
151 libqemu_common.a: $(OBJS)
152 rm -f $@
153 $(AR) rcs $@ $(OBJS)
155 #######################################################################
156 # USER_OBJS is code used by qemu userspace emulation
157 USER_OBJS=cutils.o
159 libqemu_user.a: $(USER_OBJS)
160 rm -f $@
161 $(AR) rcs $@ $(USER_OBJS)
163 QEMU_IMG_BLOCK_OBJS = nbd.o $(BLOCK_OBJS)
164 ifdef CONFIG_WIN32
165 QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-win32.o
166 else
167 QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-posix.o
168 endif
170 ######################################################################
172 qemu-img$(EXESUF): qemu-img.o qemu-img-block.o $(QEMU_IMG_BLOCK_OBJS)
173 $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
175 qemu-img-%.o: %.c
176 $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG -c -o $@ $<
178 %.o: %.c
179 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
181 qemu-nbd-%.o: %.c
182 $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_NBD -c -o $@ $<
184 qemu-nbd$(EXESUF): qemu-nbd.o qemu-nbd-nbd.o qemu-img-block.o \
185 osdep.o qemu-nbd-block-raw-posix.o $(BLOCK_OBJS)
186 $(CC) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
188 # dyngen host tool
189 dyngen$(EXESUF): dyngen.c
190 $(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^
192 clean:
193 # avoid old build problems by removing potentially incorrect old files
194 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
195 rm -f *.o *.d *.a $(TOOLS) dyngen$(EXESUF) TAGS cscope.* *.pod *~ */*~
196 rm -rf dyngen.dSYM
197 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
198 $(MAKE) -C tests clean
199 for d in $(TARGET_DIRS); do \
200 $(MAKE) -C $$d $@ || exit 1 ; \
201 done
203 distclean: clean
204 rm -f config-host.mak config-host.h $(DOCS)
205 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
206 for d in $(TARGET_DIRS); do \
207 rm -rf $$d || exit 1 ; \
208 done
210 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
211 ar de en-us fi fr-be hr it lv nl pl ru th \
212 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
214 install-doc: $(DOCS)
215 mkdir -p "$(DESTDIR)$(docdir)"
216 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
217 ifndef CONFIG_WIN32
218 mkdir -p "$(DESTDIR)$(mandir)/man1"
219 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
220 mkdir -p "$(DESTDIR)$(mandir)/man8"
221 $(INSTALL) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
222 endif
224 install: all $(if $(BUILD_DOCS),install-doc)
225 mkdir -p "$(DESTDIR)$(bindir)"
226 ifneq ($(TOOLS),)
227 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
228 endif
229 mkdir -p "$(DESTDIR)$(datadir)"
230 set -e; for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
231 video.x openbios-sparc32 openbios-sparc64 pxe-ne2k_pci.bin \
232 pxe-rtl8139.bin pxe-pcnet.bin; do \
233 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
234 done
235 ifndef CONFIG_WIN32
236 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
237 set -e; for x in $(KEYMAPS); do \
238 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
239 done
240 endif
241 for d in $(TARGET_DIRS); do \
242 $(MAKE) -C $$d $@ || exit 1 ; \
243 done
245 # various test targets
246 test speed: all
247 $(MAKE) -C tests $@
249 TAGS:
250 etags *.[ch] tests/*.[ch]
252 cscope:
253 rm -f ./cscope.*
254 find . -name "*.[ch]" -print > ./cscope.files
255 cscope -b
257 # documentation
258 %.html: %.texi
259 texi2html -monolithic -number $<
261 %.info: %.texi
262 makeinfo $< -o $@
264 %.dvi: %.texi
265 texi2dvi $<
267 qemu.1: qemu-doc.texi
268 $(SRC_PATH)/texi2pod.pl $< qemu.pod
269 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
271 qemu-img.1: qemu-img.texi
272 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
273 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
275 qemu-nbd.8: qemu-nbd.texi
276 $(SRC_PATH)/texi2pod.pl $< qemu-nbd.pod
277 pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@
279 info: qemu-doc.info qemu-tech.info
281 dvi: qemu-doc.dvi qemu-tech.dvi
283 html: qemu-doc.html qemu-tech.html
285 VERSION ?= $(shell cat VERSION)
286 FILE = qemu-$(VERSION)
288 # tar release (use 'make -k tar' on a checkouted tree)
289 tar:
290 rm -rf /tmp/$(FILE)
291 cp -r . /tmp/$(FILE)
292 cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
293 rm -rf /tmp/$(FILE)
295 # generate a binary distribution
296 tarbin:
297 cd / && tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
298 $(bindir)/qemu \
299 $(bindir)/qemu-system-ppc \
300 $(bindir)/qemu-system-ppc64 \
301 $(bindir)/qemu-system-ppcemb \
302 $(bindir)/qemu-system-sparc \
303 $(bindir)/qemu-system-x86_64 \
304 $(bindir)/qemu-system-mips \
305 $(bindir)/qemu-system-mipsel \
306 $(bindir)/qemu-system-mips64 \
307 $(bindir)/qemu-system-mips64el \
308 $(bindir)/qemu-system-arm \
309 $(bindir)/qemu-system-m68k \
310 $(bindir)/qemu-system-sh4 \
311 $(bindir)/qemu-system-sh4eb \
312 $(bindir)/qemu-system-cris \
313 $(bindir)/qemu-i386 \
314 $(bindir)/qemu-x86_64 \
315 $(bindir)/qemu-arm \
316 $(bindir)/qemu-armeb \
317 $(bindir)/qemu-sparc \
318 $(bindir)/qemu-sparc32plus \
319 $(bindir)/qemu-sparc64 \
320 $(bindir)/qemu-ppc \
321 $(bindir)/qemu-ppc64 \
322 $(bindir)/qemu-ppc64abi32 \
323 $(bindir)/qemu-mips \
324 $(bindir)/qemu-mipsel \
325 $(bindir)/qemu-alpha \
326 $(bindir)/qemu-m68k \
327 $(bindir)/qemu-sh4 \
328 $(bindir)/qemu-sh4eb \
329 $(bindir)/qemu-cris \
330 $(bindir)/qemu-img \
331 $(bindir)/qemu-nbd \
332 $(datadir)/bios.bin \
333 $(datadir)/vgabios.bin \
334 $(datadir)/vgabios-cirrus.bin \
335 $(datadir)/ppc_rom.bin \
336 $(datadir)/video.x \
337 $(datadir)/openbios-sparc32 \
338 $(datadir)/openbios-sparc64 \
339 $(datadir)/pxe-ne2k_pci.bin \
340 $(datadir)/pxe-rtl8139.bin \
341 $(datadir)/pxe-pcnet.bin \
342 $(docdir)/qemu-doc.html \
343 $(docdir)/qemu-tech.html \
344 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1
345 $(mandir)/man8/qemu-nbd.8
347 # Include automatically generated dependency files
348 -include $(wildcard *.d audio/*.d slirp/*.d)