ia64/xen-unstable

view tools/ioemu/Makefile.target @ 16894:b9004e222fde

Move generation of public header hierarchy into the tools.

This patch merges the two versions of public header generation
currently used in the build into one.

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