Statistics
| Branch: | Revision:

root / Makefile.target @ 762e8230

History | View | Annotate | Download (17 kB)

1
include config.mak
2
include $(SRC_PATH)/rules.mak
3

    
4
TARGET_BASE_ARCH:=$(TARGET_ARCH)
5
ifeq ($(TARGET_ARCH), x86_64)
6
TARGET_BASE_ARCH:=i386
7
endif
8
ifeq ($(TARGET_ARCH), mipsn32)
9
TARGET_BASE_ARCH:=mips
10
endif
11
ifeq ($(TARGET_ARCH), mips64)
12
TARGET_BASE_ARCH:=mips
13
endif
14
ifeq ($(TARGET_ARCH), ppc64)
15
TARGET_BASE_ARCH:=ppc
16
endif
17
ifeq ($(TARGET_ARCH), ppc64h)
18
TARGET_BASE_ARCH:=ppc
19
endif
20
ifeq ($(TARGET_ARCH), ppcemb)
21
TARGET_BASE_ARCH:=ppc
22
endif
23
ifeq ($(TARGET_ARCH), sparc64)
24
TARGET_BASE_ARCH:=sparc
25
endif
26
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
27
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw
28
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H
29
#CFLAGS+=-Werror
30
LIBS=
31
# user emulator name
32
ifndef TARGET_ARCH2
33
TARGET_ARCH2=$(TARGET_ARCH)
34
endif
35
ifeq ($(TARGET_ARCH),arm)
36
  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
37
    TARGET_ARCH2=armeb
38
  endif
39
endif
40
ifeq ($(TARGET_ARCH),sh4)
41
  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
42
    TARGET_ARCH2=sh4eb
43
  endif
44
endif
45
ifeq ($(TARGET_ARCH),mips)
46
  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
47
    TARGET_ARCH2=mipsel
48
  endif
49
endif
50
ifeq ($(TARGET_ARCH),mipsn32)
51
  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
52
    TARGET_ARCH2=mipsn32el
53
  endif
54
endif
55
ifeq ($(TARGET_ARCH),mips64)
56
  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
57
    TARGET_ARCH2=mips64el
58
  endif
59
endif
60

    
61
ifdef CONFIG_USER_ONLY
62
# user emulator name
63
QEMU_PROG=qemu-$(TARGET_ARCH2)
64
else
65
# system emulator name
66
ifeq ($(TARGET_ARCH), i386)
67
QEMU_PROG=qemu$(EXESUF)
68
else
69
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
70
endif
71
endif
72

    
73
PROGS=$(QEMU_PROG)
74

    
75
# cc-option
76
# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0)
77

    
78
cc-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 ;)
80

    
81
HELPER_CFLAGS=
82

    
83
ifeq ($(ARCH),i386)
84
HELPER_CFLAGS+=-fomit-frame-pointer
85
endif
86

    
87
ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc)
88
translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,)
89
endif
90

    
91
ifeq ($(ARCH),sparc)
92
  ifneq ($(CONFIG_SOLARIS),yes)
93
    HELPER_CFLAGS+=-ffixed-i0
94
  endif
95
endif
96

    
97
ifeq ($(ARCH),alpha)
98
# Ensure there's only a single GP
99
CFLAGS+=-msmall-data
100
endif
101

    
102
ifeq ($(ARCH),hppa)
103
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
104
endif
105

    
106
ifeq ($(ARCH),ia64)
107
CFLAGS+=-mno-sdata
108
endif
109

    
110
CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS)
111
LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS)
112

    
113
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
114
LIBS+=-lm
115
ifdef CONFIG_WIN32
116
LIBS+=-lwinmm -lws2_32 -liphlpapi
117
endif
118
ifdef CONFIG_SOLARIS
119
LIBS+=-lsocket -lnsl -lresolv
120
ifdef NEEDS_LIBSUNMATH
121
LIBS+=-lsunmath
122
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib
123
CFLAGS+=-I/opt/SUNWspro/prod/include/cc
124
endif
125
endif
126

    
127
kvm.o: CFLAGS+=$(KVM_CFLAGS)
128
kvm-all.o: CFLAGS+=$(KVM_CFLAGS)
129

    
130
all: $(PROGS)
131

    
132
#########################################################
133
# cpu emulator library
134
LIBOBJS=exec.o kqemu.o translate-all.o cpu-exec.o\
135
        translate.o host-utils.o
136
# TCG code generator
137
LIBOBJS+= tcg/tcg.o tcg/tcg-runtime.o
138
CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH)
139
ifeq ($(ARCH),sparc64)
140
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc
141
endif
142
ifdef CONFIG_SOFTFLOAT
143
LIBOBJS+=fpu/softfloat.o
144
else
145
LIBOBJS+=fpu/softfloat-native.o
146
endif
147
CPPFLAGS+=-I$(SRC_PATH)/fpu
148
LIBOBJS+= op_helper.o helper.o
149

    
150
ifeq ($(TARGET_BASE_ARCH), arm)
151
LIBOBJS+= neon_helper.o iwmmxt_helper.o
152
endif
153

    
154
ifeq ($(TARGET_BASE_ARCH), alpha)
155
LIBOBJS+= alpha_palcode.o
156
endif
157

    
158
ifeq ($(TARGET_BASE_ARCH), cris)
159
LIBOBJS+= cris-dis.o
160

    
161
ifndef CONFIG_USER_ONLY
162
LIBOBJS+= mmu.o
163
endif
164
endif
165

    
166
# NOTE: the disassembler code is only needed for debugging
167
LIBOBJS+=disas.o
168
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
169
USE_I386_DIS=y
170
endif
171
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
172
USE_I386_DIS=y
173
endif
174
ifdef USE_I386_DIS
175
LIBOBJS+=i386-dis.o
176
endif
177
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
178
LIBOBJS+=alpha-dis.o
179
endif
180
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
181
LIBOBJS+=ppc-dis.o
182
endif
183
ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips)
184
LIBOBJS+=mips-dis.o
185
endif
186
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
187
LIBOBJS+=sparc-dis.o
188
endif
189
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
190
LIBOBJS+=arm-dis.o
191
endif
192
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
193
LIBOBJS+=m68k-dis.o
194
endif
195
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
196
LIBOBJS+=sh4-dis.o
197
endif
198
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa)
199
LIBOBJS+=hppa-dis.o
200
endif
201
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390)
202
LIBOBJS+=s390-dis.o
203
endif
204

    
205
# libqemu
206

    
207
libqemu.a: $(LIBOBJS)
208

    
209
translate.o: translate.c cpu.h
210

    
211
translate-all.o: translate-all.c cpu.h
212

    
213
tcg/tcg.o: cpu.h
214

    
215
# HELPER_CFLAGS is used for all the code compiled with static register
216
# variables
217
op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS)
218

    
219
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS)
220

    
221
#########################################################
222
# Linux user emulator target
223

    
224
ifdef CONFIG_LINUX_USER
225

    
226
ifndef TARGET_ABI_DIR
227
  TARGET_ABI_DIR=$(TARGET_ARCH)
228
endif
229
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
230
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
231

    
232
ifdef CONFIG_STATIC
233
LDFLAGS+=-static
234
endif
235

    
236
ifeq ($(ARCH),i386)
237
ifdef TARGET_GPROF
238
USE_I386_LD=y
239
endif
240
ifdef CONFIG_STATIC
241
USE_I386_LD=y
242
endif
243
ifdef USE_I386_LD
244
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
245
else
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!
249
LDFLAGS+=-Wl,-shared
250
endif
251
endif
252

    
253
ifeq ($(ARCH),x86_64)
254
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
255
endif
256

    
257
ifeq ($(ARCH),ppc)
258
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
259
endif
260

    
261
ifeq ($(ARCH),ppc64)
262
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
263
endif
264

    
265
ifeq ($(ARCH),s390)
266
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
267
endif
268

    
269
ifeq ($(ARCH),sparc)
270
# -static is used to avoid g1/g3 usage by the dynamic linker	
271
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
272
endif
273

    
274
ifeq ($(ARCH),sparc64)
275
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
276
endif
277

    
278
ifeq ($(ARCH),alpha)
279
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
280
endif
281

    
282
ifeq ($(ARCH),ia64)
283
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
284
endif
285

    
286
ifeq ($(ARCH),arm)
287
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
288
endif
289

    
290
ifeq ($(ARCH),m68k)
291
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
292
endif
293

    
294
ifeq ($(ARCH),mips)
295
ifeq ($(WORDS_BIGENDIAN),yes)
296
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
297
else
298
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
299
endif
300
endif
301

    
302
ifeq ($(ARCH),mips64)
303
ifeq ($(WORDS_BIGENDIAN),yes)
304
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
305
else
306
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
307
endif
308
endif
309

    
310
# profiling code
311
ifdef TARGET_GPROF
312
LDFLAGS+=-p
313
CFLAGS+=-p
314
endif
315

    
316
OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
317
      elfload.o linuxload.o uaccess.o envlist.o
318
LIBS+= $(AIOLIBS)
319
ifdef TARGET_HAS_BFLT
320
OBJS+= flatload.o
321
endif
322
ifdef TARGET_HAS_ELFLOAD32
323
OBJS+= elfload32.o
324
elfload32.o: elfload.c
325
endif
326

    
327
ifeq ($(TARGET_ARCH), i386)
328
OBJS+= vm86.o
329
endif
330
ifeq ($(TARGET_ARCH), arm)
331
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
332
nwfpe/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
334
endif
335
ifeq ($(TARGET_ARCH), m68k)
336
OBJS+= m68k-sim.o m68k-semi.o
337
endif
338

    
339
ifdef CONFIG_GDBSTUB
340
OBJS+=gdbstub.o gdbstub-xml.o
341
endif
342

    
343
OBJS+= libqemu.a
344

    
345
# Note: this is a workaround. The real fix is to avoid compiling
346
# cpu_signal_handler() in cpu-exec.c.
347
signal.o: CFLAGS += $(HELPER_CFLAGS)
348

    
349
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
350
	$(LINK)
351
ifeq ($(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
355
endif
356

    
357
endif #CONFIG_LINUX_USER
358

    
359
#########################################################
360
# Darwin user emulator target
361

    
362
ifdef CONFIG_DARWIN_USER
363

    
364
VPATH+=:$(SRC_PATH)/darwin-user
365
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
366

    
367
# Leave some space for the regular program loading zone
368
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
369

    
370
LIBS+=-lmx
371

    
372
OBJS= main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o
373

    
374
OBJS+= libqemu.a
375

    
376
ifdef CONFIG_GDBSTUB
377
OBJS+=gdbstub.o gdbstub-xml.o
378
endif
379

    
380
# Note: this is a workaround. The real fix is to avoid compiling
381
# cpu_signal_handler() in cpu-exec.c.
382
signal.o: CFLAGS += $(HELPER_CFLAGS)
383

    
384
$(QEMU_PROG): $(OBJS)
385
	$(LINK)
386

    
387
endif #CONFIG_DARWIN_USER
388

    
389
#########################################################
390
# BSD user emulator target
391

    
392
ifdef CONFIG_BSD_USER
393

    
394
VPATH+=:$(SRC_PATH)/bsd-user
395
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
396

    
397
ifdef CONFIG_STATIC
398
LDFLAGS+=-static
399
endif
400

    
401
ifeq ($(ARCH),i386)
402
ifdef TARGET_GPROF
403
USE_I386_LD=y
404
endif
405
ifdef CONFIG_STATIC
406
USE_I386_LD=y
407
endif
408
ifdef USE_I386_LD
409
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
410
else
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!
414
LDFLAGS+=-Wl,-shared
415
endif
416
endif
417

    
418
ifeq ($(ARCH),x86_64)
419
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
420
endif
421

    
422
ifeq ($(ARCH),ppc)
423
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
424
endif
425

    
426
ifeq ($(ARCH),ppc64)
427
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
428
endif
429

    
430
ifeq ($(ARCH),s390)
431
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
432
endif
433

    
434
ifeq ($(ARCH),sparc)
435
# -static is used to avoid g1/g3 usage by the dynamic linker
436
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
437
endif
438

    
439
ifeq ($(ARCH),sparc64)
440
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
441
endif
442

    
443
ifeq ($(ARCH),alpha)
444
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
445
endif
446

    
447
ifeq ($(ARCH),ia64)
448
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
449
endif
450

    
451
ifeq ($(ARCH),arm)
452
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
453
endif
454

    
455
ifeq ($(ARCH),m68k)
456
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
457
endif
458

    
459
ifeq ($(ARCH),mips)
460
ifeq ($(WORDS_BIGENDIAN),yes)
461
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
462
else
463
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
464
endif
465
endif
466

    
467
ifeq ($(ARCH),mips64)
468
ifeq ($(WORDS_BIGENDIAN),yes)
469
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
470
else
471
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
472
endif
473
endif
474

    
475
OBJS= main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o
476
OBJS+= uaccess.o
477

    
478
OBJS+= libqemu.a
479

    
480
ifdef CONFIG_GDBSTUB
481
OBJS+=gdbstub.o
482
endif
483

    
484
# Note: this is a workaround. The real fix is to avoid compiling
485
# cpu_signal_handler() in cpu-exec.c.
486
signal.o: CFLAGS += $(HELPER_CFLAGS)
487

    
488
$(QEMU_PROG): $(OBJS) ../libqemu_user.a
489
	$(LINK)
490

    
491
endif #CONFIG_BSD_USER
492

    
493
#########################################################
494
# System emulator target
495
ifndef CONFIG_USER_ONLY
496

    
497
OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o dma-helpers.o
498
# virtio has to be here due to weird dependency between PCI and virtio-net.
499
# need to fix this properly
500
OBJS+=virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o
501
OBJS+=fw_cfg.o
502
ifdef CONFIG_KVM
503
OBJS+=kvm.o kvm-all.o
504
endif
505
ifdef CONFIG_WIN32
506
OBJS+=block-raw-win32.o
507
else
508
ifdef CONFIG_AIO
509
OBJS+=posix-aio-compat.o
510
endif
511
OBJS+=block-raw-posix.o
512
endif
513

    
514
LIBS+=-lz
515
ifdef CONFIG_ALSA
516
LIBS += -lasound
517
endif
518
ifdef CONFIG_ESD
519
LIBS += -lesd
520
endif
521
ifdef CONFIG_PA
522
LIBS += -lpulse-simple
523
endif
524
ifdef CONFIG_DSOUND
525
LIBS += -lole32 -ldxguid
526
endif
527
ifdef CONFIG_FMOD
528
LIBS += $(CONFIG_FMOD_LIB)
529
endif
530
ifdef CONFIG_OSS
531
LIBS += $(CONFIG_OSS_LIB)
532
endif
533

    
534
SOUND_HW = sb16.o es1370.o ac97.o
535
ifdef CONFIG_ADLIB
536
SOUND_HW += fmopl.o adlib.o
537
adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0
538
endif
539
ifdef CONFIG_GUS
540
SOUND_HW += gus.o gusemu_hal.o gusemu_mixer.o
541
endif
542
ifdef CONFIG_CS4231A
543
SOUND_HW += cs4231a.o
544
endif
545

    
546
ifdef CONFIG_VNC_TLS
547
CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
548
LIBS += $(CONFIG_VNC_TLS_LIBS)
549
endif
550

    
551
ifdef CONFIG_VNC_SASL
552
CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS)
553
LIBS += $(CONFIG_VNC_SASL_LIBS)
554
endif
555

    
556
ifdef CONFIG_BLUEZ
557
LIBS += $(CONFIG_BLUEZ_LIBS)
558
endif
559

    
560
# SCSI layer
561
OBJS+= lsi53c895a.o esp.o
562

    
563
# USB layer
564
OBJS+= usb-ohci.o
565

    
566
# EEPROM emulation
567
OBJS += eeprom93xx.o
568

    
569
# PCI network cards
570
OBJS += eepro100.o
571
OBJS += ne2000.o
572
OBJS += pcnet.o
573
OBJS += rtl8139.o
574
OBJS += e1000.o
575

    
576
# Serial mouse
577
OBJS += msmouse.o
578

    
579
ifeq ($(TARGET_BASE_ARCH), i386)
580
# Hardware support
581
OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
582
OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
583
OBJS+= cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o
584
OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o
585
OBJS += device-hotplug.o pci-hotplug.o
586
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
587
endif
588
ifeq ($(TARGET_BASE_ARCH), ppc)
589
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
590
# shared objects
591
OBJS+= ppc.o ide.o vga.o $(SOUND_HW) dma.o openpic.o
592
# PREP target
593
OBJS+= pckbd.o ps2.o serial.o i8259.o i8254.o fdc.o m48t59.o mc146818rtc.o
594
OBJS+= prep_pci.o ppc_prep.o
595
# Mac shared devices
596
OBJS+= macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o escc.o
597
# OldWorld PowerMac
598
OBJS+= heathrow_pic.o grackle_pci.o ppc_oldworld.o
599
# NewWorld PowerMac
600
OBJS+= unin_pci.o ppc_newworld.o
601
# PowerPC 4xx boards
602
OBJS+= pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o
603
OBJS+= ppc440.o ppc440_bamboo.o
604
# PowerPC E500 boards
605
OBJS+= ppce500_pci.o ppce500_mpc8544ds.o
606
ifdef FDT_LIBS
607
OBJS+= device_tree.o
608
LIBS+= $(FDT_LIBS)
609
endif
610
ifdef CONFIG_KVM
611
OBJS+= kvm_ppc.o
612
endif
613
endif
614
ifeq ($(TARGET_BASE_ARCH), mips)
615
OBJS+= mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
616
OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o
617
OBJS+= g364fb.o jazz_led.o
618
OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o
619
OBJS+= piix_pci.o parallel.o cirrus_vga.o pcspk.o $(SOUND_HW)
620
OBJS+= mipsnet.o
621
OBJS+= pflash_cfi01.o
622
OBJS+= vmware_vga.o
623
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
624
endif
625
ifeq ($(TARGET_BASE_ARCH), cris)
626
# Boards
627
OBJS+= etraxfs.o axis_dev88.o
628

    
629
# IO blocks
630
OBJS+= etraxfs_dma.o
631
OBJS+= etraxfs_pic.o
632
OBJS+= etraxfs_eth.o
633
OBJS+= etraxfs_timer.o
634
OBJS+= etraxfs_ser.o
635

    
636
OBJS+= ptimer.o
637
OBJS+= pflash_cfi02.o nand.o
638
endif
639
ifeq ($(TARGET_BASE_ARCH), sparc)
640
ifeq ($(TARGET_ARCH), sparc64)
641
OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
642
OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
643
OBJS+= cirrus_vga.o parallel.o ptimer.o
644
else
645
OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
646
OBJS+= slavio_timer.o escc.o slavio_misc.o fdc.o sparc32_dma.o
647
OBJS+= cs4231.o ptimer.o eccmemctl.o sbi.o sun4c_intctl.o
648
endif
649
endif
650
ifeq ($(TARGET_BASE_ARCH), arm)
651
OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
652
OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o
653
OBJS+= versatile_pci.o ptimer.o
654
OBJS+= realview_gic.o realview.o arm_sysctl.o mpcore.o
655
OBJS+= armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o
656
OBJS+= pl061.o
657
OBJS+= arm-semi.o
658
OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o
659
OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o
660
OBJS+= pflash_cfi01.o gumstix.o
661
OBJS+= zaurus.o ide.o serial.o nand.o ecc.o spitz.o tosa.o tc6393xb.o
662
OBJS+= omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o
663
OBJS+= omap2.o omap_dss.o soc_dma.o
664
OBJS+= omap_sx1.o palm.o tsc210x.o
665
OBJS+= nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o
666
OBJS+= tsc2005.o bt-hci-csr.o
667
OBJS+= mst_fpga.o mainstone.o
668
OBJS+= musicpal.o pflash_cfi02.o
669
OBJS+= framebuffer.o
670
CPPFLAGS += -DHAS_AUDIO
671
endif
672
ifeq ($(TARGET_BASE_ARCH), sh4)
673
OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
674
OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o
675
OBJS+= ide.o
676
endif
677
ifeq ($(TARGET_BASE_ARCH), m68k)
678
OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o
679
OBJS+= m68k-semi.o dummy_m68k.o
680
endif
681
ifdef CONFIG_GDBSTUB
682
OBJS+=gdbstub.o gdbstub-xml.o
683
endif
684
ifdef CONFIG_COCOA
685
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
686
ifdef CONFIG_COREAUDIO
687
COCOA_LIBS+=-framework CoreAudio
688
endif
689
endif
690
ifdef CONFIG_SLIRP
691
CPPFLAGS+=-I$(SRC_PATH)/slirp
692
endif
693

    
694
LIBS+=$(AIOLIBS)
695
# specific flags are needed for non soft mmu emulator
696
ifdef CONFIG_STATIC
697
LDFLAGS+=-static
698
endif
699
ifndef CONFIG_DARWIN
700
ifndef CONFIG_WIN32
701
ifndef CONFIG_SOLARIS
702
ifndef CONFIG_AIX
703
LIBS+=-lutil
704
endif
705
endif
706
endif
707
endif
708
ifdef TARGET_GPROF
709
vl.o: CFLAGS+=-p
710
LDFLAGS+=-p
711
endif
712

    
713
ifeq ($(ARCH),ia64)
714
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
715
endif
716

    
717
ifdef CONFIG_WIN32
718
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
719
endif
720

    
721
# profiling code
722
ifdef TARGET_GPROF
723
LDFLAGS+=-p
724
main.o: CFLAGS+=-p
725
endif
726

    
727
vl.o: qemu-options.h
728

    
729
$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
730

    
731
$(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
732
	$(LINK)
733

    
734
endif # !CONFIG_USER_ONLY
735

    
736
gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh
737
ifeq ($(TARGET_XML_FILES),)
738
	$(call quiet-command,rm -f $@ && echo > $@,"  GEN   $(TARGET_DIR)$@")
739
else
740
	$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
741
endif
742

    
743
qemu-options.h: $(SRC_PATH)/qemu-options.hx
744
	sh $(SRC_PATH)/hxtool -h < $< > $@
745

    
746
clean:
747
	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o qemu-options.h
748
	rm -f *.d */*.d tcg/*.o
749

    
750
install: all
751
ifneq ($(PROGS),)
752
	$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
753
endif
754

    
755
# Include automatically generated dependency files
756
-include $(wildcard *.d */*.d)