]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile.target
build system: silent generation of doc files and qemu-options.h (Jan Kiszka)
[mirror_qemu.git] / Makefile.target
CommitLineData
626df76a 1include config.mak
17759187 2include $(SRC_PATH)/rules.mak
626df76a 3
0b0babc6
FB
4TARGET_BASE_ARCH:=$(TARGET_ARCH)
5ifeq ($(TARGET_ARCH), x86_64)
6TARGET_BASE_ARCH:=i386
7endif
540635ba
TS
8ifeq ($(TARGET_ARCH), mipsn32)
9TARGET_BASE_ARCH:=mips
10endif
fbe4f65b
TS
11ifeq ($(TARGET_ARCH), mips64)
12TARGET_BASE_ARCH:=mips
13endif
a2458627
FB
14ifeq ($(TARGET_ARCH), ppc64)
15TARGET_BASE_ARCH:=ppc
16endif
22f8a8b3
JM
17ifeq ($(TARGET_ARCH), ppc64h)
18TARGET_BASE_ARCH:=ppc
19endif
d4082e95
JM
20ifeq ($(TARGET_ARCH), ppcemb)
21TARGET_BASE_ARCH:=ppc
22endif
64b3ab24
FB
23ifeq ($(TARGET_ARCH), sparc64)
24TARGET_BASE_ARCH:=sparc
25endif
0b0babc6 26TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
4fb240a4 27VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
46dc3881 28CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
0b0babc6 29#CFLAGS+=-Werror
626df76a 30LIBS=
1e43adfc 31# user emulator name
0c64b9cd 32ifndef TARGET_ARCH2
c91fde65 33TARGET_ARCH2=$(TARGET_ARCH)
0c64b9cd 34endif
808c4954
FB
35ifeq ($(TARGET_ARCH),arm)
36 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
c91fde65 37 TARGET_ARCH2=armeb
808c4954 38 endif
c91fde65 39endif
908f52b0
PB
40ifeq ($(TARGET_ARCH),sh4)
41 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
42 TARGET_ARCH2=sh4eb
43 endif
44endif
01f5e596 45ifeq ($(TARGET_ARCH),mips)
c91fde65
FB
46 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
47 TARGET_ARCH2=mipsel
01f5e596 48 endif
01f5e596 49endif
540635ba
TS
50ifeq ($(TARGET_ARCH),mipsn32)
51 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
52 TARGET_ARCH2=mipsn32el
53 endif
54endif
fbe4f65b
TS
55ifeq ($(TARGET_ARCH),mips64)
56 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
57 TARGET_ARCH2=mips64el
58 endif
59endif
40293e58
FB
60
61ifdef CONFIG_USER_ONLY
62# user emulator name
63QEMU_PROG=qemu-$(TARGET_ARCH2)
64else
1e43adfc 65# system emulator name
a541f297 66ifeq ($(TARGET_ARCH), i386)
40293e58 67QEMU_PROG=qemu$(EXESUF)
0db63474 68else
40293e58 69QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
a541f297 70endif
de5eaa64 71endif
626df76a 72
40293e58 73PROGS=$(QEMU_PROG)
626df76a 74
6c041c54 75# cc-option
c7328801 76# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
6c041c54 77
c7328801
AL
78cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \
79 > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;)
6f30fa85 80
40293e58
FB
81HELPER_CFLAGS=
82
626df76a 83ifeq ($(ARCH),i386)
6f30fa85 84HELPER_CFLAGS+=-fomit-frame-pointer
bc51c5c9
FB
85endif
86
d19076fa 87ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
88translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
89endif
90
626df76a 91ifeq ($(ARCH),sparc)
c7328801 92 ifneq ($(CONFIG_SOLARIS),yes)
40293e58 93 HELPER_CFLAGS+=-ffixed-i0
3142255c 94 endif
fdbb4691 95endif
626df76a 96
626df76a 97ifeq ($(ARCH),alpha)
626df76a 98# Ensure there's only a single GP
40293e58 99CFLAGS+=-msmall-data
626df76a
FB
100endif
101
f54b3f92 102ifeq ($(ARCH),hppa)
f54b3f92
AJ
103BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
104endif
105
626df76a 106ifeq ($(ARCH),ia64)
40293e58 107CFLAGS+=-mno-sdata
83fb7adf
FB
108endif
109
40293e58
FB
110CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
111LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
626df76a 112
6f30fa85 113CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
626df76a 114LIBS+=-lm
67b915a5 115ifdef CONFIG_WIN32
3db38e87 116LIBS+=-lwinmm -lws2_32 -liphlpapi
67b915a5 117endif
ec530c81
FB
118ifdef CONFIG_SOLARIS
119LIBS+=-lsocket -lnsl -lresolv
0475a5ca
TS
120ifdef NEEDS_LIBSUNMATH
121LIBS+=-lsunmath
122LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
40293e58 123CFLAGS+=-I/opt/SUNWspro/prod/include/cc
f72b519c 124endif
831b7825
TS
125endif
126
7ba1e619
AL
127kvm.o: CFLAGS+=$(KVM_CFLAGS)
128kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
129
40293e58 130all: $(PROGS)
626df76a 131
40293e58 132#########################################################
626df76a 133# cpu emulator library
57fec1fe 134LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
cf2be984 135 translate.o host-utils.o
57fec1fe 136# TCG code generator
49516bc0 137LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
57fec1fe 138CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
8289b279
BS
139ifeq ($(ARCH),sparc64)
140CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
141endif
158142c2
FB
142ifdef CONFIG_SOFTFLOAT
143LIBOBJS+=fpu/softfloat.o
144else
145LIBOBJS+=fpu/softfloat-native.o
146endif
6f30fa85 147CPPFLAGS+=-I$(SRC_PATH)/fpu
e95c8d51 148LIBOBJS+= op_helper.o helper.o
e95c8d51 149
b7bcbe95 150ifeq ($(TARGET_BASE_ARCH), arm)
eaa728ee 151LIBOBJS+= neon_helper.o iwmmxt_helper.o
e6e5906b
PB
152endif
153
cf6c1b16 154ifeq ($(TARGET_BASE_ARCH), alpha)
eaa728ee 155LIBOBJS+= alpha_palcode.o
cf6c1b16
JM
156endif
157
e7daa605 158ifeq ($(TARGET_BASE_ARCH), cris)
e7daa605
TS
159LIBOBJS+= cris-dis.o
160
161ifndef CONFIG_USER_ONLY
162LIBOBJS+= mmu.o
163endif
164endif
165
626df76a 166# NOTE: the disassembler code is only needed for debugging
5fafdf24 167LIBOBJS+=disas.o
626df76a 168ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
bc51c5c9
FB
169USE_I386_DIS=y
170endif
0b0babc6 171ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
bc51c5c9
FB
172USE_I386_DIS=y
173endif
174ifdef USE_I386_DIS
626df76a
FB
175LIBOBJS+=i386-dis.o
176endif
177ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
178LIBOBJS+=alpha-dis.o
179endif
a2458627 180ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
626df76a
FB
181LIBOBJS+=ppc-dis.o
182endif
fbe4f65b 183ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
6af0bf9c
FB
184LIBOBJS+=mips-dis.o
185endif
64b3ab24 186ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
626df76a
FB
187LIBOBJS+=sparc-dis.o
188endif
189ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
190LIBOBJS+=arm-dis.o
191endif
48024e4a
FB
192ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
193LIBOBJS+=m68k-dis.o
194endif
fdf9b3e8
FB
195ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
196LIBOBJS+=sh4-dis.o
197endif
f54b3f92
AJ
198ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
199LIBOBJS+=hppa-dis.o
200endif
8f860bb8
TS
201ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
202LIBOBJS+=s390-dis.o
203endif
626df76a 204
40293e58
FB
205# libqemu
206
207libqemu.a: $(LIBOBJS)
40293e58 208
86e840ee 209translate.o: translate.c cpu.h
40293e58 210
86e840ee 211translate-all.o: translate-all.c cpu.h
40293e58 212
86e840ee 213tcg/tcg.o: cpu.h
40293e58
FB
214
215# HELPER_CFLAGS is used for all the code compiled with static register
216# variables
807544e2 217op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
40293e58 218
807544e2 219cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
40293e58
FB
220
221#########################################################
222# Linux user emulator target
223
224ifdef CONFIG_LINUX_USER
225
40293e58
FB
226ifndef TARGET_ABI_DIR
227 TARGET_ABI_DIR=$(TARGET_ARCH)
228endif
3ebdd119 229VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
40293e58
FB
230CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
231
232ifdef CONFIG_STATIC
233LDFLAGS+=-static
234endif
235
236ifeq ($(ARCH),i386)
237ifdef TARGET_GPROF
238USE_I386_LD=y
239endif
240ifdef CONFIG_STATIC
241USE_I386_LD=y
242endif
243ifdef USE_I386_LD
244LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
245else
246# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
247# that the kernel ELF loader considers as an executable. I think this
248# is the simplest way to make it self virtualizable!
249LDFLAGS+=-Wl,-shared
250endif
251endif
252
253ifeq ($(ARCH),x86_64)
254LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
255endif
256
257ifeq ($(ARCH),ppc)
258LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
259endif
260
810260a8 261ifeq ($(ARCH),ppc64)
262LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
263endif
264
40293e58
FB
265ifeq ($(ARCH),s390)
266LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
267endif
268
269ifeq ($(ARCH),sparc)
270# -static is used to avoid g1/g3 usage by the dynamic linker
271LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
272endif
273
274ifeq ($(ARCH),sparc64)
275LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
276endif
277
278ifeq ($(ARCH),alpha)
279LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
280endif
281
282ifeq ($(ARCH),ia64)
283LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
284endif
285
286ifeq ($(ARCH),arm)
287LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
288endif
289
290ifeq ($(ARCH),m68k)
291LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
292endif
293
294ifeq ($(ARCH),mips)
295ifeq ($(WORDS_BIGENDIAN),yes)
296LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
297else
298LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
299endif
300endif
301
302ifeq ($(ARCH),mips64)
303ifeq ($(WORDS_BIGENDIAN),yes)
304LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
305else
306LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
307endif
308endif
309
6d946cda
AJ
310# profiling code
311ifdef TARGET_GPROF
312LDFLAGS+=-p
313CFLAGS+=-p
314endif
315
17e2377a 316OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
04a6dfeb 317 elfload.o linuxload.o uaccess.o envlist.o
40293e58
FB
318LIBS+= $(AIOLIBS)
319ifdef TARGET_HAS_BFLT
320OBJS+= flatload.o
321endif
322ifdef TARGET_HAS_ELFLOAD32
323OBJS+= elfload32.o
324elfload32.o: elfload.c
325endif
326
327ifeq ($(TARGET_ARCH), i386)
328OBJS+= vm86.o
329endif
330ifeq ($(TARGET_ARCH), arm)
331OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
332nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
333 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
334endif
335ifeq ($(TARGET_ARCH), m68k)
336OBJS+= m68k-sim.o m68k-semi.o
337endif
338
1fddef4b 339ifdef CONFIG_GDBSTUB
56aebc89 340OBJS+=gdbstub.o gdbstub-xml.o
1fddef4b 341endif
626df76a 342
40293e58
FB
343OBJS+= libqemu.a
344
345# Note: this is a workaround. The real fix is to avoid compiling
346# cpu_signal_handler() in cpu-exec.c.
807544e2 347signal.o: CFLAGS += $(HELPER_CFLAGS)
626df76a 348
cec7d0b6 349$(QEMU_PROG): $(OBJS) ../libqemu_user.a
3aa892d7 350 $(LINK)
626df76a
FB
351ifeq ($(ARCH),alpha)
352# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
353# the address space (31 bit so sign extending doesn't matter)
354 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
355endif
356
40293e58
FB
357endif #CONFIG_LINUX_USER
358
359#########################################################
360# Darwin user emulator target
361
362ifdef CONFIG_DARWIN_USER
363
364VPATH+=:$(SRC_PATH)/darwin-user
365CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
366
367# Leave some space for the regular program loading zone
368LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
369
370LIBS+=-lmx
371
17e2377a 372OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
40293e58
FB
373
374OBJS+= libqemu.a
375
376ifdef CONFIG_GDBSTUB
56aebc89 377OBJS+=gdbstub.o gdbstub-xml.o
40293e58
FB
378endif
379
380# Note: this is a workaround. The real fix is to avoid compiling
381# cpu_signal_handler() in cpu-exec.c.
807544e2 382signal.o: CFLAGS += $(HELPER_CFLAGS)
40293e58
FB
383
384$(QEMU_PROG): $(OBJS)
3aa892d7 385 $(LINK)
40293e58
FB
386
387endif #CONFIG_DARWIN_USER
388
84778508
BS
389#########################################################
390# BSD user emulator target
391
392ifdef CONFIG_BSD_USER
393
394VPATH+=:$(SRC_PATH)/bsd-user
395CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
396
397ifdef CONFIG_STATIC
398LDFLAGS+=-static
399endif
400
401ifeq ($(ARCH),i386)
402ifdef TARGET_GPROF
403USE_I386_LD=y
404endif
405ifdef CONFIG_STATIC
406USE_I386_LD=y
407endif
408ifdef USE_I386_LD
409LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
410else
411# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
412# that the kernel ELF loader considers as an executable. I think this
413# is the simplest way to make it self virtualizable!
414LDFLAGS+=-Wl,-shared
415endif
416endif
417
418ifeq ($(ARCH),x86_64)
419LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
420endif
421
422ifeq ($(ARCH),ppc)
423LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
424endif
425
426ifeq ($(ARCH),ppc64)
427LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
428endif
429
430ifeq ($(ARCH),s390)
431LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
432endif
433
434ifeq ($(ARCH),sparc)
435# -static is used to avoid g1/g3 usage by the dynamic linker
436LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
437endif
438
439ifeq ($(ARCH),sparc64)
440LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
441endif
442
443ifeq ($(ARCH),alpha)
444LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
445endif
446
447ifeq ($(ARCH),ia64)
448LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
449endif
450
451ifeq ($(ARCH),arm)
452LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
453endif
454
455ifeq ($(ARCH),m68k)
456LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
457endif
458
459ifeq ($(ARCH),mips)
460ifeq ($(WORDS_BIGENDIAN),yes)
461LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
462else
463LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
464endif
465endif
466
467ifeq ($(ARCH),mips64)
468ifeq ($(WORDS_BIGENDIAN),yes)
469LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
470else
471LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
472endif
473endif
474
475OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
476OBJS+= uaccess.o
477
478OBJS+= libqemu.a
479
480ifdef CONFIG_GDBSTUB
481OBJS+=gdbstub.o
482endif
483
484# Note: this is a workaround. The real fix is to avoid compiling
485# cpu_signal_handler() in cpu-exec.c.
807544e2 486signal.o: CFLAGS += $(HELPER_CFLAGS)
84778508
BS
487
488$(QEMU_PROG): $(OBJS) ../libqemu_user.a
3aa892d7 489 $(LINK)
84778508
BS
490
491endif #CONFIG_BSD_USER
492
40293e58
FB
493#########################################################
494# System emulator target
495ifndef CONFIG_USER_ONLY
496
244ab90e 497OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o dma-helpers.o
1fd31ad7
AL
498# virtio has to be here due to weird dependency between PCI and virtio-net.
499# need to fix this properly
9ede2fde 500OBJS+=virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
559b90fb 501OBJS+=fw_cfg.o
7ba1e619
AL
502ifdef CONFIG_KVM
503OBJS+=kvm.o kvm-all.o
504endif
223d4670 505ifdef CONFIG_WIN32
40293e58 506OBJS+=block-raw-win32.o
223d4670 507else
3c529d93
AL
508ifdef CONFIG_AIO
509OBJS+=posix-aio-compat.o
510endif
559b90fb 511OBJS+=block-raw-posix.o
a3392f9b
AL
512endif
513
40293e58 514LIBS+=-lz
1d14ffa9 515ifdef CONFIG_ALSA
1d14ffa9
FB
516LIBS += -lasound
517endif
ca9cc28c
AZ
518ifdef CONFIG_ESD
519LIBS += -lesd
520endif
b8e59f18 521ifdef CONFIG_PA
522LIBS += -lpulse-simple
523endif
1d14ffa9 524ifdef CONFIG_DSOUND
1d14ffa9 525LIBS += -lole32 -ldxguid
85571bc7 526endif
102a52e4 527ifdef CONFIG_FMOD
102a52e4 528LIBS += $(CONFIG_FMOD_LIB)
85571bc7 529endif
2f6a1ab0
BS
530ifdef CONFIG_OSS
531LIBS += $(CONFIG_OSS_LIB)
532endif
4fb240a4 533
b0f3b8fa 534SOUND_HW = sb16.o es1370.o ac97.o
1d14ffa9
FB
535ifdef CONFIG_ADLIB
536SOUND_HW += fmopl.o adlib.o
c40e866f 537adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
1d14ffa9 538endif
423d65f4
AZ
539ifdef CONFIG_GUS
540SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
541endif
cc53d26d 542ifdef CONFIG_CS4231A
543SOUND_HW += cs4231a.o
544endif
85571bc7 545
8d5d2d4c
TS
546ifdef CONFIG_VNC_TLS
547CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
548LIBS += $(CONFIG_VNC_TLS_LIBS)
549endif
550
2f9606b3
AL
551ifdef CONFIG_VNC_SASL
552CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
553LIBS += $(CONFIG_VNC_SASL_LIBS)
554endif
555
fb599c9a
AZ
556ifdef CONFIG_BLUEZ
557LIBS += $(CONFIG_BLUEZ_LIBS)
558endif
559
2e5d83bb 560# SCSI layer
8b17de88 561OBJS+= lsi53c895a.o esp.o
2e5d83bb 562
a594cfbf 563# USB layer
40293e58 564OBJS+= usb-ohci.o
a594cfbf 565
663e8e51 566# EEPROM emulation
40293e58 567OBJS += eeprom93xx.o
663e8e51 568
a41b2ff2 569# PCI network cards
40293e58
FB
570OBJS += eepro100.o
571OBJS += ne2000.o
572OBJS += pcnet.o
573OBJS += rtl8139.o
7c23b892 574OBJS += e1000.o
a41b2ff2 575
aa71cf80
AJ
576# Serial mouse
577OBJS += msmouse.o
578
0b0babc6 579ifeq ($(TARGET_BASE_ARCH), i386)
a541f297 580# Hardware support
40293e58
FB
581OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
582OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
610626af 583OBJS+= cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
16b29ae1 584OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
6f338c34 585OBJS += device-hotplug.o pci-hotplug.o
b00052e4 586CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
67b915a5 587endif
a2458627 588ifeq ($(TARGET_BASE_ARCH), ppc)
70ad3dec 589CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
3cbee15b 590# shared objects
40293e58 591OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
3cbee15b 592# PREP target
40293e58
FB
593OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
594OBJS+= prep_pci.o ppc_prep.o
3cbee15b 595# Mac shared devices
7fa9ae1a 596OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
3cbee15b 597# OldWorld PowerMac
40293e58 598OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
3cbee15b 599# NewWorld PowerMac
b98a003c 600OBJS+= unin_pci.o ppc_newworld.o
3cbee15b 601# PowerPC 4xx boards
825bb581 602OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
2c9fade2 603OBJS+= ppc440.o ppc440_bamboo.o
74c62ba8 604# PowerPC E500 boards
1db09b84 605OBJS+= ppce500_pci.o ppce500_mpc8544ds.o
f652e6af
AJ
606ifdef FDT_LIBS
607OBJS+= device_tree.o
608LIBS+= $(FDT_LIBS)
609endif
d76d1650
AJ
610ifdef CONFIG_KVM
611OBJS+= kvm_ppc.o
612endif
a541f297 613endif
fbe4f65b 614ifeq ($(TARGET_BASE_ARCH), mips)
c171148c 615OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
4ce7ff6e
AJ
616OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
617OBJS+= g364fb.o jazz_led.o
40293e58 618OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
4ce7ff6e 619OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
40293e58
FB
620OBJS+= mipsnet.o
621OBJS+= pflash_cfi01.o
1f605a76 622OBJS+= vmware_vga.o
4ce7ff6e 623CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
6af0bf9c 624endif
e7daa605 625ifeq ($(TARGET_BASE_ARCH), cris)
10c144e2
EI
626# Boards
627OBJS+= etraxfs.o axis_dev88.o
628
629# IO blocks
48318011 630OBJS+= etraxfs_dma.o
e62b5b13 631OBJS+= etraxfs_pic.o
48318011 632OBJS+= etraxfs_eth.o
40293e58
FB
633OBJS+= etraxfs_timer.o
634OBJS+= etraxfs_ser.o
e62b5b13
EI
635
636OBJS+= ptimer.o
10c144e2 637OBJS+= pflash_cfi02.o nand.o
e7daa605 638endif
64b3ab24 639ifeq ($(TARGET_BASE_ARCH), sparc)
3475187d 640ifeq ($(TARGET_ARCH), sparc64)
40293e58
FB
641OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
642OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
643OBJS+= cirrus_vga.o parallel.o ptimer.o
3475187d 644else
40293e58 645OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
2aa2ab3a 646OBJS+= slavio_timer.o escc.o slavio_misc.o fdc.o sparc32_dma.o
40293e58 647OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
3475187d 648endif
e95c8d51 649endif
b5ff1b31 650ifeq ($(TARGET_BASE_ARCH), arm)
40293e58
FB
651OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
652OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
653OBJS+= versatile_pci.o ptimer.o
654OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
655OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
656OBJS+= pl061.o
657OBJS+= arm-semi.o
658OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
659OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
660OBJS+= pflash_cfi01.o gumstix.o
88d2c950 661OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
b4e3104b 662OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
afbb5194 663OBJS+= omap2.o omap_dss.o soc_dma.o
997641a8 664OBJS+= omap_sx1.o palm.o tsc210x.o
942ac052 665OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
58a26b47 666OBJS+= tsc2005.o bt-hci-csr.o
40293e58 667OBJS+= mst_fpga.o mainstone.o
24859b68 668OBJS+= musicpal.o pflash_cfi02.o
714fa308 669OBJS+= framebuffer.o
5a1237c4 670CPPFLAGS += -DHAS_AUDIO
b5ff1b31 671endif
fdf9b3e8 672ifeq ($(TARGET_BASE_ARCH), sh4)
40293e58 673OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
1e5459a3 674OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
a4a771c0 675OBJS+= ide.o
fdf9b3e8 676endif
0633879f 677ifeq ($(TARGET_BASE_ARCH), m68k)
40293e58
FB
678OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
679OBJS+= m68k-semi.o dummy_m68k.o
0633879f 680endif
a541f297 681ifdef CONFIG_GDBSTUB
56aebc89 682OBJS+=gdbstub.o gdbstub-xml.o
728c9fd5 683endif
5b0753e0 684ifdef CONFIG_COCOA
1d14ffa9
FB
685COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
686ifdef CONFIG_COREAUDIO
687COCOA_LIBS+=-framework CoreAudio
688endif
5b0753e0 689endif
7c1f25b4 690ifdef CONFIG_SLIRP
6f30fa85 691CPPFLAGS+=-I$(SRC_PATH)/slirp
626df76a
FB
692endif
693
40293e58 694LIBS+=$(AIOLIBS)
c321f673 695# specific flags are needed for non soft mmu emulator
c321f673 696ifdef CONFIG_STATIC
40293e58 697LDFLAGS+=-static
de5eaa64 698endif
83fb7adf 699ifndef CONFIG_DARWIN
11d9f695 700ifndef CONFIG_WIN32
ec530c81 701ifndef CONFIG_SOLARIS
b29fe3ed 702ifndef CONFIG_AIX
40293e58 703LIBS+=-lutil
11d9f695 704endif
b29fe3ed 705endif
83fb7adf 706endif
ec530c81 707endif
e3086fbf 708ifdef TARGET_GPROF
40293e58
FB
709vl.o: CFLAGS+=-p
710LDFLAGS+=-p
e3086fbf 711endif
c321f673 712
b8076a74 713ifeq ($(ARCH),ia64)
40293e58 714LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
74ccb34e
FB
715endif
716
1d14ffa9
FB
717ifdef CONFIG_WIN32
718SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
719endif
720
40293e58
FB
721# profiling code
722ifdef TARGET_GPROF
723LDFLAGS+=-p
724main.o: CFLAGS+=-p
6e1b3e4d
FB
725endif
726
5824d651
BS
727vl.o: qemu-options.h
728
3aa892d7
AL
729$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
730
40293e58 731$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
3aa892d7 732 $(LINK)
626df76a 733
40293e58 734endif # !CONFIG_USER_ONLY
00a67ba1 735
56aebc89 736gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
56aebc89 737ifeq ($(TARGET_XML_FILES),)
1aef4c57 738 $(call quiet-command,rm -f $@ && echo > $@," GEN $(TARGET_DIR)$@")
56aebc89 739else
1aef4c57 740 $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
56aebc89
PB
741endif
742
5824d651 743qemu-options.h: $(SRC_PATH)/qemu-options.hx
0d00e563 744 $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
5824d651 745
626df76a 746clean:
5824d651 747 rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o qemu-options.h
57fec1fe 748 rm -f *.d */*.d tcg/*.o
1e43adfc 749
5fafdf24 750install: all
9b14bb04 751ifneq ($(PROGS),)
6a882643 752 $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
9b14bb04 753endif
626df76a 754
2f96c28d
JM
755# Include automatically generated dependency files
756-include $(wildcard *.d */*.d)