ia64/xen-unstable

view tools/ioemu/Makefile.target @ 17246:0f204e41cc93

stubdom: disable xen_blktap

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 18 13:13:31 2008 +0000 (2008-03-18)
parents f07a7ba63885
children ad55c06c9bbc
line source
1 include config.mak
3 XEN_ROOT=../../..
4 include $(XEN_ROOT)/tools/Rules.mk
6 TARGET_BASE_ARCH:=$(TARGET_ARCH)
7 ifeq ($(TARGET_ARCH), x86_64)
8 TARGET_BASE_ARCH:=i386
9 endif
10 ifeq ($(TARGET_ARCH), ppc64)
11 TARGET_BASE_ARCH:=ppc
12 endif
13 ifeq ($(TARGET_ARCH), sparc64)
14 TARGET_BASE_ARCH:=sparc
15 endif
16 TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)$(TARGET_SUB)
17 VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
18 CPPFLAGS+=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
19 CPPFLAGS+= -I$(XEN_ROOT)/tools/libxc
20 CPPFLAGS+= -I$(XEN_ROOT)/tools/blktap/lib
21 CPPFLAGS+= -I$(XEN_ROOT)/tools/xenstore
22 CPPFLAGS+= -I$(XEN_ROOT)/tools/include
23 ifdef CONFIG_DARWIN_USER
24 VPATH+=:$(SRC_PATH)/darwin-user
25 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
26 endif
27 ifdef CONFIG_LINUX_USER
28 VPATH+=:$(SRC_PATH)/linux-user
29 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
30 endif
31 BASE_CFLAGS=
32 BASE_LDFLAGS=
33 SSE2 := $(call cc-option,$(CC),-msse2,)
34 ifeq ($(SSE2),-msse2)
35 CFLAGS += -DUSE_SSE2=1 -msse2
36 endif
37 #CFLAGS+=-Werror
38 LIBS=
39 HELPER_CFLAGS=$(CFLAGS)
40 DYNGEN=../dyngen$(EXESUF)
41 # user emulator name
42 TARGET_ARCH2=$(TARGET_ARCH)
43 ifeq ($(TARGET_ARCH),arm)
44 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
45 TARGET_ARCH2=armeb
46 endif
47 endif
48 ifeq ($(TARGET_ARCH),sh4)
49 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
50 TARGET_ARCH2=sh4eb
51 endif
52 endif
53 ifeq ($(TARGET_ARCH),mips)
54 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
55 TARGET_ARCH2=mipsel
56 endif
57 endif
58 QEMU_USER=qemu-$(TARGET_ARCH2)
59 # system emulator name
60 ifdef CONFIG_SOFTMMU
61 ifeq ($(TARGET_ARCH), i386)
62 QEMU_SYSTEM=qemu$(EXESUF)
63 else
64 QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
65 endif
66 else
67 QEMU_SYSTEM=qemu-fast
68 endif
70 ifdef CONFIG_STUBDOM
71 QEMU_SYSTEM=qemu.a
72 else
73 QEMU_SYSTEM=qemu-dm
74 endif
76 ifdef CONFIG_USER_ONLY
77 PROGS=$(QEMU_USER)
78 else
79 PROGS+=$(QEMU_SYSTEM)
80 ifndef CONFIG_SOFTMMU
81 CONFIG_STATIC=y
82 endif
83 endif # !CONFIG_USER_ONLY
85 ifdef CONFIG_STATIC
86 BASE_LDFLAGS+=-static
87 endif
89 # We require -O2 to avoid the stack setup prologue in EXIT_TB
90 OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
92 ifeq ($(ARCH),i386)
93 HELPER_CFLAGS+=-fomit-frame-pointer
94 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
95 ifeq ($(HAVE_GCC3_OPTIONS),yes)
96 OP_CFLAGS+= -falign-functions=0 -fno-gcse
97 else
98 OP_CFLAGS+= -malign-functions=0
99 endif
100 ifdef TARGET_GPROF
101 USE_I386_LD=y
102 endif
103 ifdef CONFIG_STATIC
104 USE_I386_LD=y
105 endif
106 ifdef USE_I386_LD
107 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
108 else
109 ifdef CONFIG_LINUX_USER
110 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
111 # that the kernel ELF loader considers as an executable. I think this
112 # is the simplest way to make it self virtualizable!
113 BASE_LDFLAGS+=-Wl,-shared
114 endif
115 endif
116 endif
118 ifeq ($(ARCH),x86_64)
119 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
120 endif
122 ifeq ($(ARCH),ppc)
123 CPPFLAGS+= -D__powerpc__
124 ifdef CONFIG_LINUX_USER
125 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
126 endif
127 endif
129 ifeq ($(ARCH),s390)
130 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
131 endif
133 ifeq ($(ARCH),sparc)
134 ifeq ($(CONFIG_SOLARIS),yes)
135 BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
136 BASE_LDFLAGS+=-m32
137 OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
138 else
139 BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
140 BASE_LDFLAGS+=-m32
141 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
142 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
143 # -static is used to avoid g1/g3 usage by the dynamic linker
144 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
145 endif
146 endif
148 ifeq ($(ARCH),sparc64)
149 BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
150 BASE_LDFLAGS+=-m64
151 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
152 OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0
153 endif
155 ifeq ($(ARCH),alpha)
156 # -msmall-data is not used for OP_CFLAGS because we want two-instruction
157 # relocations for the constant constructions
158 # Ensure there's only a single GP
159 BASE_CFLAGS+=-msmall-data
160 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
161 endif
163 ifeq ($(ARCH),ia64)
164 BASE_CFLAGS+=-mno-sdata
165 OP_CFLAGS+=-mno-sdata
166 BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
167 endif
169 ifeq ($(ARCH),arm)
170 OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
171 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
172 endif
174 ifeq ($(ARCH),m68k)
175 OP_CFLAGS+=-fomit-frame-pointer
176 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
177 endif
179 ifeq ($(ARCH),mips)
180 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
181 endif
183 ifeq ($(HAVE_GCC3_OPTIONS),yes)
184 # very important to generate a return at the end of every operation
185 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
186 endif
188 ifeq ($(CONFIG_DARWIN),yes)
189 LIBS+=-lmx
190 endif
192 ifdef CONFIG_DARWIN_USER
193 # Leave some space for the regular program loading zone
194 BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
195 endif
197 OP_CFLAGS+=$(OS_CFLAGS)
199 #########################################################
201 CPPFLAGS+=-D_GNU_SOURCE
202 # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
203 LIBS+=-lm
204 LIBS+=-L../../libxc -lxenctrl -lxenguest
205 LIBS+=-L../../xenstore -lxenstore
206 ifndef CONFIG_USER_ONLY
207 LIBS+=-lz
208 endif
209 ifdef CONFIG_WIN32
210 LIBS+=-lwinmm -lws2_32 -liphlpapi
211 endif
212 ifdef CONFIG_SOLARIS
213 LIBS+=-lsocket -lnsl -lresolv
214 endif
216 # profiling code
217 ifdef TARGET_GPROF
218 BASE_LDFLAGS+=-p
219 main.o: BASE_CFLAGS+=-p
220 endif
222 ifdef CONFIG_LINUX_USER
223 OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
224 elfload.o linuxload.o
225 ifdef TARGET_HAS_BFLT
226 OBJS+= flatload.o
227 endif
229 ifeq ($(TARGET_ARCH), i386)
230 OBJS+= vm86.o
231 endif
232 ifeq ($(TARGET_ARCH), arm)
233 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
234 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
235 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
236 endif
237 ifeq ($(TARGET_ARCH), m68k)
238 OBJS+= m68k-sim.o m68k-semi.o
239 endif
240 endif #CONFIG_LINUX_USER
242 ifdef CONFIG_DARWIN_USER
243 OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
244 endif
246 SRCS:= $(OBJS:.o=.c)
247 OBJS+= libqemu.a
249 # cpu emulator library
250 LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
251 translate.o op.o
252 ifdef CONFIG_SOFTFLOAT
253 LIBOBJS+=fpu/softfloat.o
254 else
255 LIBOBJS+=fpu/softfloat-native.o
256 endif
257 CPPFLAGS+=-I$(SRC_PATH)/fpu
259 ifeq ($(TARGET_ARCH), i386)
260 LIBOBJS+=helper.o helper2.o
261 ifeq ($(ARCH), i386)
262 LIBOBJS+=translate-copy.o
263 endif
264 endif
266 ifeq ($(TARGET_ARCH), x86_64)
267 LIBOBJS+=helper.o helper2.o
268 endif
270 ifeq ($(TARGET_BASE_ARCH), ppc)
271 LIBOBJS+= op_helper.o helper.o
272 endif
274 ifeq ($(TARGET_ARCH), mips)
275 LIBOBJS+= op_helper.o helper.o
276 endif
278 ifeq ($(TARGET_BASE_ARCH), sparc)
279 LIBOBJS+= op_helper.o helper.o
280 endif
282 ifeq ($(TARGET_BASE_ARCH), arm)
283 LIBOBJS+= op_helper.o helper.o
284 endif
286 ifeq ($(TARGET_BASE_ARCH), sh4)
287 LIBOBJS+= op_helper.o helper.o
288 endif
290 ifeq ($(TARGET_BASE_ARCH), m68k)
291 LIBOBJS+= helper.o
292 endif
294 # NOTE: the disassembler code is only needed for debugging
295 LIBOBJS+=disas.o
296 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
297 USE_I386_DIS=y
298 endif
299 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
300 USE_I386_DIS=y
301 endif
302 ifdef USE_I386_DIS
303 LIBOBJS+=i386-dis.o
304 endif
305 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
306 LIBOBJS+=alpha-dis.o
307 endif
308 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
309 LIBOBJS+=ppc-dis.o
310 endif
311 ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips)
312 LIBOBJS+=mips-dis.o
313 endif
314 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
315 LIBOBJS+=sparc-dis.o
316 endif
317 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
318 LIBOBJS+=arm-dis.o
319 endif
320 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
321 LIBOBJS+=m68k-dis.o
322 endif
323 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
324 LIBOBJS+=sh4-dis.o
325 endif
327 ifdef CONFIG_GDBSTUB
328 OBJS+=gdbstub.o
329 endif
331 # qemu-dm objects
332 ifeq ($(ARCH),ia64)
333 LIBOBJS=helper2.o exec-dm.o i8259-dm.o piix_pci-dm.o
334 else
335 LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o piix_pci-dm.o
336 endif
338 all: $(PROGS)
340 $(QEMU_USER): $(OBJS)
341 $(CC) $(CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS)
342 ifeq ($(ARCH),alpha)
343 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
344 # the address space (31 bit so sign extending doesn't matter)
345 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
346 endif
348 # must use static linking to avoid leaving stuff in virtual address space
349 VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o isa_mmio.o
350 VL_OBJS+=cutils.o
351 VL_OBJS+=block.o block-raw.o
352 VL_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o
353 ifdef CONFIG_STUBDOM
354 VL_OBJS+=block-vbd.o
355 endif
356 ifdef CONFIG_WIN32
357 VL_OBJS+=tap-win32.o
358 endif
360 ifdef CONFIG_STUBDOM
361 #CONFIG_PASSTHROUGH=1
362 else
363 ifeq (,$(wildcard /usr/include/pci))
364 $(warning *** pciutils-devl package not found - missing /usr/include/pci)
365 $(warning *** PCI passthrough capability has been disabled)
366 else
367 CONFIG_PASSTHROUGH=1
368 endif
369 endif
371 ifdef CONFIG_PASSTHROUGH
372 LIBS+=-lpci
373 VL_OBJS+= pass-through.o
374 CFLAGS += -DCONFIG_PASSTHROUGH
375 $(info *** PCI passthrough capability has been enabled ***)
376 endif
378 SOUND_HW = sb16.o es1370.o
379 AUDIODRV = audio.o noaudio.o wavaudio.o
380 ifdef CONFIG_SDL
381 AUDIODRV += sdlaudio.o
382 endif
383 ifdef CONFIG_OSS
384 AUDIODRV += ossaudio.o
385 endif
386 ifdef CONFIG_COREAUDIO
387 AUDIODRV += coreaudio.o
388 endif
389 ifdef CONFIG_ALSA
390 AUDIODRV += alsaaudio.o
391 LIBS += -lasound
392 endif
393 ifdef CONFIG_DSOUND
394 AUDIODRV += dsoundaudio.o
395 LIBS += -lole32 -ldxguid
396 endif
397 ifdef CONFIG_FMOD
398 AUDIODRV += fmodaudio.o
399 audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
400 LIBS += $(CONFIG_FMOD_LIB)
401 endif
402 ifdef CONFIG_ADLIB
403 SOUND_HW += fmopl.o adlib.o
404 endif
405 AUDIODRV+= wavcapture.o
407 ifdef CONFIG_VNC_TLS
408 CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS)
409 LIBS += $(CONFIG_VNC_TLS_LIBS)
410 endif
412 # SCSI layer
413 VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
415 # USB layer
416 VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
418 # PCI network cards
419 VL_OBJS+= ne2000.o rtl8139.o pcnet.o e100.o e1000.o
421 ifeq ($(TARGET_BASE_ARCH), i386)
422 # Hardware support
423 VL_OBJS+= ide.o pckbd.o ps2.o vga.o dma.o extboot.o
424 ifeq ($(ARCH),ia64)
425 VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o
426 else
427 VL_OBJS+= fdc.o serial.o pc.o
428 endif
429 VL_OBJS+= cirrus_vga.o parallel.o acpi.o
430 VL_OBJS+= usb-uhci.o smbus_eeprom.o
431 VL_OBJS+= piix4acpi.o
432 VL_OBJS+= xenstore.o
433 ifndef CONFIG_STUBDOM
434 VL_OBJS+= xen_blktap.o
435 endif
436 VL_OBJS+= xen_platform.o
437 VL_OBJS+= xen_machine_fv.o
438 VL_OBJS+= xen_machine_pv.o
439 VL_OBJS+= xenfb.o
440 VL_OBJS+= xen_console.o
441 ifndef CONFIG_STUBDOM
442 VL_OBJS+= tpm_tis.o
443 VL_OBJS+= $(SOUND_HW) $(AUDIODRV) mixeng.o
444 CPPFLAGS += -DHAS_TPM
445 CPPFLAGS += -DHAS_AUDIO
446 endif
447 endif
448 ifeq ($(TARGET_BASE_ARCH), ppc)
449 VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o dma.o
450 VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
451 VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
452 VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
453 ifndef CONFIG_STUBDOM
454 VL_OBJS+= $(SOUND_HW) $(AUDIODRV)
455 CPPFLAGS += -DHAS_AUDIO
456 endif
457 endif
458 ifeq ($(TARGET_ARCH), mips)
459 VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
460 VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o
461 VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o
462 ifndef CONFIG_STUBDOM
463 VL_OBJS+= $(SOUND_HW) $(AUDIODRV)
464 DEFINES += -DHAS_AUDIO
465 endif
466 endif
467 ifeq ($(TARGET_BASE_ARCH), sparc)
468 ifeq ($(TARGET_ARCH), sparc64)
469 VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
470 VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
471 VL_OBJS+= cirrus_vga.o parallel.o
472 else
473 VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
474 VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
475 VL_OBJS+= cs4231.o
476 endif
477 endif
478 ifeq ($(TARGET_BASE_ARCH), arm)
479 VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
480 VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o
481 VL_OBJS+= versatile_pci.o
482 VL_OBJS+= arm_gic.o realview.o arm_sysctl.o
483 VL_OBJS+= arm-semi.o
484 endif
485 ifeq ($(TARGET_BASE_ARCH), sh4)
486 VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o
487 endif
488 ifdef CONFIG_GDBSTUB
489 VL_OBJS+=gdbstub.o
490 endif
491 ifdef CONFIG_SDL
492 VL_OBJS+=sdl.o x_keymap.o
493 endif
494 VL_OBJS+=vnc.o d3des.o
495 ifdef CONFIG_COCOA
496 VL_OBJS+=cocoa.o
497 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
498 ifdef CONFIG_COREAUDIO
499 COCOA_LIBS+=-framework CoreAudio
500 endif
501 endif
502 ifdef CONFIG_SLIRP
503 CPPFLAGS+=-I$(SRC_PATH)/slirp
504 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
505 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
506 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
507 VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
508 endif
510 VL_LDFLAGS=
511 # specific flags are needed for non soft mmu emulator
512 ifdef CONFIG_STATIC
513 VL_LDFLAGS+=-static
514 endif
515 ifndef CONFIG_SOFTMMU
516 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
517 endif
518 ifndef CONFIG_DARWIN
519 ifndef CONFIG_WIN32
520 ifndef CONFIG_SOLARIS
521 VL_LIBS=-lutil -lrt
522 endif
523 endif
524 endif
525 ifdef TARGET_GPROF
526 vl.o: BASE_CFLAGS+=-p
527 VL_LDFLAGS+=-p
528 endif
530 ifeq ($(ARCH),sparc64)
531 VL_LDFLAGS+=-m64
532 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld
533 endif
535 ifdef CONFIG_WIN32
536 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
537 endif
539 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
540 ifdef CONFIG_STUBDOM
541 $(AR) rcs $@ $(VL_OBJS)
542 else
543 $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
544 endif
546 cocoa.o: cocoa.m
547 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
549 sdl.o: sdl.c keymaps.c sdl_keysym.h
550 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
552 vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h
553 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
555 sdlaudio.o: sdlaudio.c
556 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
558 depend: $(SRCS)
559 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
561 vldepend: $(VL_OBJS:.o=.c)
562 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
564 # libqemu
566 libqemu.a: $(LIBOBJS)
567 rm -f $@
568 $(AR) rcs $@ $(LIBOBJS)
570 translate.o: translate.c gen-op.h opc.h cpu.h
572 translate-all.o: translate-all.c opc.h cpu.h
574 translate-op.o: translate-all.c op.h opc.h cpu.h
576 op.h: op.o $(DYNGEN)
577 $(DYNGEN) -o $@ $<
579 opc.h: op.o $(DYNGEN)
580 $(DYNGEN) -c -o $@ $<
582 gen-op.h: op.o $(DYNGEN)
583 $(DYNGEN) -g -o $@ $<
585 op.o: op.c
586 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
588 # HELPER_CFLAGS is used for all the code compiled with static register
589 # variables
590 ifeq ($(TARGET_BASE_ARCH), i386)
591 # XXX: rename helper.c to op_helper.c
592 helper.o: helper.c
593 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
594 else
595 op_helper.o: op_helper.c
596 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
597 endif
599 cpu-exec.o: cpu-exec.c
600 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
602 # Note: this is a workaround. The real fix is to avoid compiling
603 # cpu_signal_handler() in cpu-exec.c.
604 signal.o: signal.c
605 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
607 ifeq ($(TARGET_BASE_ARCH), i386)
608 op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
609 endif
611 ifeq ($(TARGET_ARCH), arm)
612 op.o: op.c op_template.h
613 pl110.o: pl110_template.h
614 endif
616 ifeq ($(TARGET_BASE_ARCH), sparc)
617 op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h
618 magic_load.o: elf_op.h
619 endif
621 ifeq ($(TARGET_BASE_ARCH), ppc)
622 op.o: op.c op_template.h op_mem.h
623 op_helper.o: op_helper_mem.h
624 translate.o: translate.c translate_init.c
625 endif
627 ifeq ($(TARGET_ARCH), mips)
628 op.o: op.c op_template.c fop_template.c op_mem.c
629 op_helper.o: op_helper_mem.c
630 endif
632 loader.o: loader.c elf_ops.h
634 ifeq ($(TARGET_ARCH), sh4)
635 op.o: op.c op_mem.c cpu.h
636 op_helper.o: op_helper.c exec.h cpu.h
637 helper.o: helper.c exec.h cpu.h
638 sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h
639 shix.o: shix.c sh7750_regs.h sh7750_regnames.h
640 sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h
641 tc58128.o: tc58128.c
642 endif
644 $(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
646 %.o: %.c
647 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
649 %.o: %.S
650 $(CC) $(CPPFLAGS) -c -o $@ $<
652 clean:
653 rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
655 distclean: clean
656 rm -rf config.mak config.h
658 install: all
659 mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)"
660 ifneq ($(PROGS),)
661 $(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
662 endif
663 $(INSTALL_PROG) $(TARGET_PATH)/qemu-dm.debug "$(DESTDIR)$(bindir)"
664 $(INSTALL_PROG) $(TARGET_PATH)/qemu-ifup "$(DESTDIR)$(configdir)"
666 ifneq ($(wildcard .depend),)
667 include .depend
668 endif
670 ifeq (1, 0)
671 audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
672 fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
673 CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
674 endif