Statistics
| Branch: | Revision:

root / Makefile.target @ 57be54bb

History | View | Annotate | Download (14.1 kB)

1
include config.mak
2

    
3
TARGET_BASE_ARCH:=$(TARGET_ARCH)
4
ifeq ($(TARGET_ARCH), x86_64)
5
TARGET_BASE_ARCH:=i386
6
endif
7
ifeq ($(TARGET_ARCH), ppc64)
8
TARGET_BASE_ARCH:=ppc
9
endif
10
ifeq ($(TARGET_ARCH), sparc64)
11
TARGET_BASE_ARCH:=sparc
12
endif
13
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH)
14
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio
15
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH)
16
ifdef CONFIG_DARWIN_USER
17
VPATH+=:$(SRC_PATH)/darwin-user
18
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH)
19
endif
20
ifdef CONFIG_LINUX_USER
21
VPATH+=:$(SRC_PATH)/linux-user
22
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
23
endif
24
BASE_CFLAGS=
25
BASE_LDFLAGS=
26
#CFLAGS+=-Werror
27
LIBS=
28
HELPER_CFLAGS=$(CFLAGS)
29
DYNGEN=../dyngen$(EXESUF)
30
# user emulator name
31
TARGET_ARCH2=$(TARGET_ARCH)
32
ifeq ($(TARGET_ARCH),arm)
33
  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
34
    TARGET_ARCH2=armeb
35
  endif
36
endif
37
ifeq ($(TARGET_ARCH),sh4)
38
  ifeq ($(TARGET_WORDS_BIGENDIAN),yes)
39
    TARGET_ARCH2=sh4eb
40
  endif
41
endif
42
ifeq ($(TARGET_ARCH),mips)
43
  ifneq ($(TARGET_WORDS_BIGENDIAN),yes)
44
    TARGET_ARCH2=mipsel
45
  endif
46
endif
47
QEMU_USER=qemu-$(TARGET_ARCH2)
48
# system emulator name
49
ifdef CONFIG_SOFTMMU
50
ifeq ($(TARGET_ARCH), i386)
51
QEMU_SYSTEM=qemu$(EXESUF)
52
else
53
QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF)
54
endif
55
else
56
QEMU_SYSTEM=qemu-fast
57
endif
58

    
59
ifdef CONFIG_USER_ONLY
60
PROGS=$(QEMU_USER)
61
else
62
PROGS+=$(QEMU_SYSTEM)
63
ifndef CONFIG_SOFTMMU
64
CONFIG_STATIC=y
65
endif
66
endif # !CONFIG_USER_ONLY
67

    
68
ifdef CONFIG_STATIC
69
BASE_LDFLAGS+=-static
70
endif
71

    
72
# We require -O2 to avoid the stack setup prologue in EXIT_TB
73
OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing
74

    
75
ifeq ($(ARCH),i386)
76
HELPER_CFLAGS+=-fomit-frame-pointer
77
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer
78
ifeq ($(HAVE_GCC3_OPTIONS),yes)
79
OP_CFLAGS+= -falign-functions=0 -fno-gcse
80
else
81
OP_CFLAGS+= -malign-functions=0
82
endif
83
ifdef TARGET_GPROF
84
USE_I386_LD=y
85
endif
86
ifdef CONFIG_STATIC
87
USE_I386_LD=y
88
endif
89
ifdef USE_I386_LD
90
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
91
else
92
ifdef CONFIG_LINUX_USER
93
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
94
# that the kernel ELF loader considers as an executable. I think this
95
# is the simplest way to make it self virtualizable!
96
BASE_LDFLAGS+=-Wl,-shared
97
endif
98
endif
99
endif
100

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

    
105
ifeq ($(ARCH),ppc)
106
CPPFLAGS+= -D__powerpc__
107
ifdef CONFIG_LINUX_USER
108
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
109
endif
110
endif
111

    
112
ifeq ($(ARCH),s390)
113
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
114
endif
115

    
116
ifeq ($(ARCH),sparc)
117
ifeq ($(CONFIG_SOLARIS),yes)
118
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3
119
BASE_LDFLAGS+=-m32
120
OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0
121
else
122
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6
123
BASE_LDFLAGS+=-m32
124
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0
125
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat
126
# -static is used to avoid g1/g3 usage by the dynamic linker
127
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static
128
endif
129
endif
130

    
131
ifeq ($(ARCH),sparc64)
132
BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7
133
BASE_LDFLAGS+=-m64
134
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
135
OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0
136
endif
137

    
138
ifeq ($(ARCH),alpha)
139
# -msmall-data is not used for OP_CFLAGS because we want two-instruction
140
# relocations for the constant constructions
141
# Ensure there's only a single GP
142
BASE_CFLAGS+=-msmall-data
143
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
144
endif
145

    
146
ifeq ($(ARCH),ia64)
147
BASE_CFLAGS+=-mno-sdata
148
OP_CFLAGS+=-mno-sdata
149
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
150
endif
151

    
152
ifeq ($(ARCH),arm)
153
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer
154
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
155
endif
156

    
157
ifeq ($(ARCH),m68k)
158
OP_CFLAGS+=-fomit-frame-pointer
159
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
160
endif
161

    
162
ifeq ($(ARCH),mips)
163
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
164
endif
165

    
166
ifeq ($(HAVE_GCC3_OPTIONS),yes)
167
# very important to generate a return at the end of every operation
168
OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
169
endif
170

    
171
ifeq ($(CONFIG_DARWIN),yes)
172
LIBS+=-lmx
173
endif
174

    
175
OP_CFLAGS+=$(OS_CFLAGS)
176

    
177
#########################################################
178

    
179
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
180
LIBS+=-lm
181
ifndef CONFIG_USER_ONLY
182
LIBS+=-lz
183
endif
184
ifdef CONFIG_WIN32
185
LIBS+=-lwinmm -lws2_32 -liphlpapi
186
endif
187
ifdef CONFIG_SOLARIS
188
LIBS+=-lsocket -lnsl -lresolv
189
endif
190

    
191
# profiling code
192
ifdef TARGET_GPROF
193
BASE_LDFLAGS+=-p
194
main.o: BASE_CFLAGS+=-p
195
endif
196

    
197
ifdef CONFIG_LINUX_USER
198
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \
199
      elfload.o linuxload.o
200
ifdef TARGET_HAS_BFLT
201
OBJS+= flatload.o
202
endif
203

    
204
ifeq ($(TARGET_ARCH), i386)
205
OBJS+= vm86.o
206
endif
207
ifeq ($(TARGET_ARCH), arm)
208
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \
209
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \
210
 nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o
211
endif
212
ifeq ($(TARGET_ARCH), m68k)
213
OBJS+= m68k-sim.o m68k-semi.o
214
endif
215
endif #CONFIG_LINUX_USER
216

    
217
ifdef CONFIG_DARWIN_USER
218
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o
219
endif
220

    
221
SRCS:= $(OBJS:.o=.c)
222
OBJS+= libqemu.a
223

    
224
# cpu emulator library
225
LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\
226
        translate.o op.o 
227
ifdef CONFIG_SOFTFLOAT
228
LIBOBJS+=fpu/softfloat.o
229
else
230
LIBOBJS+=fpu/softfloat-native.o
231
endif
232
CPPFLAGS+=-I$(SRC_PATH)/fpu
233

    
234
ifeq ($(TARGET_ARCH), i386)
235
LIBOBJS+=helper.o helper2.o
236
ifeq ($(ARCH), i386)
237
LIBOBJS+=translate-copy.o
238
endif
239
endif
240

    
241
ifeq ($(TARGET_ARCH), x86_64)
242
LIBOBJS+=helper.o helper2.o
243
endif
244

    
245
ifeq ($(TARGET_BASE_ARCH), ppc)
246
LIBOBJS+= op_helper.o helper.o
247
endif
248

    
249
ifeq ($(TARGET_ARCH), mips)
250
LIBOBJS+= op_helper.o helper.o
251
endif
252

    
253
ifeq ($(TARGET_BASE_ARCH), sparc)
254
LIBOBJS+= op_helper.o helper.o
255
endif
256

    
257
ifeq ($(TARGET_BASE_ARCH), arm)
258
LIBOBJS+= op_helper.o helper.o
259
endif
260

    
261
ifeq ($(TARGET_BASE_ARCH), sh4)
262
LIBOBJS+= op_helper.o helper.o
263
endif
264

    
265
ifeq ($(TARGET_BASE_ARCH), m68k)
266
LIBOBJS+= helper.o
267
endif
268

    
269
# NOTE: the disassembler code is only needed for debugging
270
LIBOBJS+=disas.o 
271
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386)
272
USE_I386_DIS=y
273
endif
274
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64)
275
USE_I386_DIS=y
276
endif
277
ifdef USE_I386_DIS
278
LIBOBJS+=i386-dis.o
279
endif
280
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha)
281
LIBOBJS+=alpha-dis.o
282
endif
283
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc)
284
LIBOBJS+=ppc-dis.o
285
endif
286
ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips)
287
LIBOBJS+=mips-dis.o
288
endif
289
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc)
290
LIBOBJS+=sparc-dis.o
291
endif
292
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
293
LIBOBJS+=arm-dis.o
294
endif
295
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
296
LIBOBJS+=m68k-dis.o
297
endif
298
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4)
299
LIBOBJS+=sh4-dis.o
300
endif
301

    
302
ifdef CONFIG_GDBSTUB
303
OBJS+=gdbstub.o
304
endif
305

    
306
all: $(PROGS)
307

    
308
$(QEMU_USER): $(OBJS)
309
	$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^  $(LIBS)
310
ifeq ($(ARCH),alpha)
311
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of
312
# the address space (31 bit so sign extending doesn't matter)
313
	echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc
314
endif
315

    
316
# must use static linking to avoid leaving stuff in virtual address space
317
VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o
318
VL_OBJS+=cutils.o
319
VL_OBJS+=block.o block-raw.o
320
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
321
ifdef CONFIG_WIN32
322
VL_OBJS+=tap-win32.o
323
endif
324

    
325
SOUND_HW = sb16.o es1370.o
326
AUDIODRV = audio.o noaudio.o wavaudio.o
327
ifdef CONFIG_SDL
328
AUDIODRV += sdlaudio.o
329
endif
330
ifdef CONFIG_OSS
331
AUDIODRV += ossaudio.o
332
endif
333
ifdef CONFIG_COREAUDIO
334
AUDIODRV += coreaudio.o
335
endif
336
ifdef CONFIG_ALSA
337
AUDIODRV += alsaaudio.o
338
LIBS += -lasound
339
endif
340
ifdef CONFIG_DSOUND
341
AUDIODRV += dsoundaudio.o
342
LIBS += -lole32 -ldxguid
343
endif
344
ifdef CONFIG_FMOD
345
AUDIODRV += fmodaudio.o
346
audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS)
347
LIBS += $(CONFIG_FMOD_LIB)
348
endif
349
ifdef CONFIG_ADLIB
350
SOUND_HW += fmopl.o adlib.o
351
endif
352
AUDIODRV+= wavcapture.o
353

    
354
# SCSI layer
355
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o
356

    
357
# USB layer
358
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o
359

    
360
# PCI network cards
361
VL_OBJS+= ne2000.o rtl8139.o pcnet.o
362

    
363
ifeq ($(TARGET_BASE_ARCH), i386)
364
# Hardware support
365
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
366
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
367
VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o
368
VL_OBJS+= usb-uhci.o
369
CPPFLAGS += -DHAS_AUDIO
370
endif
371
ifeq ($(TARGET_BASE_ARCH), ppc)
372
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
373
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o
374
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o
375
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o
376
CPPFLAGS += -DHAS_AUDIO
377
endif
378
ifeq ($(TARGET_ARCH), mips)
379
VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o dma.o vga.o serial.o i8254.o i8259.o
380
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o
381
VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV)
382
DEFINES += -DHAS_AUDIO
383
endif
384
ifeq ($(TARGET_BASE_ARCH), sparc)
385
ifeq ($(TARGET_ARCH), sparc64)
386
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o
387
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o
388
VL_OBJS+= cirrus_vga.o parallel.o
389
else
390
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o
391
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o
392
VL_OBJS+= cs4231.o
393
endif
394
endif
395
ifeq ($(TARGET_BASE_ARCH), arm)
396
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o
397
VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o
398
VL_OBJS+= versatile_pci.o
399
VL_OBJS+= arm_gic.o realview.o arm_sysctl.o
400
endif
401
ifeq ($(TARGET_BASE_ARCH), sh4)
402
VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o
403
endif
404
ifdef CONFIG_GDBSTUB
405
VL_OBJS+=gdbstub.o 
406
endif
407
ifdef CONFIG_SDL
408
VL_OBJS+=sdl.o
409
endif
410
VL_OBJS+=vnc.o
411
ifdef CONFIG_COCOA
412
VL_OBJS+=cocoa.o
413
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
414
ifdef CONFIG_COREAUDIO
415
COCOA_LIBS+=-framework CoreAudio
416
endif
417
endif
418
ifdef CONFIG_SLIRP
419
CPPFLAGS+=-I$(SRC_PATH)/slirp
420
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
421
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
422
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
423
VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
424
endif
425

    
426
VL_LDFLAGS=
427
# specific flags are needed for non soft mmu emulator
428
ifdef CONFIG_STATIC
429
VL_LDFLAGS+=-static
430
endif
431
ifndef CONFIG_SOFTMMU
432
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld 
433
endif
434
ifndef CONFIG_DARWIN
435
ifndef CONFIG_WIN32
436
ifndef CONFIG_SOLARIS
437
VL_LIBS=-lutil -lrt
438
endif
439
endif
440
endif
441
ifdef TARGET_GPROF
442
vl.o: BASE_CFLAGS+=-p
443
VL_LDFLAGS+=-p
444
endif
445

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

    
450
ifeq ($(ARCH),sparc64)
451
VL_LDFLAGS+=-m64
452
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld
453
endif
454

    
455
ifdef CONFIG_WIN32
456
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
457
endif
458

    
459
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
460
	$(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS)
461

    
462
cocoa.o: cocoa.m
463
	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
464

    
465
sdl.o: sdl.c keymaps.c sdl_keysym.h
466
	$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
467

    
468
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h
469
	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
470

    
471
sdlaudio.o: sdlaudio.c
472
	$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $<
473

    
474
depend: $(SRCS)
475
	$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
476

    
477
vldepend: $(VL_OBJS:.o=.c)
478
	$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend
479

    
480
# libqemu 
481

    
482
libqemu.a: $(LIBOBJS)
483
	rm -f $@
484
	$(AR) rcs $@ $(LIBOBJS)
485

    
486
translate.o: translate.c gen-op.h opc.h cpu.h
487

    
488
translate-all.o: translate-all.c opc.h cpu.h
489

    
490
translate-op.o: translate-all.c op.h opc.h cpu.h
491

    
492
op.h: op.o $(DYNGEN)
493
	$(DYNGEN) -o $@ $<
494

    
495
opc.h: op.o $(DYNGEN)
496
	$(DYNGEN) -c -o $@ $<
497

    
498
gen-op.h: op.o $(DYNGEN)
499
	$(DYNGEN) -g -o $@ $<
500

    
501
op.o: op.c
502
	$(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $<
503

    
504
# HELPER_CFLAGS is used for all the code compiled with static register
505
# variables
506
ifeq ($(TARGET_BASE_ARCH), i386)
507
# XXX: rename helper.c to op_helper.c
508
helper.o: helper.c
509
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
510
else
511
op_helper.o: op_helper.c
512
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
513
endif
514

    
515
cpu-exec.o: cpu-exec.c
516
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
517

    
518
# Note: this is a workaround. The real fix is to avoid compiling
519
# cpu_signal_handler() in cpu-exec.c.
520
signal.o: signal.c
521
	$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
522

    
523
ifeq ($(TARGET_BASE_ARCH), i386)
524
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h
525
endif
526

    
527
ifeq ($(TARGET_ARCH), arm)
528
op.o: op.c op_template.h
529
pl110.o: pl110_template.h
530
endif
531

    
532
ifeq ($(TARGET_BASE_ARCH), sparc)
533
op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h
534
magic_load.o: elf_op.h
535
endif
536

    
537
ifeq ($(TARGET_BASE_ARCH), ppc)
538
op.o: op.c op_template.h op_mem.h
539
op_helper.o: op_helper_mem.h
540
translate.o: translate.c translate_init.c
541
endif
542

    
543
ifeq ($(TARGET_ARCH), mips)
544
op.o: op.c op_template.c op_mem.c
545
op_helper.o: op_helper_mem.c
546
endif
547

    
548
loader.o: loader.c elf_ops.h
549

    
550
ifeq ($(TARGET_ARCH), sh4)
551
op.o: op.c op_mem.c cpu.h
552
op_helper.o: op_helper.c exec.h cpu.h
553
helper.o: helper.c exec.h cpu.h
554
sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h
555
shix.o: shix.c sh7750_regs.h sh7750_regnames.h
556
sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h
557
tc58128.o: tc58128.c
558
endif
559

    
560
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h
561

    
562
%.o: %.c
563
	$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $<
564

    
565
%.o: %.S
566
	$(CC) $(CPPFLAGS) -c -o $@ $<
567

    
568
clean:
569
	rm -f *.o  *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o
570

    
571
install: all 
572
ifneq ($(PROGS),)
573
	$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
574
endif
575

    
576
ifneq ($(wildcard .depend),)
577
include .depend
578
endif
579

    
580
ifeq (1, 0)
581
audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \
582
fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \
583
CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare
584
endif