ia64/xen-unstable

view tools/ioemu/Makefile.target @ 15804:3805cc382dbe

qemu: Remove mapcache lock - we no longer have multiple threads in core qemu code.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Aug 30 15:35:10 2007 +0100 (2007-08-30)
parents 00618037d37d
children acfa9290746f
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/xenstore
21 ifdef CONFIG_DARWIN_USER
22 VPATH+=:$(SRC_PATH)/darwin-user
23 CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
24 endif
25 ifdef CONFIG_LINUX_USER
26 VPATH+=:$(SRC_PATH)/linux-user
27 CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
28 endif
29 BASE_CFLAGS=
30 BASE_LDFLAGS=
31 SSE2 := $(call cc-option,$(CC),-msse2,)
32 ifeq ($(SSE2),-msse2)
33 CFLAGS += -DUSE_SSE2=1 -msse2
34 endif
35 #CFLAGS+=-Werror
36 LIBS=
37 HELPER_CFLAGS=$(CFLAGS)
38 DYNGEN=../dyngen$(EXESUF)
39 # user emulator name
40 TARGET_ARCH2=$(TARGET_ARCH)
41 ifeq ($(TARGET_ARCH),arm)
42 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
43 TARGET_ARCH2=armeb
44 endif
45 endif
46 ifeq ($(TARGET_ARCH),sh4)
47 ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
48 TARGET_ARCH2=sh4eb
49 endif
50 endif
51 ifeq ($(TARGET_ARCH),mips)
52 ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
53 TARGET_ARCH2=mipsel
54 endif
55 endif
56 QEMU_USER=qemu-$(TARGET_ARCH2)
57 # system emulator name
58 ifdef CONFIG_SOFTMMU
59 ifeq ($(TARGET_ARCH), i386)
60 QEMU_SYSTEM=qemu$(EXESUF)
61 else
62 QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
63 endif
64 else
65 QEMU_SYSTEM=qemu-fast
66 endif
68 QEMU_SYSTEM=qemu-dm
70 ifdef CONFIG_USER_ONLY
71 PROGS=$(QEMU_USER)
72 else
73 PROGS+=$(QEMU_SYSTEM)
74 ifndef CONFIG_SOFTMMU
75 CONFIG_STATIC=y
76 endif
77 endif # !CONFIG_USER_ONLY
79 ifdef CONFIG_STATIC
80 BASE_LDFLAGS+=-static
81 endif
83 # We require -O2 to avoid the stack setup prologue in EXIT_TB
84 OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
86 ifeq ($(ARCH),i386)
87 HELPER_CFLAGS+=-fomit-frame-pointer
88 OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
89 ifeq ($(HAVE_GCC3_OPTIONS),yes)
90 OP_CFLAGS+= -falign-functions=0 -fno-gcse
91 else
92 OP_CFLAGS+= -malign-functions=0
93 endif
94 ifdef TARGET_GPROF
95 USE_I386_LD=y
96 endif
97 ifdef CONFIG_STATIC
98 USE_I386_LD=y
99 endif
100 ifdef USE_I386_LD
101 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
102 else
103 ifdef CONFIG_LINUX_USER
104 # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
105 # that the kernel ELF loader considers as an executable. I think this
106 # is the simplest way to make it self virtualizable!
107 BASE_LDFLAGS+=-Wl,-shared
108 endif
109 endif
110 endif
112 ifeq ($(ARCH),x86_64)
113 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
114 endif
116 ifeq ($(ARCH),ppc)
117 CPPFLAGS+= -D__powerpc__
118 ifdef CONFIG_LINUX_USER
119 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
120 endif
121 endif
123 ifeq ($(ARCH),s390)
124 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
125 endif
127 ifeq ($(ARCH),sparc)
128 ifeq ($(CONFIG_SOLARIS),yes)
129 BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
130 BASE_LDFLAGS+=-m32
131 OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
132 else
133 BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
134 BASE_LDFLAGS+=-m32
135 OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
136 HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
137 # -static is used to avoid g1/g3 usage by the dynamic linker
138 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
139 endif
140 endif
142 ifeq ($(ARCH),sparc64)
143 BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
144 BASE_LDFLAGS+=-m64
145 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
146 OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0
147 endif
149 ifeq ($(ARCH),alpha)
150 # -msmall-data is not used for OP_CFLAGS because we want two-instruction
151 # relocations for the constant constructions
152 # Ensure there's only a single GP
153 BASE_CFLAGS+=-msmall-data
154 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
155 endif
157 ifeq ($(ARCH),ia64)
158 BASE_CFLAGS+=-mno-sdata
159 OP_CFLAGS+=-mno-sdata
160 BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
161 endif
163 ifeq ($(ARCH),arm)
164 OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
165 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
166 endif
168 ifeq ($(ARCH),m68k)
169 OP_CFLAGS+=-fomit-frame-pointer
170 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
171 endif
173 ifeq ($(ARCH),mips)
174 BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
175 endif
177 ifeq ($(HAVE_GCC3_OPTIONS),yes)
178 # very important to generate a return at the end of every operation
179 OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
180 endif
182 ifeq ($(CONFIG_DARWIN),yes)
183 LIBS+=-lmx
184 endif
186 ifdef CONFIG_DARWIN_USER
187 # Leave some space for the regular program loading zone
188 BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000
189 endif
191 OP_CFLAGS+=$(OS_CFLAGS)
193 #########################################################
195 CPPFLAGS+=-D_GNU_SOURCE
196 # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
197 LIBS+=-lm
198 LIBS+=-L../../libxc -lxenctrl -lxenguest
199 LIBS+=-L../../xenstore -lxenstore
200 ifndef CONFIG_USER_ONLY
201 LIBS+=-lz
202 endif
203 ifdef CONFIG_WIN32
204 LIBS+=-lwinmm -lws2_32 -liphlpapi
205 endif
206 ifdef CONFIG_SOLARIS
207 LIBS+=-lsocket -lnsl -lresolv
208 endif
210 # profiling code
211 ifdef TARGET_GPROF
212 BASE_LDFLAGS+=-p
213 main.o: BASE_CFLAGS+=-p
214 endif
216 ifdef CONFIG_LINUX_USER
217 OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
218 elfload.o linuxload.o
219 ifdef TARGET_HAS_BFLT
220 OBJS+= flatload.o
221 endif
223 ifeq ($(TARGET_ARCH), i386)
224 OBJS+= vm86.o
225 endif
226 ifeq ($(TARGET_ARCH), arm)
227 OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
228 nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
229 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
230 endif
231 ifeq ($(TARGET_ARCH), m68k)
232 OBJS+= m68k-sim.o m68k-semi.o
233 endif
234 endif #CONFIG_LINUX_USER
236 ifdef CONFIG_DARWIN_USER
237 OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
238 endif
240 SRCS:= $(OBJS:.o=.c)
241 OBJS+= libqemu.a
243 # cpu emulator library
244 LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
245 translate.o op.o
246 ifdef CONFIG_SOFTFLOAT
247 LIBOBJS+=fpu/softfloat.o
248 else
249 LIBOBJS+=fpu/softfloat-native.o
250 endif
251 CPPFLAGS+=-I$(SRC_PATH)/fpu
253 ifeq ($(TARGET_ARCH), i386)
254 LIBOBJS+=helper.o helper2.o
255 ifeq ($(ARCH), i386)
256 LIBOBJS+=translate-copy.o
257 endif
258 endif
260 ifeq ($(TARGET_ARCH), x86_64)
261 LIBOBJS+=helper.o helper2.o
262 endif
264 ifeq ($(TARGET_BASE_ARCH), ppc)
265 LIBOBJS+= op_helper.o helper.o
266 endif
268 ifeq ($(TARGET_ARCH), mips)
269 LIBOBJS+= op_helper.o helper.o
270 endif
272 ifeq ($(TARGET_BASE_ARCH), sparc)
273 LIBOBJS+= op_helper.o helper.o
274 endif
276 ifeq ($(TARGET_BASE_ARCH), arm)
277 LIBOBJS+= op_helper.o helper.o
278 endif
280 ifeq ($(TARGET_BASE_ARCH), sh4)
281 LIBOBJS+= op_helper.o helper.o
282 endif
284 ifeq ($(TARGET_BASE_ARCH), m68k)
285 LIBOBJS+= helper.o
286 endif
288 # NOTE: the disassembler code is only needed for debugging
289 LIBOBJS+=disas.o
290 ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
291 USE_I386_DIS=y
292 endif
293 ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
294 USE_I386_DIS=y
295 endif
296 ifdef USE_I386_DIS
297 LIBOBJS+=i386-dis.o
298 endif
299 ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
300 LIBOBJS+=alpha-dis.o
301 endif
302 ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
303 LIBOBJS+=ppc-dis.o
304 endif
305 ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips)
306 LIBOBJS+=mips-dis.o
307 endif
308 ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
309 LIBOBJS+=sparc-dis.o
310 endif
311 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
312 LIBOBJS+=arm-dis.o
313 endif
314 ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
315 LIBOBJS+=m68k-dis.o
316 endif
317 ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
318 LIBOBJS+=sh4-dis.o
319 endif
321 ifdef CONFIG_GDBSTUB
322 OBJS+=gdbstub.o
323 endif
325 # qemu-dm objects
326 ifeq ($(ARCH),ia64)
327 LIBOBJS=helper2.o exec-dm.o i8259-dm.o piix_pci-dm.o
328 else
329 LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o piix_pci-dm.o
330 endif
332 all: $(PROGS)
334 $(QEMU_USER): $(OBJS)
335 $(CC) $(CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS)
336 ifeq ($(ARCH),alpha)
337 # Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
338 # the address space (31 bit so sign extending doesn't matter)
339 echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
340 endif
342 # must use static linking to avoid leaving stuff in virtual address space
343 VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o isa_mmio.o
344 VL_OBJS+=cutils.o
345 VL_OBJS+=block.o block-raw.o
346 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
347 ifdef CONFIG_WIN32
348 VL_OBJS+=tap-win32.o
349 endif
351 SOUND_HW = sb16.o es1370.o
352 AUDIODRV = audio.o noaudio.o wavaudio.o
353 ifdef CONFIG_SDL
354 AUDIODRV += sdlaudio.o
355 endif
356 ifdef CONFIG_OSS
357 AUDIODRV += ossaudio.o
358 endif
359 ifdef CONFIG_COREAUDIO
360 AUDIODRV += coreaudio.o
361 endif
362 ifdef CONFIG_ALSA
363 AUDIODRV += alsaaudio.o
364 LIBS += -lasound
365 endif
366 ifdef CONFIG_DSOUND
367 AUDIODRV += dsoundaudio.o
368 LIBS += -lole32 -ldxguid
369 endif
370 ifdef CONFIG_FMOD
371 AUDIODRV += fmodaudio.o
372 audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
373 LIBS += $(CONFIG_FMOD_LIB)
374 endif
375 ifdef CONFIG_ADLIB
376 SOUND_HW += fmopl.o adlib.o
377 endif
378 AUDIODRV+= wavcapture.o
380 # SCSI layer
381 VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
383 # USB layer
384 VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
386 # PCI network cards
387 VL_OBJS+= ne2000.o rtl8139.o pcnet.o
389 ifeq ($(TARGET_BASE_ARCH), i386)
390 # Hardware support
391 VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
392 ifeq ($(ARCH),ia64)
393 VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o
394 else
395 VL_OBJS+= fdc.o serial.o pc.o
396 endif
397 VL_OBJS+= cirrus_vga.o mixeng.o parallel.o acpi.o
398 VL_OBJS+= usb-uhci.o smbus_eeprom.o
399 VL_OBJS+= piix4acpi.o
400 VL_OBJS+= xenstore.o
401 VL_OBJS+= xen_platform.o
402 VL_OBJS+= tpm_tis.o
403 CPPFLAGS += -DHAS_AUDIO
404 endif
405 ifeq ($(TARGET_BASE_ARCH), ppc)
406 VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
407 VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
408 VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
409 VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
410 CPPFLAGS += -DHAS_AUDIO
411 endif
412 ifeq ($(TARGET_ARCH), mips)
413 VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o
414 VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o
415 VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV)
416 DEFINES += -DHAS_AUDIO
417 endif
418 ifeq ($(TARGET_BASE_ARCH), sparc)
419 ifeq ($(TARGET_ARCH), sparc64)
420 VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
421 VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
422 VL_OBJS+= cirrus_vga.o parallel.o
423 else
424 VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
425 VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
426 VL_OBJS+= cs4231.o
427 endif
428 endif
429 ifeq ($(TARGET_BASE_ARCH), arm)
430 VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
431 VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o
432 VL_OBJS+= versatile_pci.o
433 VL_OBJS+= arm_gic.o realview.o arm_sysctl.o
434 VL_OBJS+= arm-semi.o
435 endif
436 ifeq ($(TARGET_BASE_ARCH), sh4)
437 VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o
438 endif
439 ifdef CONFIG_GDBSTUB
440 VL_OBJS+=gdbstub.o
441 endif
442 ifdef CONFIG_SDL
443 VL_OBJS+=sdl.o x_keymap.o
444 endif
445 VL_OBJS+=vnc.o
446 VL_OBJS+=d3des.o
447 ifdef CONFIG_COCOA
448 VL_OBJS+=cocoa.o
449 COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
450 ifdef CONFIG_COREAUDIO
451 COCOA_LIBS+=-framework CoreAudio
452 endif
453 endif
454 ifdef CONFIG_SLIRP
455 CPPFLAGS+=-I$(SRC_PATH)/slirp
456 SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
457 slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
458 tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
459 VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
460 endif
462 VL_LDFLAGS=
463 # specific flags are needed for non soft mmu emulator
464 ifdef CONFIG_STATIC
465 VL_LDFLAGS+=-static
466 endif
467 ifndef CONFIG_SOFTMMU
468 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld
469 endif
470 ifndef CONFIG_DARWIN
471 ifndef CONFIG_WIN32
472 ifndef CONFIG_SOLARIS
473 VL_LIBS=-lutil -lrt
474 endif
475 endif
476 endif
477 ifdef TARGET_GPROF
478 vl.o: BASE_CFLAGS+=-p
479 VL_LDFLAGS+=-p
480 endif
482 ifeq ($(ARCH),ia64)
483 VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld
484 endif
486 ifeq ($(ARCH),sparc64)
487 VL_LDFLAGS+=-m64
488 VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld
489 endif
491 ifdef CONFIG_WIN32
492 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
493 endif
495 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
496 $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
498 cocoa.o: cocoa.m
499 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
501 sdl.o: sdl.c keymaps.c sdl_keysym.h
502 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
504 vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
505 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
507 d3des.o: d3des.c d3des.h
508 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
510 sdlaudio.o: sdlaudio.c
511 $(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
513 depend: $(SRCS)
514 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
516 vldepend: $(VL_OBJS:.o=.c)
517 $(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
519 # libqemu
521 libqemu.a: $(LIBOBJS)
522 rm -f $@
523 $(AR) rcs $@ $(LIBOBJS)
525 translate.o: translate.c gen-op.h opc.h cpu.h
527 translate-all.o: translate-all.c opc.h cpu.h
529 translate-op.o: translate-all.c op.h opc.h cpu.h
531 op.h: op.o $(DYNGEN)
532 $(DYNGEN) -o $@ $<
534 opc.h: op.o $(DYNGEN)
535 $(DYNGEN) -c -o $@ $<
537 gen-op.h: op.o $(DYNGEN)
538 $(DYNGEN) -g -o $@ $<
540 op.o: op.c
541 $(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
543 # HELPER_CFLAGS is used for all the code compiled with static register
544 # variables
545 ifeq ($(TARGET_BASE_ARCH), i386)
546 # XXX: rename helper.c to op_helper.c
547 helper.o: helper.c
548 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
549 else
550 op_helper.o: op_helper.c
551 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
552 endif
554 cpu-exec.o: cpu-exec.c
555 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
557 # Note: this is a workaround. The real fix is to avoid compiling
558 # cpu_signal_handler() in cpu-exec.c.
559 signal.o: signal.c
560 $(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
562 ifeq ($(TARGET_BASE_ARCH), i386)
563 op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
564 endif
566 ifeq ($(TARGET_ARCH), arm)
567 op.o: op.c op_template.h
568 pl110.o: pl110_template.h
569 endif
571 ifeq ($(TARGET_BASE_ARCH), sparc)
572 op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h
573 magic_load.o: elf_op.h
574 endif
576 ifeq ($(TARGET_BASE_ARCH), ppc)
577 op.o: op.c op_template.h op_mem.h
578 op_helper.o: op_helper_mem.h
579 translate.o: translate.c translate_init.c
580 endif
582 ifeq ($(TARGET_ARCH), mips)
583 op.o: op.c op_template.c fop_template.c op_mem.c
584 op_helper.o: op_helper_mem.c
585 endif
587 loader.o: loader.c elf_ops.h
589 ifeq ($(TARGET_ARCH), sh4)
590 op.o: op.c op_mem.c cpu.h
591 op_helper.o: op_helper.c exec.h cpu.h
592 helper.o: helper.c exec.h cpu.h
593 sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h
594 shix.o: shix.c sh7750_regs.h sh7750_regnames.h
595 sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h
596 tc58128.o: tc58128.c
597 endif
599 $(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
601 %.o: %.c
602 $(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
604 %.o: %.S
605 $(CC) $(CPPFLAGS) -c -o $@ $<
607 clean:
608 rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
610 distclean: clean
611 rm -rf config.mak config.h
613 install: all
614 mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)"
615 ifneq ($(PROGS),)
616 $(INSTALL_PROG) $(PROGS) "$(DESTDIR)$(bindir)"
617 endif
618 $(INSTALL_PROG) $(TARGET_PATH)/qemu-dm.debug "$(DESTDIR)$(bindir)"
619 $(INSTALL_PROG) $(TARGET_PATH)/qemu-ifup "$(DESTDIR)$(configdir)"
621 ifneq ($(wildcard .depend),)
622 include .depend
623 endif
625 ifeq (1, 0)
626 audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
627 fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
628 CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
629 endif