Statistics
| Branch: | Revision:

root / Makefile.target @ 6070dd07

History | View | Annotate | Download (14.2 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 mips_int.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
VL_OBJS+= arm-semi.o
401
endif
402
ifeq ($(TARGET_BASE_ARCH), sh4)
403
VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o
404
endif
405
ifdef CONFIG_GDBSTUB
406
VL_OBJS+=gdbstub.o 
407
endif
408
ifdef CONFIG_SDL
409
VL_OBJS+=sdl.o x_keymap.o
410
endif
411
VL_OBJS+=vnc.o
412
ifdef CONFIG_COCOA
413
VL_OBJS+=cocoa.o
414
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit
415
ifdef CONFIG_COREAUDIO
416
COCOA_LIBS+=-framework CoreAudio
417
endif
418
endif
419
ifdef CONFIG_SLIRP
420
CPPFLAGS+=-I$(SRC_PATH)/slirp
421
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \
422
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \
423
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o
424
VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS))
425
endif
426

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

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

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

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

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

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

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

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

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

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

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

    
481
# libqemu 
482

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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