]> git.proxmox.com Git - qemu.git/blame - Makefile.target
Update from binutils 2.17
[qemu.git] / Makefile.target
CommitLineData
626df76a
FB
1include config.mak
2
0b0babc6
FB
3TARGET_BASE_ARCH:=$(TARGET_ARCH)
4ifeq ($(TARGET_ARCH), x86_64)
5TARGET_BASE_ARCH:=i386
6endif
540635ba
TS
7ifeq ($(TARGET_ARCH), mipsn32)
8TARGET_BASE_ARCH:=mips
9endif
fbe4f65b
TS
10ifeq ($(TARGET_ARCH), mips64)
11TARGET_BASE_ARCH:=mips
12endif
a2458627
FB
13ifeq ($(TARGET_ARCH), ppc64)
14TARGET_BASE_ARCH:=ppc
15endif
22f8a8b3
JM
16ifeq ($(TARGET_ARCH), ppc64h)
17TARGET_BASE_ARCH:=ppc
18endif
d4082e95
JM
19ifeq ($(TARGET_ARCH), ppcemb)
20TARGET_BASE_ARCH:=ppc
21endif
64b3ab24
FB
22ifeq ($(TARGET_ARCH), sparc64)
23TARGET_BASE_ARCH:=sparc
24endif
0b0babc6 25TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
4fb240a4 26VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
46dc3881 27CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
0b0babc6 28#CFLAGS+=-Werror
626df76a 29LIBS=
67b915a5 30DYNGEN=../dyngen$(EXESUF)
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
6f30fa85 75# We require -O2 to avoid the stack setup prologue in EXIT_TB
ac41a620
BS
76OP_CFLAGS := -O2 -g -fno-strict-aliasing
77OP_CFLAGS += -Wall -Wundef -Wendif-labels -Wwrite-strings
6c041c54
TS
78
79# cc-option
80# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
81
82cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
83 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
84
85OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
86OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
87OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
88OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
89OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
90OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
91OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
92OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
1870a74c 93OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
6f30fa85 94
40293e58
FB
95HELPER_CFLAGS=
96
626df76a 97ifeq ($(ARCH),i386)
6f30fa85
TS
98HELPER_CFLAGS+=-fomit-frame-pointer
99OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
f2bf094e
AJ
100# op.c and helper.c need this on 32-bit x86 system to avoid
101# a compiler spill error. This can probably go away
102# once the SSE ops have been converted to TCG
103ifeq ($(HAVE_GT_GCC_3_3), true)
104I386_CFLAGS=-march=i586 -mtune=i686
105endif
bc51c5c9
FB
106endif
107
626df76a 108ifeq ($(ARCH),ppc)
6f30fa85 109CPPFLAGS+= -D__powerpc__
176a4f29 110OP_CFLAGS+= -mlongcall
626df76a
FB
111endif
112
113ifeq ($(ARCH),sparc)
40293e58 114 CFLAGS+=-ffixed-g2 -ffixed-g3
3142255c
BS
115 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
116 ifeq ($(CONFIG_SOLARIS),yes)
117 OP_CFLAGS+=-fno-omit-frame-pointer
118 else
40293e58
FB
119 CFLAGS+=-ffixed-g1 -ffixed-g6
120 HELPER_CFLAGS+=-ffixed-i0
3142255c 121 endif
fdbb4691 122endif
626df76a
FB
123
124ifeq ($(ARCH),sparc64)
3142255c
BS
125 OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
126 ifneq ($(CONFIG_SOLARIS),yes)
e97b640d
BS
127 CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
128 OP_CFLAGS+=-ffixed-g5 -ffixed-g6 -ffixed-g7
129 else
130 CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
3142255c 131 endif
626df76a
FB
132endif
133
134ifeq ($(ARCH),alpha)
6f30fa85
TS
135# -msmall-data is not used for OP_CFLAGS because we want two-instruction
136# relocations for the constant constructions
626df76a 137# Ensure there's only a single GP
40293e58 138CFLAGS+=-msmall-data
626df76a
FB
139endif
140
f54b3f92
AJ
141ifeq ($(ARCH),hppa)
142OP_CFLAGS=-O1 -fno-delayed-branch
143BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
144endif
145
626df76a 146ifeq ($(ARCH),ia64)
40293e58 147CFLAGS+=-mno-sdata
6f30fa85 148OP_CFLAGS+=-mno-sdata
626df76a
FB
149endif
150
151ifeq ($(ARCH),arm)
6f30fa85 152OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
626df76a
FB
153endif
154
38e584a0 155ifeq ($(ARCH),m68k)
6f30fa85 156OP_CFLAGS+=-fomit-frame-pointer
6f30fa85
TS
157endif
158
159ifeq ($(ARCH),mips)
9617efe8 160OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
fbe4f65b
TS
161endif
162
163ifeq ($(ARCH),mips64)
9617efe8 164OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
83fb7adf
FB
165endif
166
40293e58
FB
167CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
168LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
3142255c 169OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
626df76a 170
6f30fa85 171CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
626df76a 172LIBS+=-lm
67b915a5 173ifdef CONFIG_WIN32
3db38e87 174LIBS+=-lwinmm -lws2_32 -liphlpapi
67b915a5 175endif
ec530c81
FB
176ifdef CONFIG_SOLARIS
177LIBS+=-lsocket -lnsl -lresolv
0475a5ca
TS
178ifdef NEEDS_LIBSUNMATH
179LIBS+=-lsunmath
180LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
181OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
40293e58 182CFLAGS+=-I/opt/SUNWspro/prod/include/cc
f72b519c 183endif
831b7825
TS
184endif
185
40293e58 186all: $(PROGS)
626df76a 187
40293e58 188#########################################################
626df76a 189# cpu emulator library
57fec1fe 190LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
cf2be984 191 translate.o host-utils.o
bf6247fb 192ifdef CONFIG_DYNGEN_OP
48ffabc6 193exec.o: dyngen-opc.h
cf2be984
BS
194LIBOBJS+=op.o
195endif
57fec1fe
FB
196# TCG code generator
197LIBOBJS+= tcg/tcg.o tcg/tcg-dyngen.o tcg/tcg-runtime.o
198CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
8289b279
BS
199ifeq ($(ARCH),sparc64)
200CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
201endif
158142c2
FB
202ifdef CONFIG_SOFTFLOAT
203LIBOBJS+=fpu/softfloat.o
204else
205LIBOBJS+=fpu/softfloat-native.o
206endif
6f30fa85 207CPPFLAGS+=-I$(SRC_PATH)/fpu
e95c8d51 208LIBOBJS+= op_helper.o helper.o
e95c8d51 209
b7bcbe95 210ifeq ($(TARGET_BASE_ARCH), arm)
eaa728ee 211LIBOBJS+= neon_helper.o iwmmxt_helper.o
e6e5906b
PB
212endif
213
cf6c1b16 214ifeq ($(TARGET_BASE_ARCH), alpha)
eaa728ee 215LIBOBJS+= alpha_palcode.o
cf6c1b16
JM
216endif
217
e7daa605 218ifeq ($(TARGET_BASE_ARCH), cris)
e7daa605
TS
219LIBOBJS+= cris-dis.o
220
221ifndef CONFIG_USER_ONLY
222LIBOBJS+= mmu.o
223endif
224endif
225
626df76a 226# NOTE: the disassembler code is only needed for debugging
5fafdf24 227LIBOBJS+=disas.o
626df76a 228ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
bc51c5c9
FB
229USE_I386_DIS=y
230endif
0b0babc6 231ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
bc51c5c9
FB
232USE_I386_DIS=y
233endif
234ifdef USE_I386_DIS
626df76a
FB
235LIBOBJS+=i386-dis.o
236endif
237ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
238LIBOBJS+=alpha-dis.o
239endif
a2458627 240ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
626df76a
FB
241LIBOBJS+=ppc-dis.o
242endif
fbe4f65b 243ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
6af0bf9c
FB
244LIBOBJS+=mips-dis.o
245endif
64b3ab24 246ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
626df76a
FB
247LIBOBJS+=sparc-dis.o
248endif
249ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
250LIBOBJS+=arm-dis.o
251endif
48024e4a
FB
252ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
253LIBOBJS+=m68k-dis.o
254endif
fdf9b3e8
FB
255ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
256LIBOBJS+=sh4-dis.o
257endif
f54b3f92
AJ
258ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
259LIBOBJS+=hppa-dis.o
260endif
8f860bb8
TS
261ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
262LIBOBJS+=s390-dis.o
263endif
626df76a 264
40293e58
FB
265# libqemu
266
bf6247fb 267ifdef CONFIG_DYNGEN_OP
dd48594e 268OPC_H = gen-op.h dyngen-opc.h op.h
cf2be984 269endif
dd48594e 270
40293e58
FB
271libqemu.a: $(LIBOBJS)
272 rm -f $@
273 $(AR) rcs $@ $(LIBOBJS)
274
dd48594e
PB
275translate.o: translate.c cpu.h $(OPC_H)
276
277translate-all.o: translate-all.c cpu.h $(OPC_H)
278
279tcg/tcg.o: cpu.h $(OPC_H)
40293e58 280
dd48594e 281tcg/tcg-dyngen.o: $(OPC_H)
40293e58 282
dd48594e 283tcg/tcg-runtime.o: $(OPC_H)
40293e58
FB
284
285op.h: op.o $(DYNGEN)
286 $(DYNGEN) -o $@ $<
287
57fec1fe 288dyngen-opc.h: op.o $(DYNGEN)
40293e58
FB
289 $(DYNGEN) -c -o $@ $<
290
291gen-op.h: op.o $(DYNGEN)
292 $(DYNGEN) -g -o $@ $<
293
294op.o: op.c
f2bf094e 295 $(CC) $(OP_CFLAGS) $(CPPFLAGS) $(I386_CFLAGS) -c -o $@ $<
40293e58 296
8dd3dca3
AJ
297machine.o: machine.c
298 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
299
40293e58
FB
300# HELPER_CFLAGS is used for all the code compiled with static register
301# variables
40293e58 302op_helper.o: op_helper.c
eaa728ee 303 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) $(I386_CFLAGS) -c -o $@ $<
40293e58 304
c96402b1 305cpu-exec.o: cpu-exec.c $(OPC_H)
40293e58
FB
306 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
307
308#########################################################
309# Linux user emulator target
310
311ifdef CONFIG_LINUX_USER
312
40293e58
FB
313ifndef TARGET_ABI_DIR
314 TARGET_ABI_DIR=$(TARGET_ARCH)
315endif
3ebdd119 316VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
40293e58
FB
317CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
318
319ifdef CONFIG_STATIC
320LDFLAGS+=-static
321endif
322
323ifeq ($(ARCH),i386)
324ifdef TARGET_GPROF
325USE_I386_LD=y
326endif
327ifdef CONFIG_STATIC
328USE_I386_LD=y
329endif
330ifdef USE_I386_LD
331LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
332else
333# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
334# that the kernel ELF loader considers as an executable. I think this
335# is the simplest way to make it self virtualizable!
336LDFLAGS+=-Wl,-shared
337endif
338endif
339
340ifeq ($(ARCH),x86_64)
341LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
342endif
343
344ifeq ($(ARCH),ppc)
345LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
346endif
347
810260a8 348ifeq ($(ARCH),ppc64)
349LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
350endif
351
40293e58
FB
352ifeq ($(ARCH),s390)
353LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
354endif
355
356ifeq ($(ARCH),sparc)
357# -static is used to avoid g1/g3 usage by the dynamic linker
358LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
359endif
360
361ifeq ($(ARCH),sparc64)
362LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
363endif
364
365ifeq ($(ARCH),alpha)
366LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
367endif
368
369ifeq ($(ARCH),ia64)
370LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
371endif
372
373ifeq ($(ARCH),arm)
374LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
375endif
376
377ifeq ($(ARCH),m68k)
378LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
379endif
380
381ifeq ($(ARCH),mips)
382ifeq ($(WORDS_BIGENDIAN),yes)
383LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
384else
385LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
386endif
387endif
388
389ifeq ($(ARCH),mips64)
390ifeq ($(WORDS_BIGENDIAN),yes)
391LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
392else
393LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
394endif
395endif
396
17e2377a 397OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
40293e58
FB
398 elfload.o linuxload.o uaccess.o
399LIBS+= $(AIOLIBS)
400ifdef TARGET_HAS_BFLT
401OBJS+= flatload.o
402endif
403ifdef TARGET_HAS_ELFLOAD32
404OBJS+= elfload32.o
405elfload32.o: elfload.c
406endif
407
408ifeq ($(TARGET_ARCH), i386)
409OBJS+= vm86.o
410endif
411ifeq ($(TARGET_ARCH), arm)
412OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
413nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
414 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
415endif
416ifeq ($(TARGET_ARCH), m68k)
417OBJS+= m68k-sim.o m68k-semi.o
418endif
419
1fddef4b 420ifdef CONFIG_GDBSTUB
56aebc89 421OBJS+=gdbstub.o gdbstub-xml.o
1fddef4b 422endif
626df76a 423
40293e58
FB
424OBJS+= libqemu.a
425
426# Note: this is a workaround. The real fix is to avoid compiling
427# cpu_signal_handler() in cpu-exec.c.
428signal.o: signal.c
429 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
626df76a 430
cec7d0b6 431$(QEMU_PROG): $(OBJS) ../libqemu_user.a
40293e58 432 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
626df76a
FB
433ifeq ($(ARCH),alpha)
434# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
435# the address space (31 bit so sign extending doesn't matter)
436 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
437endif
438
40293e58
FB
439endif #CONFIG_LINUX_USER
440
441#########################################################
442# Darwin user emulator target
443
444ifdef CONFIG_DARWIN_USER
445
446VPATH+=:$(SRC_PATH)/darwin-user
447CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
448
449# Leave some space for the regular program loading zone
450LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
451
452LIBS+=-lmx
453
17e2377a 454OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
40293e58
FB
455
456OBJS+= libqemu.a
457
458ifdef CONFIG_GDBSTUB
56aebc89 459OBJS+=gdbstub.o gdbstub-xml.o
40293e58
FB
460endif
461
462# Note: this is a workaround. The real fix is to avoid compiling
463# cpu_signal_handler() in cpu-exec.c.
464signal.o: signal.c
465 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
466
467$(QEMU_PROG): $(OBJS)
468 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
469
470endif #CONFIG_DARWIN_USER
471
472#########################################################
473# System emulator target
474ifndef CONFIG_USER_ONLY
475
48c64363 476OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
34c9dd8e 477OBJS+=fw_cfg.o aio.o buffered_file.o migration.o migration-tcp.o
223d4670 478ifdef CONFIG_WIN32
40293e58 479OBJS+=block-raw-win32.o
223d4670 480else
a3392f9b
AL
481OBJS+=block-raw-posix.o
482endif
483
40293e58 484LIBS+=-lz
1d14ffa9 485ifdef CONFIG_ALSA
1d14ffa9
FB
486LIBS += -lasound
487endif
ca9cc28c
AZ
488ifdef CONFIG_ESD
489LIBS += -lesd
490endif
b8e59f18 491ifdef CONFIG_PA
492LIBS += -lpulse-simple
493endif
1d14ffa9 494ifdef CONFIG_DSOUND
1d14ffa9 495LIBS += -lole32 -ldxguid
85571bc7 496endif
102a52e4 497ifdef CONFIG_FMOD
102a52e4 498LIBS += $(CONFIG_FMOD_LIB)
85571bc7 499endif
2f6a1ab0
BS
500ifdef CONFIG_OSS
501LIBS += $(CONFIG_OSS_LIB)
502endif
4fb240a4
FB
503
504SOUND_HW = sb16.o es1370.o
ca9cc28c
AZ
505ifdef CONFIG_AC97
506SOUND_HW += ac97.o
507endif
1d14ffa9
FB
508ifdef CONFIG_ADLIB
509SOUND_HW += fmopl.o adlib.o
510endif
423d65f4
AZ
511ifdef CONFIG_GUS
512SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
513endif
cc53d26d 514ifdef CONFIG_CS4231A
515SOUND_HW += cs4231a.o
516endif
85571bc7 517
8d5d2d4c
TS
518ifdef CONFIG_VNC_TLS
519CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
520LIBS += $(CONFIG_VNC_TLS_LIBS)
521endif
522
fb599c9a
AZ
523ifdef CONFIG_BLUEZ
524LIBS += $(CONFIG_BLUEZ_LIBS)
525endif
526
2e5d83bb 527# SCSI layer
8b17de88 528OBJS+= lsi53c895a.o esp.o
2e5d83bb 529
a594cfbf 530# USB layer
40293e58 531OBJS+= usb-ohci.o
a594cfbf 532
663e8e51 533# EEPROM emulation
40293e58 534OBJS += eeprom93xx.o
663e8e51 535
a41b2ff2 536# PCI network cards
40293e58
FB
537OBJS += eepro100.o
538OBJS += ne2000.o
539OBJS += pcnet.o
540OBJS += rtl8139.o
7c23b892 541OBJS += e1000.o
a41b2ff2 542
0b0babc6 543ifeq ($(TARGET_BASE_ARCH), i386)
a541f297 544# Hardware support
40293e58
FB
545OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
546OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
547OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
548OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
b00052e4 549CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
67b915a5 550endif
a2458627 551ifeq ($(TARGET_BASE_ARCH), ppc)
b00052e4 552CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
3cbee15b 553# shared objects
40293e58 554OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
3cbee15b 555# PREP target
40293e58
FB
556OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
557OBJS+= prep_pci.o ppc_prep.o
3cbee15b 558# Mac shared devices
40293e58 559OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
3cbee15b 560# OldWorld PowerMac
40293e58 561OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
3cbee15b 562# NewWorld PowerMac
40293e58 563OBJS+= unin_pci.o ppc_chrp.o
3cbee15b 564# PowerPC 4xx boards
40293e58 565OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
a541f297 566endif
fbe4f65b 567ifeq ($(TARGET_BASE_ARCH), mips)
c171148c 568OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
4ce7ff6e
AJ
569OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
570OBJS+= g364fb.o jazz_led.o
40293e58 571OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
4ce7ff6e 572OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
40293e58
FB
573OBJS+= mipsnet.o
574OBJS+= pflash_cfi01.o
4ce7ff6e 575CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
6af0bf9c 576endif
e7daa605 577ifeq ($(TARGET_BASE_ARCH), cris)
40293e58 578OBJS+= etraxfs.o
48318011 579OBJS+= etraxfs_dma.o
e62b5b13 580OBJS+= etraxfs_pic.o
48318011 581OBJS+= etraxfs_eth.o
40293e58
FB
582OBJS+= etraxfs_timer.o
583OBJS+= etraxfs_ser.o
e62b5b13
EI
584
585OBJS+= ptimer.o
48318011 586OBJS+= pflash_cfi02.o
e7daa605 587endif
64b3ab24 588ifeq ($(TARGET_BASE_ARCH), sparc)
3475187d 589ifeq ($(TARGET_ARCH), sparc64)
40293e58
FB
590OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
591OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
592OBJS+= cirrus_vga.o parallel.o ptimer.o
3475187d 593else
40293e58 594OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
8b17de88 595OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o sparc32_dma.o
40293e58 596OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
3475187d 597endif
e95c8d51 598endif
b5ff1b31 599ifeq ($(TARGET_BASE_ARCH), arm)
40293e58
FB
600OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
601OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
602OBJS+= versatile_pci.o ptimer.o
603OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
604OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
605OBJS+= pl061.o
606OBJS+= arm-semi.o
607OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
608OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
609OBJS+= pflash_cfi01.o gumstix.o
88d2c950 610OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
b4e3104b 611OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
afbb5194 612OBJS+= omap2.o omap_dss.o soc_dma.o
40293e58 613OBJS+= palm.o tsc210x.o
942ac052 614OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
58a26b47 615OBJS+= tsc2005.o bt-hci-csr.o
40293e58 616OBJS+= mst_fpga.o mainstone.o
24859b68 617OBJS+= musicpal.o pflash_cfi02.o
5a1237c4 618CPPFLAGS += -DHAS_AUDIO
b5ff1b31 619endif
fdf9b3e8 620ifeq ($(TARGET_BASE_ARCH), sh4)
40293e58
FB
621OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
622OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
fdf9b3e8 623endif
0633879f 624ifeq ($(TARGET_BASE_ARCH), m68k)
40293e58
FB
625OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
626OBJS+= m68k-semi.o dummy_m68k.o
0633879f 627endif
a541f297 628ifdef CONFIG_GDBSTUB
56aebc89 629OBJS+=gdbstub.o gdbstub-xml.o
728c9fd5 630endif
5b0753e0 631ifdef CONFIG_COCOA
1d14ffa9
FB
632COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
633ifdef CONFIG_COREAUDIO
634COCOA_LIBS+=-framework CoreAudio
635endif
5b0753e0 636endif
7c1f25b4 637ifdef CONFIG_SLIRP
6f30fa85 638CPPFLAGS+=-I$(SRC_PATH)/slirp
626df76a
FB
639endif
640
40293e58 641LIBS+=$(AIOLIBS)
c321f673 642# specific flags are needed for non soft mmu emulator
c321f673 643ifdef CONFIG_STATIC
40293e58 644LDFLAGS+=-static
de5eaa64 645endif
83fb7adf 646ifndef CONFIG_DARWIN
11d9f695 647ifndef CONFIG_WIN32
ec530c81 648ifndef CONFIG_SOLARIS
40293e58 649LIBS+=-lutil
11d9f695 650endif
83fb7adf 651endif
ec530c81 652endif
e3086fbf 653ifdef TARGET_GPROF
40293e58
FB
654vl.o: CFLAGS+=-p
655LDFLAGS+=-p
e3086fbf 656endif
c321f673 657
b8076a74 658ifeq ($(ARCH),ia64)
40293e58 659LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
74ccb34e
FB
660endif
661
1d14ffa9
FB
662ifdef CONFIG_WIN32
663SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
664endif
665
40293e58
FB
666# profiling code
667ifdef TARGET_GPROF
668LDFLAGS+=-p
669main.o: CFLAGS+=-p
6e1b3e4d
FB
670endif
671
40293e58 672$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
8a16d273 673 $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
626df76a 674
40293e58 675endif # !CONFIG_USER_ONLY
00a67ba1 676
56aebc89
PB
677gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
678 rm -f $@
679ifeq ($(TARGET_XML_FILES),)
680 echo > $@
681else
682 $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)
683endif
684
626df76a 685%.o: %.c
40293e58 686 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
626df76a 687
f72b519c 688%.o: %.S
6f30fa85 689 $(CC) $(CPPFLAGS) -c -o $@ $<
f72b519c 690
626df76a 691clean:
57fec1fe
FB
692 rm -f *.o *.a *~ $(PROGS) gen-op.h dyngen-opc.h op.h nwfpe/*.o fpu/*.o
693 rm -f *.d */*.d tcg/*.o
1e43adfc 694
5fafdf24 695install: all
9b14bb04 696ifneq ($(PROGS),)
6a882643 697 $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
9b14bb04 698endif
626df76a 699
2f96c28d
JM
700# Include automatically generated dependency files
701-include $(wildcard *.d */*.d)