]> git.proxmox.com Git - qemu.git/blame - Makefile.target
removed unused file
[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
faf07963 27CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MP -DNEED_CPU_H
831b7825
TS
28ifdef CONFIG_DARWIN_USER
29VPATH+=:$(SRC_PATH)/darwin-user
30CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
31endif
32ifdef CONFIG_LINUX_USER
3035f7ff 33VPATH+=:$(SRC_PATH)/linux-user
992f48a0
BS
34ifndef TARGET_ABI_DIR
35 TARGET_ABI_DIR=$(TARGET_ARCH)
36endif
37CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
3035f7ff 38endif
6f30fa85
TS
39BASE_CFLAGS=
40BASE_LDFLAGS=
0b0babc6 41#CFLAGS+=-Werror
626df76a 42LIBS=
626df76a 43HELPER_CFLAGS=$(CFLAGS)
67b915a5 44DYNGEN=../dyngen$(EXESUF)
1e43adfc 45# user emulator name
0c64b9cd 46ifndef TARGET_ARCH2
c91fde65 47TARGET_ARCH2=$(TARGET_ARCH)
0c64b9cd 48endif
808c4954
FB
49ifeq ($(TARGET_ARCH),arm)
50 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
c91fde65 51 TARGET_ARCH2=armeb
808c4954 52 endif
c91fde65 53endif
908f52b0
PB
54ifeq ($(TARGET_ARCH),sh4)
55 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
56 TARGET_ARCH2=sh4eb
57 endif
58endif
01f5e596 59ifeq ($(TARGET_ARCH),mips)
c91fde65
FB
60 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
61 TARGET_ARCH2=mipsel
01f5e596 62 endif
01f5e596 63endif
540635ba
TS
64ifeq ($(TARGET_ARCH),mipsn32)
65 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
66 TARGET_ARCH2=mipsn32el
67 endif
68endif
fbe4f65b
TS
69ifeq ($(TARGET_ARCH),mips64)
70 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
71 TARGET_ARCH2=mips64el
72 endif
73endif
c91fde65 74QEMU_USER=qemu-$(TARGET_ARCH2)
1e43adfc
FB
75# system emulator name
76ifdef CONFIG_SOFTMMU
a541f297 77ifeq ($(TARGET_ARCH), i386)
67b915a5 78QEMU_SYSTEM=qemu$(EXESUF)
0db63474 79else
c91fde65 80QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
a541f297
FB
81endif
82else
0db63474 83QEMU_SYSTEM=qemu-fast
1e43adfc
FB
84endif
85
16e9b7de 86ifdef CONFIG_USER_ONLY
1e43adfc 87PROGS=$(QEMU_USER)
16e9b7de 88else
c321f673 89PROGS+=$(QEMU_SYSTEM)
de5eaa64
FB
90ifndef CONFIG_SOFTMMU
91CONFIG_STATIC=y
92endif
728c9fd5 93endif # !CONFIG_USER_ONLY
626df76a
FB
94
95ifdef CONFIG_STATIC
6f30fa85 96BASE_LDFLAGS+=-static
626df76a
FB
97endif
98
6f30fa85 99# We require -O2 to avoid the stack setup prologue in EXIT_TB
6c041c54
TS
100OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing
101
102# cc-option
103# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
104
105cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
106 > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
107
108OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
109OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
110OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
111OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
112OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
113OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
114OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "")
115OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, ""))
1870a74c 116OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "")
6f30fa85 117
626df76a 118ifeq ($(ARCH),i386)
6f30fa85
TS
119HELPER_CFLAGS+=-fomit-frame-pointer
120OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
626df76a 121ifdef TARGET_GPROF
3a4739d6
FB
122USE_I386_LD=y
123endif
124ifdef CONFIG_STATIC
125USE_I386_LD=y
126endif
127ifdef USE_I386_LD
6f30fa85 128BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
626df76a 129else
831b7825 130ifdef CONFIG_LINUX_USER
626df76a
FB
131# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
132# that the kernel ELF loader considers as an executable. I think this
133# is the simplest way to make it self virtualizable!
6f30fa85 134BASE_LDFLAGS+=-Wl,-shared
626df76a 135endif
626df76a 136endif
831b7825 137endif
626df76a 138
0b0babc6 139ifeq ($(ARCH),x86_64)
8a0ef219
TS
140 ifneq ($(CONFIG_SOLARIS),yes)
141 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
142 endif
bc51c5c9
FB
143endif
144
626df76a 145ifeq ($(ARCH),ppc)
6f30fa85
TS
146CPPFLAGS+= -D__powerpc__
147BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
626df76a
FB
148endif
149
150ifeq ($(ARCH),s390)
6f30fa85 151BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
626df76a
FB
152endif
153
154ifeq ($(ARCH),sparc)
3142255c
BS
155 BASE_CFLAGS+=-ffixed-g2 -ffixed-g3
156 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
157 ifeq ($(CONFIG_SOLARIS),yes)
158 OP_CFLAGS+=-fno-omit-frame-pointer
159 else
160 BASE_CFLAGS+=-ffixed-g1 -ffixed-g6
66f1cdbd 161 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0
3142255c
BS
162 # -static is used to avoid g1/g3 usage by the dynamic linker
163 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
164 endif
fdbb4691 165endif
626df76a
FB
166
167ifeq ($(ARCH),sparc64)
3142255c
BS
168 BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
169 OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0
170 ifneq ($(CONFIG_SOLARIS),yes)
171 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
172 OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
173 endif
626df76a
FB
174endif
175
176ifeq ($(ARCH),alpha)
6f30fa85
TS
177# -msmall-data is not used for OP_CFLAGS because we want two-instruction
178# relocations for the constant constructions
626df76a 179# Ensure there's only a single GP
6f30fa85
TS
180BASE_CFLAGS+=-msmall-data
181BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
626df76a
FB
182endif
183
184ifeq ($(ARCH),ia64)
6f30fa85
TS
185BASE_CFLAGS+=-mno-sdata
186OP_CFLAGS+=-mno-sdata
187BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
626df76a
FB
188endif
189
190ifeq ($(ARCH),arm)
6f30fa85
TS
191OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
192BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
626df76a
FB
193endif
194
38e584a0 195ifeq ($(ARCH),m68k)
6f30fa85
TS
196OP_CFLAGS+=-fomit-frame-pointer
197BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
198endif
199
200ifeq ($(ARCH),mips)
9617efe8 201OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
fbe4f65b
TS
202ifeq ($(WORDS_BIGENDIAN),yes)
203BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
204else
205BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
206endif
207endif
208
209ifeq ($(ARCH),mips64)
9617efe8 210OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0
fbe4f65b 211ifeq ($(WORDS_BIGENDIAN),yes)
6f30fa85 212BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
fbe4f65b
TS
213else
214BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
215endif
38e584a0
FB
216endif
217
83fb7adf 218ifeq ($(CONFIG_DARWIN),yes)
e80cfcfc 219LIBS+=-lmx
83fb7adf
FB
220endif
221
01feaa05
TS
222ifdef CONFIG_DARWIN_USER
223# Leave some space for the regular program loading zone
224BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
225endif
226
3142255c
BS
227BASE_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
228BASE_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
229OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
230OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
6f30fa85 231
626df76a
FB
232#########################################################
233
6f30fa85 234CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
626df76a 235LIBS+=-lm
b932caba
FB
236ifndef CONFIG_USER_ONLY
237LIBS+=-lz
238endif
67b915a5 239ifdef CONFIG_WIN32
3db38e87 240LIBS+=-lwinmm -lws2_32 -liphlpapi
67b915a5 241endif
ec530c81
FB
242ifdef CONFIG_SOLARIS
243LIBS+=-lsocket -lnsl -lresolv
0475a5ca
TS
244ifdef NEEDS_LIBSUNMATH
245LIBS+=-lsunmath
246LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
247OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
248BASE_CFLAGS+=-I/opt/SUNWspro/prod/include/cc
249endif
ec530c81 250endif
626df76a
FB
251
252# profiling code
253ifdef TARGET_GPROF
6f30fa85
TS
254BASE_LDFLAGS+=-p
255main.o: BASE_CFLAGS+=-p
626df76a
FB
256endif
257
831b7825 258ifdef CONFIG_LINUX_USER
b92c47c1 259OBJS= main.o syscall.o strace.o mmap.o signal.o path.o osdep.o thunk.o \
579a97f7 260 elfload.o linuxload.o uaccess.o
b5906f95 261LIBS+= $(AIOLIBS)
e5fe0c52
PB
262ifdef TARGET_HAS_BFLT
263OBJS+= flatload.o
264endif
cb33da57
BS
265ifdef TARGET_HAS_ELFLOAD32
266OBJS+= elfload32.o
267elfload32.o: elfload.c
268endif
e5fe0c52 269
626df76a
FB
270ifeq ($(TARGET_ARCH), i386)
271OBJS+= vm86.o
272endif
f72b519c 273ifeq ($(TARGET_ARCH), arm)
158142c2 274OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
f72b519c 275nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
a4f81979 276 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
f72b519c 277endif
e6e5906b
PB
278ifeq ($(TARGET_ARCH), m68k)
279OBJS+= m68k-sim.o m68k-semi.o
280endif
831b7825
TS
281endif #CONFIG_LINUX_USER
282
283ifdef CONFIG_DARWIN_USER
284OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
285endif
286
626df76a
FB
287SRCS:= $(OBJS:.o=.c)
288OBJS+= libqemu.a
289
290# cpu emulator library
158142c2 291LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
f1548daa 292 translate.o op.o host-utils.o
158142c2
FB
293ifdef CONFIG_SOFTFLOAT
294LIBOBJS+=fpu/softfloat.o
295else
296LIBOBJS+=fpu/softfloat-native.o
297endif
6f30fa85 298CPPFLAGS+=-I$(SRC_PATH)/fpu
626df76a
FB
299
300ifeq ($(TARGET_ARCH), i386)
1e43adfc 301LIBOBJS+=helper.o helper2.o
626df76a
FB
302endif
303
0b0babc6
FB
304ifeq ($(TARGET_ARCH), x86_64)
305LIBOBJS+=helper.o helper2.o
306endif
307
a2458627 308ifeq ($(TARGET_BASE_ARCH), ppc)
728c9fd5 309LIBOBJS+= op_helper.o helper.o
67867308
FB
310endif
311
fbe4f65b 312ifeq ($(TARGET_BASE_ARCH), mips)
6af0bf9c
FB
313LIBOBJS+= op_helper.o helper.o
314endif
315
64b3ab24 316ifeq ($(TARGET_BASE_ARCH), sparc)
e95c8d51
FB
317LIBOBJS+= op_helper.o helper.o
318endif
319
b7bcbe95 320ifeq ($(TARGET_BASE_ARCH), arm)
b5ff1b31 321LIBOBJS+= op_helper.o helper.o
b7bcbe95
FB
322endif
323
fdf9b3e8
FB
324ifeq ($(TARGET_BASE_ARCH), sh4)
325LIBOBJS+= op_helper.o helper.o
326endif
327
e6e5906b 328ifeq ($(TARGET_BASE_ARCH), m68k)
0633879f 329LIBOBJS+= op_helper.o helper.o
e6e5906b
PB
330endif
331
cf6c1b16
JM
332ifeq ($(TARGET_BASE_ARCH), alpha)
333LIBOBJS+= op_helper.o helper.o alpha_palcode.o
334endif
335
e7daa605
TS
336ifeq ($(TARGET_BASE_ARCH), cris)
337LIBOBJS+= op_helper.o helper.o
338LIBOBJS+= cris-dis.o
339
340ifndef CONFIG_USER_ONLY
341LIBOBJS+= mmu.o
342endif
343endif
344
626df76a 345# NOTE: the disassembler code is only needed for debugging
5fafdf24 346LIBOBJS+=disas.o
626df76a 347ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
bc51c5c9
FB
348USE_I386_DIS=y
349endif
0b0babc6 350ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
bc51c5c9
FB
351USE_I386_DIS=y
352endif
353ifdef USE_I386_DIS
626df76a
FB
354LIBOBJS+=i386-dis.o
355endif
356ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
357LIBOBJS+=alpha-dis.o
358endif
a2458627 359ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
626df76a
FB
360LIBOBJS+=ppc-dis.o
361endif
fbe4f65b 362ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
6af0bf9c
FB
363LIBOBJS+=mips-dis.o
364endif
64b3ab24 365ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
626df76a
FB
366LIBOBJS+=sparc-dis.o
367endif
368ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
369LIBOBJS+=arm-dis.o
370endif
48024e4a
FB
371ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
372LIBOBJS+=m68k-dis.o
373endif
fdf9b3e8
FB
374ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
375LIBOBJS+=sh4-dis.o
376endif
8f860bb8
TS
377ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
378LIBOBJS+=s390-dis.o
379endif
626df76a 380
1fddef4b
FB
381ifdef CONFIG_GDBSTUB
382OBJS+=gdbstub.o
383endif
626df76a 384
1e43adfc 385all: $(PROGS)
626df76a 386
1e43adfc 387$(QEMU_USER): $(OBJS)
6f30fa85 388 $(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS)
626df76a
FB
389ifeq ($(ARCH),alpha)
390# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
391# the address space (31 bit so sign extending doesn't matter)
392 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
393endif
394
395# must use static linking to avoid leaving stuff in virtual address space
4fb240a4
FB
396VL_OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o
397# XXX: suppress QEMU_TOOL tests
223d4670
TS
398ifdef CONFIG_WIN32
399VL_OBJS+=block-raw-win32.o
400else
401VL_OBJS+=block-raw-posix.o
402endif
a541f297 403
1d14ffa9 404ifdef CONFIG_ALSA
1d14ffa9
FB
405LIBS += -lasound
406endif
ca9cc28c
AZ
407ifdef CONFIG_ESD
408LIBS += -lesd
409endif
1d14ffa9 410ifdef CONFIG_DSOUND
1d14ffa9 411LIBS += -lole32 -ldxguid
85571bc7 412endif
102a52e4 413ifdef CONFIG_FMOD
102a52e4 414LIBS += $(CONFIG_FMOD_LIB)
85571bc7 415endif
4fb240a4
FB
416
417SOUND_HW = sb16.o es1370.o
ca9cc28c
AZ
418ifdef CONFIG_AC97
419SOUND_HW += ac97.o
420endif
1d14ffa9
FB
421ifdef CONFIG_ADLIB
422SOUND_HW += fmopl.o adlib.o
423endif
423d65f4
AZ
424ifdef CONFIG_GUS
425SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
426endif
85571bc7 427
8d5d2d4c
TS
428ifdef CONFIG_VNC_TLS
429CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
430LIBS += $(CONFIG_VNC_TLS_LIBS)
431endif
432
2e5d83bb 433# SCSI layer
87ecb68b 434VL_OBJS+= lsi53c895a.o
2e5d83bb 435
a594cfbf 436# USB layer
87ecb68b 437VL_OBJS+= usb-ohci.o
a594cfbf 438
663e8e51
TS
439# EEPROM emulation
440VL_OBJS += eeprom93xx.o
441
a41b2ff2 442# PCI network cards
663e8e51
TS
443VL_OBJS += eepro100.o
444VL_OBJS += ne2000.o
445VL_OBJS += pcnet.o
446VL_OBJS += rtl8139.o
a41b2ff2 447
0b0babc6 448ifeq ($(TARGET_BASE_ARCH), i386)
a541f297 449# Hardware support
4fb240a4 450VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
fd06c375 451VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
b00052e4 452VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
87ecb68b 453VL_OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o
b00052e4 454CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
67b915a5 455endif
a2458627 456ifeq ($(TARGET_BASE_ARCH), ppc)
b00052e4 457CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
3cbee15b 458# shared objects
4fb240a4 459VL_OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
3cbee15b
JM
460# PREP target
461VL_OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
462VL_OBJS+= prep_pci.o ppc_prep.o
463# Mac shared devices
464VL_OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o
465# OldWorld PowerMac
466VL_OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
467# NewWorld PowerMac
468VL_OBJS+= unin_pci.o ppc_chrp.o
469# PowerPC 4xx boards
470VL_OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc405_uc.o ppc405_boards.o
a541f297 471endif
fbe4f65b 472ifeq ($(TARGET_BASE_ARCH), mips)
6bf5b4e8 473VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o mips_mipssim.o
ad6fe1d2 474VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
31211df1 475VL_OBJS+= jazz_led.o
9542611a 476VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
87ecb68b 477VL_OBJS+= piix_pci.o parallel.o cirrus_vga.o $(SOUND_HW)
6bf5b4e8 478VL_OBJS+= mipsnet.o
c8b153d7 479VL_OBJS+= pflash_cfi01.o
83b1fb88 480CPPFLAGS += -DHAS_AUDIO
6af0bf9c 481endif
e7daa605
TS
482ifeq ($(TARGET_BASE_ARCH), cris)
483VL_OBJS+= etraxfs.o
484VL_OBJS+= ptimer.o
485VL_OBJS+= etraxfs_timer.o
486VL_OBJS+= etraxfs_ser.o
487endif
64b3ab24 488ifeq ($(TARGET_BASE_ARCH), sparc)
3475187d 489ifeq ($(TARGET_ARCH), sparc64)
502a5395 490VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
83469015 491VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
20c9f095 492VL_OBJS+= cirrus_vga.o parallel.o ptimer.o
3475187d 493else
67e999be
FB
494VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
495VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
ee76f82e 496VL_OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
3475187d 497endif
e95c8d51 498endif
b5ff1b31 499ifeq ($(TARGET_BASE_ARCH), arm)
cdbdb648 500VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
7e1543c2 501VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
775616c3 502VL_OBJS+= versatile_pci.o ptimer.o
9ee6e8bb 503VL_OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
eea589cc 504VL_OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
87ecb68b 505VL_OBJS+= pl061.o
8e71621f 506VL_OBJS+= arm-semi.o
b00052e4 507VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
31b87f2e 508VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
05ee37eb 509VL_OBJS+= pflash_cfi01.o gumstix.o
7233b355 510VL_OBJS+= spitz.o ide.o serial.o nand.o ecc.o
02645926
AZ
511VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o omap_i2c.o
512VL_OBJS+= palm.o tsc210x.o
7233b355 513VL_OBJS+= mst_fpga.o mainstone.o
5a1237c4 514CPPFLAGS += -DHAS_AUDIO
b5ff1b31 515endif
fdf9b3e8 516ifeq ($(TARGET_BASE_ARCH), sh4)
0d78f544 517VL_OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
80f515e6 518VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o
fdf9b3e8 519endif
0633879f 520ifeq ($(TARGET_BASE_ARCH), m68k)
7e049b8a 521VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
ca02f319 522VL_OBJS+= m68k-semi.o dummy_m68k.o
0633879f 523endif
a541f297 524ifdef CONFIG_GDBSTUB
5fafdf24 525VL_OBJS+=gdbstub.o
728c9fd5 526endif
5b0753e0 527ifdef CONFIG_COCOA
1d14ffa9
FB
528COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
529ifdef CONFIG_COREAUDIO
530COCOA_LIBS+=-framework CoreAudio
531endif
5b0753e0 532endif
7c1f25b4 533ifdef CONFIG_SLIRP
6f30fa85 534CPPFLAGS+=-I$(SRC_PATH)/slirp
626df76a
FB
535endif
536
db8d7dd1 537VL_LDFLAGS=$(VL_OS_LDFLAGS)
70956b77 538VL_LIBS=$(AIOLIBS)
c321f673 539# specific flags are needed for non soft mmu emulator
c321f673
FB
540ifdef CONFIG_STATIC
541VL_LDFLAGS+=-static
542endif
de5eaa64 543ifndef CONFIG_SOFTMMU
5fafdf24 544VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
de5eaa64 545endif
83fb7adf 546ifndef CONFIG_DARWIN
11d9f695 547ifndef CONFIG_WIN32
ec530c81 548ifndef CONFIG_SOLARIS
70956b77 549VL_LIBS+=-lutil
11d9f695 550endif
83fb7adf 551endif
ec530c81 552endif
e3086fbf 553ifdef TARGET_GPROF
6f30fa85 554vl.o: BASE_CFLAGS+=-p
e3086fbf
FB
555VL_LDFLAGS+=-p
556endif
c321f673 557
b8076a74
FB
558ifeq ($(ARCH),ia64)
559VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
560endif
561
74ccb34e 562ifeq ($(ARCH),sparc64)
3142255c
BS
563 VL_LDFLAGS+=-m64
564 ifneq ($(CONFIG_SOLARIS),yes)
565 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
566 endif
8a0ef219
TS
567endif
568
569ifeq ($(ARCH),x86_64)
570 VL_LDFLAGS+=-m64
571 ifneq ($(CONFIG_SOLARIS),yes)
572 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
573 endif
74ccb34e
FB
574endif
575
1d14ffa9
FB
576ifdef CONFIG_WIN32
577SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
578endif
579
4fb240a4 580$(QEMU_SYSTEM): $(VL_OBJS) ../libqemu_common.a libqemu.a
3a11702b 581 $(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
5b0753e0 582
626df76a 583depend: $(SRCS)
6f30fa85 584 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
626df76a 585
1d14ffa9 586vldepend: $(VL_OBJS:.o=.c)
6f30fa85 587 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
1d14ffa9 588
5fafdf24 589# libqemu
626df76a
FB
590
591libqemu.a: $(LIBOBJS)
592 rm -f $@
593 $(AR) rcs $@ $(LIBOBJS)
594
1e43adfc 595translate.o: translate.c gen-op.h opc.h cpu.h
626df76a 596
158142c2
FB
597translate-all.o: translate-all.c opc.h cpu.h
598
599translate-op.o: translate-all.c op.h opc.h cpu.h
626df76a 600
1e43adfc 601op.h: op.o $(DYNGEN)
626df76a
FB
602 $(DYNGEN) -o $@ $<
603
1e43adfc 604opc.h: op.o $(DYNGEN)
626df76a
FB
605 $(DYNGEN) -c -o $@ $<
606
1e43adfc 607gen-op.h: op.o $(DYNGEN)
626df76a
FB
608 $(DYNGEN) -g -o $@ $<
609
1e43adfc 610op.o: op.c
6f30fa85 611 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
626df76a 612
6e1b3e4d
FB
613# HELPER_CFLAGS is used for all the code compiled with static register
614# variables
615ifeq ($(TARGET_BASE_ARCH), i386)
616# XXX: rename helper.c to op_helper.c
1e43adfc 617helper.o: helper.c
6f30fa85 618 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
6e1b3e4d
FB
619else
620op_helper.o: op_helper.c
6f30fa85 621 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
6e1b3e4d
FB
622endif
623
624cpu-exec.o: cpu-exec.c
6f30fa85 625 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
626df76a 626
00a67ba1
FB
627# Note: this is a workaround. The real fix is to avoid compiling
628# cpu_signal_handler() in cpu-exec.c.
629signal.o: signal.c
6f30fa85 630 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
00a67ba1 631
626df76a 632%.o: %.c
6f30fa85 633 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
626df76a 634
f72b519c 635%.o: %.S
6f30fa85 636 $(CC) $(CPPFLAGS) -c -o $@ $<
f72b519c 637
626df76a 638clean:
4fb240a4 639 rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o fpu/*.o
2f96c28d 640 rm -f *.d */*.d
1e43adfc 641
5fafdf24 642install: all
9b14bb04 643ifneq ($(PROGS),)
6a882643 644 $(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
9b14bb04 645endif
626df76a
FB
646
647ifneq ($(wildcard .depend),)
648include .depend
649endif
1d14ffa9 650
c0fe3827 651ifeq (1, 0)
1d14ffa9 652audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
ca9cc28c
AZ
653fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o ac97.o gus.o adlib.o \
654esdaudio.o audio_pt_int.o: \
655CFLAGS := $(CFLAGS) -O0 -g -Wall -Werror -W -Wsign-compare -Wno-unused
1d14ffa9 656endif
2f96c28d
JM
657
658# Include automatically generated dependency files
659-include $(wildcard *.d */*.d)