]> git.proxmox.com Git - qemu.git/blame - Makefile
removed unused file
[qemu.git] / Makefile
CommitLineData
0cb3fb1e
PB
1# Makefile for QEMU.
2
ad064840 3include config-host.mak
766a487a 4
0cb3fb1e 5.PHONY: all clean distclean dvi info install install-doc tar tarbin \
9b0b8203 6 speed test html dvi info
0cb3fb1e 7
8c462f8f
PB
8VPATH=$(SRC_PATH):$(SRC_PATH)/hw
9
6f30fa85
TS
10BASE_CFLAGS=
11BASE_LDFLAGS=
12
3142255c
BS
13BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS)
14BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
15
4fb240a4
FB
16CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP
17CPPFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
766a487a 18LIBS=
1f50f8d1 19ifdef CONFIG_STATIC
6f30fa85 20BASE_LDFLAGS += -static
1f50f8d1 21endif
cc8ae6de 22ifdef BUILD_DOCS
acd935ef 23DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
cc8ae6de
PB
24else
25DOCS=
26endif
aa05ae6f 27
70956b77 28LIBS+=$(AIOLIBS)
83f64091 29
da0b0df8 30all: $(TOOLS) $(DOCS) recurse-all
b9dea4fb 31
da0b0df8 32subdir-%: dyngen$(EXESUF) libqemu_common.a
4aa42531
PB
33 $(MAKE) -C $(subst subdir-,,$@) all
34
35recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
83f64091 36
faf07963
PB
37#######################################################################
38# BLOCK_OBJS is code used by both qemu system emulation and qemu-img
39
40BLOCK_OBJS=cutils.o
41BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o
42BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o
43BLOCK_OBJS+=block-qcow2.o block-parallels.o
44
4fb240a4 45######################################################################
faf07963 46# libqemu_common.a: Target indepedent part of system emulation. The
4fb240a4
FB
47# long term path is to suppress *all* target specific code in case of
48# system emulation, i.e. a single QEMU executable should support all
49# CPUs and machines.
47cea614 50
faf07963 51OBJS=$(BLOCK_OBJS)
87ecb68b 52OBJS+=readline.o console.o
faf07963 53OBJS+=block.o
4fb240a4 54
87ecb68b
PB
55OBJS+=irq.o
56OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
cf0dbb21 57OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o
87ecb68b 58OBJS+=scsi-disk.o cdrom.o
985a03b0 59OBJS+=scsi-generic.o
a7954218 60OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o
775616c3 61OBJS+=sd.o ssi-sd.o
87ecb68b 62
4fb240a4
FB
63ifdef CONFIG_WIN32
64OBJS+=tap-win32.o
65endif
66
67AUDIO_OBJS = audio.o noaudio.o wavaudio.o mixeng.o
68ifdef CONFIG_SDL
69AUDIO_OBJS += sdlaudio.o
70endif
71ifdef CONFIG_OSS
72AUDIO_OBJS += ossaudio.o
73endif
74ifdef CONFIG_COREAUDIO
75AUDIO_OBJS += coreaudio.o
ca9cc28c 76AUDIO_PT = yes
4fb240a4
FB
77endif
78ifdef CONFIG_ALSA
79AUDIO_OBJS += alsaaudio.o
80endif
81ifdef CONFIG_DSOUND
82AUDIO_OBJS += dsoundaudio.o
83endif
84ifdef CONFIG_FMOD
85AUDIO_OBJS += fmodaudio.o
86audio/audio.o audio/fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
87endif
ca9cc28c
AZ
88ifdef CONFIG_ESD
89AUDIO_PT = yes
90AUDIO_PT_INT = yes
91AUDIO_OBJS += esdaudio.o
92endif
93ifdef AUDIO_PT
94LDFLAGS += -pthread
95endif
96ifdef AUDIO_PT_INT
97AUDIO_OBJS += audio_pt_int.o
98endif
4fb240a4
FB
99AUDIO_OBJS+= wavcapture.o
100OBJS+=$(addprefix audio/, $(AUDIO_OBJS))
101
102ifdef CONFIG_SDL
103OBJS+=sdl.o x_keymap.o
104endif
105OBJS+=vnc.o d3des.o
106
107ifdef CONFIG_COCOA
108OBJS+=cocoa.o
109endif
110
111ifdef CONFIG_SLIRP
112CPPFLAGS+=-I$(SRC_PATH)/slirp
113SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
114slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
115tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
116OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
117endif
118
119cocoa.o: cocoa.m
120 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
121
122sdl.o: sdl.c keymaps.c sdl_keysym.h
123 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
124
125vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
d5db4246 126 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(CONFIG_VNC_TLS_CFLAGS) -c -o $@ $<
4fb240a4
FB
127
128audio/sdlaudio.o: audio/sdlaudio.c
129 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
130
131libqemu_common.a: $(OBJS)
132 rm -f $@
133 $(AR) rcs $@ $(OBJS)
134
223d4670
TS
135QEMU_IMG_BLOCK_OBJS = $(BLOCK_OBJS)
136ifdef CONFIG_WIN32
137QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-win32.o
138else
139QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-posix.o
140endif
141
4fb240a4
FB
142######################################################################
143
223d4670 144qemu-img$(EXESUF): qemu-img.o qemu-img-block.o $(QEMU_IMG_BLOCK_OBJS)
4fb240a4
FB
145 $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
146
faf07963
PB
147qemu-img-%.o: %.c
148 $(CC) $(CFLAGS) $(CPPFLAGS) -DQEMU_IMG $(BASE_CFLAGS) -c -o $@ $<
149
4fb240a4
FB
150%.o: %.c
151 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
152
153# dyngen host tool
11d9f695 154dyngen$(EXESUF): dyngen.c
6f30fa85 155 $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
31e31b8a
FB
156
157clean:
2d80ae89 158# avoid old build problems by removing potentially incorrect old files
5fafdf24 159 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
4fb240a4 160 rm -f *.o *.d *.a $(TOOLS) dyngen$(EXESUF) TAGS cscope.* *.pod *~ */*~
b94ec3ec 161 rm -rf dyngen.dSYM
4fb240a4 162 rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d
7d3505c5 163 $(MAKE) -C tests clean
626df76a 164 for d in $(TARGET_DIRS); do \
7d3505c5 165 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 166 done
31e31b8a 167
7d13299d 168distclean: clean
cc8ae6de 169 rm -f config-host.mak config-host.h $(DOCS)
0cb3fb1e 170 rm -f qemu-{doc,tech}.{info,aux,cp,dvi,fn,info,ky,log,pg,toc,tp,vr}
76bc6838 171 for d in $(TARGET_DIRS); do \
bc1b050d 172 rm -rf $$d || exit 1 ; \
76bc6838 173 done
7d13299d 174
fed4a9ad
FB
175KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
176ar de en-us fi fr-be hr it lv nl pl ru th \
177common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
178
38954dca
PB
179install-doc: $(DOCS)
180 mkdir -p "$(DESTDIR)$(docdir)"
181 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
182ifndef CONFIG_WIN32
183 mkdir -p "$(DESTDIR)$(mandir)/man1"
184 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
185endif
186
187install: all $(if $(BUILD_DOCS),install-doc)
1236cab7 188 mkdir -p "$(DESTDIR)$(bindir)"
932a79df 189ifneq ($(TOOLS),)
6a882643 190 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
932a79df 191endif
1236cab7 192 mkdir -p "$(DESTDIR)$(datadir)"
ad064840 193 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
860c6c52 194 video.x openbios-sparc32 pxe-ne2k_pci.bin \
eec85c2a 195 pxe-rtl8139.bin pxe-pcnet.bin; do \
6a882643 196 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
ad064840 197 done
11d9f695 198ifndef CONFIG_WIN32
1236cab7 199 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
ad064840 200 for x in $(KEYMAPS); do \
6a882643 201 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
ad064840 202 done
11d9f695 203endif
626df76a 204 for d in $(TARGET_DIRS); do \
7d3505c5 205 $(MAKE) -C $$d $@ || exit 1 ; \
626df76a 206 done
612384d7 207
367e86e8 208# various test targets
9b0b8203 209test speed: all
7d3505c5 210 $(MAKE) -C tests $@
31e31b8a 211
5fafdf24 212TAGS:
b9adb4a6 213 etags *.[ch] tests/*.[ch]
31e31b8a 214
6688bc6d
FB
215cscope:
216 rm -f ./cscope.*
217 find . -name "*.[ch]" -print > ./cscope.files
218 cscope -b
219
3ef693a0 220# documentation
1f673135 221%.html: %.texi
3ef693a0
FB
222 texi2html -monolithic -number $<
223
f3548328
FB
224%.info: %.texi
225 makeinfo $< -o $@
226
227%.dvi: %.texi
228 texi2dvi $<
229
5a67135a 230qemu.1: qemu-doc.texi
ad064840 231 $(SRC_PATH)/texi2pod.pl $< qemu.pod
5a67135a
FB
232 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
233
acd935ef 234qemu-img.1: qemu-img.texi
ad064840 235 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
acd935ef
FB
236 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
237
0cb3fb1e
PB
238info: qemu-doc.info qemu-tech.info
239
240dvi: qemu-doc.dvi qemu-tech.dvi
241
242html: qemu-doc.html qemu-tech.html
243
df5cf721
TS
244VERSION ?= $(shell cat VERSION)
245FILE = qemu-$(VERSION)
586314f2 246
1e43adfc 247# tar release (use 'make -k tar' on a checkouted tree)
586314f2
FB
248tar:
249 rm -rf /tmp/$(FILE)
1e43adfc 250 cp -r . /tmp/$(FILE)
76b62fd0 251 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
586314f2
FB
252 rm -rf /tmp/$(FILE)
253
76b62fd0 254# generate a binary distribution
d691f669 255tarbin:
4887d78b 256 ( cd / ; tar zcvf ~/qemu-$(VERSION)-$(ARCH).tar.gz \
43095f31 257 $(bindir)/qemu \
7efa4387 258 $(bindir)/qemu-system-ppc \
d4082e95
JM
259 $(bindir)/qemu-system-ppc64 \
260 $(bindir)/qemu-system-ppcemb \
acd935ef 261 $(bindir)/qemu-system-sparc \
43095f31 262 $(bindir)/qemu-system-x86_64 \
93856aac 263 $(bindir)/qemu-system-mips \
38260998 264 $(bindir)/qemu-system-mipsel \
fbe4f65b
TS
265 $(bindir)/qemu-system-mips64 \
266 $(bindir)/qemu-system-mips64el \
ea31eb5b 267 $(bindir)/qemu-system-arm \
ff1aaf65
TS
268 $(bindir)/qemu-system-m68k \
269 $(bindir)/qemu-system-sh4 \
85ffbdfc 270 $(bindir)/qemu-system-sh4eb \
f0403c03 271 $(bindir)/qemu-system-cris \
7efa4387 272 $(bindir)/qemu-i386 \
f0403c03 273 $(bindir)/qemu-x86_64 \
7efa4387 274 $(bindir)/qemu-arm \
ea31eb5b 275 $(bindir)/qemu-armeb \
7efa4387 276 $(bindir)/qemu-sparc \
f0403c03
FB
277 $(bindir)/qemu-sparc32plus \
278 $(bindir)/qemu-sparc64 \
7efa4387 279 $(bindir)/qemu-ppc \
d4082e95 280 $(bindir)/qemu-ppc64 \
f0403c03 281 $(bindir)/qemu-ppc64abi32 \
ea31eb5b
FB
282 $(bindir)/qemu-mips \
283 $(bindir)/qemu-mipsel \
cf6c1b16 284 $(bindir)/qemu-alpha \
ff1aaf65
TS
285 $(bindir)/qemu-m68k \
286 $(bindir)/qemu-sh4 \
85ffbdfc 287 $(bindir)/qemu-sh4eb \
f0403c03 288 $(bindir)/qemu-cris \
b932caba 289 $(bindir)/qemu-img \
7efa4387
FB
290 $(datadir)/bios.bin \
291 $(datadir)/vgabios.bin \
de9258a8 292 $(datadir)/vgabios-cirrus.bin \
637f6cd7 293 $(datadir)/ppc_rom.bin \
d5295253 294 $(datadir)/video.x \
0986ac3b 295 $(datadir)/openbios-sparc32 \
19c80e50
FB
296 $(datadir)/pxe-ne2k_pci.bin \
297 $(datadir)/pxe-rtl8139.bin \
298 $(datadir)/pxe-pcnet.bin \
1f50f8d1
FB
299 $(docdir)/qemu-doc.html \
300 $(docdir)/qemu-tech.html \
acd935ef 301 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
d691f669 302
31e31b8a
FB
303ifneq ($(wildcard .depend),)
304include .depend
305endif
4fb240a4
FB
306
307# Include automatically generated dependency files
308-include $(wildcard *.d audio/*.d slirp/*.d)