root / Makefile.target @ 6c041c54
History | View | Annotate | Download (14.9 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 |
# cc-option |
76 |
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) |
77 |
|
78 |
cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ |
79 |
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
80 |
|
81 |
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "") |
82 |
OP_CFLAGS+=$(call cc-option, -fno-gcse, "") |
83 |
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "") |
84 |
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "") |
85 |
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "") |
86 |
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "") |
87 |
OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "") |
88 |
OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, "")) |
89 |
|
90 |
ifeq ($(ARCH),i386) |
91 |
HELPER_CFLAGS+=-fomit-frame-pointer |
92 |
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer |
93 |
ifdef TARGET_GPROF |
94 |
USE_I386_LD=y |
95 |
endif |
96 |
ifdef CONFIG_STATIC |
97 |
USE_I386_LD=y |
98 |
endif |
99 |
ifdef USE_I386_LD |
100 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
101 |
else |
102 |
ifdef CONFIG_LINUX_USER |
103 |
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
104 |
# that the kernel ELF loader considers as an executable. I think this |
105 |
# is the simplest way to make it self virtualizable! |
106 |
BASE_LDFLAGS+=-Wl,-shared |
107 |
endif |
108 |
endif |
109 |
endif |
110 |
|
111 |
ifeq ($(ARCH),x86_64) |
112 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
113 |
endif |
114 |
|
115 |
ifeq ($(ARCH),ppc) |
116 |
CPPFLAGS+= -D__powerpc__ |
117 |
ifdef CONFIG_LINUX_USER |
118 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
119 |
endif |
120 |
endif |
121 |
|
122 |
ifeq ($(ARCH),s390) |
123 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
124 |
endif |
125 |
|
126 |
ifeq ($(ARCH),sparc) |
127 |
ifeq ($(CONFIG_SOLARIS),yes) |
128 |
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 |
129 |
BASE_LDFLAGS+=-m32 |
130 |
OP_CFLAGS+=-fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0 |
131 |
else |
132 |
BASE_CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g1 -ffixed-g2 -ffixed-g3 -ffixed-g6 |
133 |
BASE_LDFLAGS+=-m32 |
134 |
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 |
135 |
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat |
136 |
# -static is used to avoid g1/g3 usage by the dynamic linker |
137 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static |
138 |
endif |
139 |
endif |
140 |
|
141 |
ifeq ($(ARCH),sparc64) |
142 |
BASE_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 |
143 |
BASE_LDFLAGS+=-m64 |
144 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
145 |
OP_CFLAGS+=-mcpu=ultrasparc -m64 -ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 -fno-delayed-branch -ffixed-i0 |
146 |
endif |
147 |
|
148 |
ifeq ($(ARCH),alpha) |
149 |
# -msmall-data is not used for OP_CFLAGS because we want two-instruction |
150 |
# relocations for the constant constructions |
151 |
# Ensure there's only a single GP |
152 |
BASE_CFLAGS+=-msmall-data |
153 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
154 |
endif |
155 |
|
156 |
ifeq ($(ARCH),ia64) |
157 |
BASE_CFLAGS+=-mno-sdata |
158 |
OP_CFLAGS+=-mno-sdata |
159 |
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld |
160 |
endif |
161 |
|
162 |
ifeq ($(ARCH),arm) |
163 |
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer |
164 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
165 |
endif |
166 |
|
167 |
ifeq ($(ARCH),m68k) |
168 |
OP_CFLAGS+=-fomit-frame-pointer |
169 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
170 |
endif |
171 |
|
172 |
ifeq ($(ARCH),mips) |
173 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
174 |
endif |
175 |
|
176 |
ifeq ($(CONFIG_DARWIN),yes) |
177 |
LIBS+=-lmx |
178 |
endif |
179 |
|
180 |
ifdef CONFIG_DARWIN_USER |
181 |
# Leave some space for the regular program loading zone |
182 |
BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 |
183 |
endif |
184 |
|
185 |
BASE_CFLAGS+=$(OS_CFLAGS) |
186 |
OP_CFLAGS+=$(OS_CFLAGS) |
187 |
|
188 |
######################################################### |
189 |
|
190 |
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
191 |
LIBS+=-lm |
192 |
ifndef CONFIG_USER_ONLY |
193 |
LIBS+=-lz |
194 |
endif |
195 |
ifdef CONFIG_WIN32 |
196 |
LIBS+=-lwinmm -lws2_32 -liphlpapi |
197 |
endif |
198 |
ifdef CONFIG_SOLARIS |
199 |
LIBS+=-lsocket -lnsl -lresolv |
200 |
endif |
201 |
|
202 |
# profiling code |
203 |
ifdef TARGET_GPROF |
204 |
BASE_LDFLAGS+=-p |
205 |
main.o: BASE_CFLAGS+=-p |
206 |
endif |
207 |
|
208 |
ifdef CONFIG_LINUX_USER |
209 |
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ |
210 |
elfload.o linuxload.o |
211 |
ifdef TARGET_HAS_BFLT |
212 |
OBJS+= flatload.o |
213 |
endif |
214 |
|
215 |
ifeq ($(TARGET_ARCH), i386) |
216 |
OBJS+= vm86.o |
217 |
endif |
218 |
ifeq ($(TARGET_ARCH), arm) |
219 |
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
220 |
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
221 |
nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
222 |
endif |
223 |
ifeq ($(TARGET_ARCH), m68k) |
224 |
OBJS+= m68k-sim.o m68k-semi.o |
225 |
endif |
226 |
endif #CONFIG_LINUX_USER |
227 |
|
228 |
ifdef CONFIG_DARWIN_USER |
229 |
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o |
230 |
endif |
231 |
|
232 |
SRCS:= $(OBJS:.o=.c) |
233 |
OBJS+= libqemu.a |
234 |
|
235 |
# cpu emulator library |
236 |
LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
237 |
translate.o op.o |
238 |
ifdef CONFIG_SOFTFLOAT |
239 |
LIBOBJS+=fpu/softfloat.o |
240 |
else |
241 |
LIBOBJS+=fpu/softfloat-native.o |
242 |
endif |
243 |
CPPFLAGS+=-I$(SRC_PATH)/fpu |
244 |
|
245 |
ifeq ($(TARGET_ARCH), i386) |
246 |
LIBOBJS+=helper.o helper2.o |
247 |
ifeq ($(ARCH), i386) |
248 |
LIBOBJS+=translate-copy.o |
249 |
endif |
250 |
endif |
251 |
|
252 |
ifeq ($(TARGET_ARCH), x86_64) |
253 |
LIBOBJS+=helper.o helper2.o |
254 |
endif |
255 |
|
256 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
257 |
LIBOBJS+= op_helper.o helper.o |
258 |
endif |
259 |
|
260 |
ifeq ($(TARGET_ARCH), mips) |
261 |
LIBOBJS+= op_helper.o helper.o |
262 |
endif |
263 |
|
264 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
265 |
LIBOBJS+= op_helper.o helper.o |
266 |
endif |
267 |
|
268 |
ifeq ($(TARGET_BASE_ARCH), arm) |
269 |
LIBOBJS+= op_helper.o helper.o |
270 |
endif |
271 |
|
272 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
273 |
LIBOBJS+= op_helper.o helper.o |
274 |
endif |
275 |
|
276 |
ifeq ($(TARGET_BASE_ARCH), m68k) |
277 |
LIBOBJS+= helper.o |
278 |
endif |
279 |
|
280 |
# NOTE: the disassembler code is only needed for debugging |
281 |
LIBOBJS+=disas.o |
282 |
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) |
283 |
USE_I386_DIS=y |
284 |
endif |
285 |
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
286 |
USE_I386_DIS=y |
287 |
endif |
288 |
ifdef USE_I386_DIS |
289 |
LIBOBJS+=i386-dis.o |
290 |
endif |
291 |
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) |
292 |
LIBOBJS+=alpha-dis.o |
293 |
endif |
294 |
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
295 |
LIBOBJS+=ppc-dis.o |
296 |
endif |
297 |
ifeq ($(findstring mips, $(TARGET_ARCH) $(ARCH)),mips) |
298 |
LIBOBJS+=mips-dis.o |
299 |
endif |
300 |
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
301 |
LIBOBJS+=sparc-dis.o |
302 |
endif |
303 |
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
304 |
LIBOBJS+=arm-dis.o |
305 |
endif |
306 |
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
307 |
LIBOBJS+=m68k-dis.o |
308 |
endif |
309 |
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
310 |
LIBOBJS+=sh4-dis.o |
311 |
endif |
312 |
|
313 |
ifdef CONFIG_GDBSTUB |
314 |
OBJS+=gdbstub.o |
315 |
endif |
316 |
|
317 |
all: $(PROGS) |
318 |
|
319 |
$(QEMU_USER): $(OBJS) |
320 |
$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS) |
321 |
ifeq ($(ARCH),alpha) |
322 |
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
323 |
# the address space (31 bit so sign extending doesn't matter) |
324 |
echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc |
325 |
endif |
326 |
|
327 |
# must use static linking to avoid leaving stuff in virtual address space |
328 |
VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o |
329 |
VL_OBJS+=cutils.o |
330 |
VL_OBJS+=block.o block-raw.o |
331 |
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 |
332 |
ifdef CONFIG_WIN32 |
333 |
VL_OBJS+=tap-win32.o |
334 |
endif |
335 |
|
336 |
SOUND_HW = sb16.o es1370.o |
337 |
AUDIODRV = audio.o noaudio.o wavaudio.o |
338 |
ifdef CONFIG_SDL |
339 |
AUDIODRV += sdlaudio.o |
340 |
endif |
341 |
ifdef CONFIG_OSS |
342 |
AUDIODRV += ossaudio.o |
343 |
endif |
344 |
ifdef CONFIG_COREAUDIO |
345 |
AUDIODRV += coreaudio.o |
346 |
endif |
347 |
ifdef CONFIG_ALSA |
348 |
AUDIODRV += alsaaudio.o |
349 |
LIBS += -lasound |
350 |
endif |
351 |
ifdef CONFIG_DSOUND |
352 |
AUDIODRV += dsoundaudio.o |
353 |
LIBS += -lole32 -ldxguid |
354 |
endif |
355 |
ifdef CONFIG_FMOD |
356 |
AUDIODRV += fmodaudio.o |
357 |
audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS) |
358 |
LIBS += $(CONFIG_FMOD_LIB) |
359 |
endif |
360 |
ifdef CONFIG_ADLIB |
361 |
SOUND_HW += fmopl.o adlib.o |
362 |
endif |
363 |
AUDIODRV+= wavcapture.o |
364 |
|
365 |
# SCSI layer |
366 |
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o |
367 |
|
368 |
# USB layer |
369 |
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o |
370 |
|
371 |
# PCI network cards |
372 |
VL_OBJS+= ne2000.o rtl8139.o pcnet.o |
373 |
|
374 |
ifeq ($(TARGET_BASE_ARCH), i386) |
375 |
# Hardware support |
376 |
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
377 |
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
378 |
VL_OBJS+= cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o |
379 |
VL_OBJS+= usb-uhci.o smbus_eeprom.o |
380 |
CPPFLAGS += -DHAS_AUDIO |
381 |
endif |
382 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
383 |
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
384 |
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o |
385 |
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o mixeng.o |
386 |
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o |
387 |
CPPFLAGS += -DHAS_AUDIO |
388 |
endif |
389 |
ifeq ($(TARGET_ARCH), mips) |
390 |
VL_OBJS+= mips_r4k.o mips_malta.o mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o |
391 |
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o |
392 |
VL_OBJS+= piix_pci.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV) |
393 |
DEFINES += -DHAS_AUDIO |
394 |
endif |
395 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
396 |
ifeq ($(TARGET_ARCH), sparc64) |
397 |
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o |
398 |
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o |
399 |
VL_OBJS+= cirrus_vga.o parallel.o |
400 |
else |
401 |
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o |
402 |
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o |
403 |
VL_OBJS+= cs4231.o |
404 |
endif |
405 |
endif |
406 |
ifeq ($(TARGET_BASE_ARCH), arm) |
407 |
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o |
408 |
VL_OBJS+= arm_boot.o pl011.o pl050.o pl080.o pl110.o pl190.o |
409 |
VL_OBJS+= versatile_pci.o |
410 |
VL_OBJS+= arm_gic.o realview.o arm_sysctl.o |
411 |
VL_OBJS+= arm-semi.o |
412 |
endif |
413 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
414 |
VL_OBJS+= shix.o sh7750.o sh7750_regnames.o tc58128.o |
415 |
endif |
416 |
ifdef CONFIG_GDBSTUB |
417 |
VL_OBJS+=gdbstub.o |
418 |
endif |
419 |
ifdef CONFIG_SDL |
420 |
VL_OBJS+=sdl.o x_keymap.o |
421 |
endif |
422 |
VL_OBJS+=vnc.o |
423 |
ifdef CONFIG_COCOA |
424 |
VL_OBJS+=cocoa.o |
425 |
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
426 |
ifdef CONFIG_COREAUDIO |
427 |
COCOA_LIBS+=-framework CoreAudio |
428 |
endif |
429 |
endif |
430 |
ifdef CONFIG_SLIRP |
431 |
CPPFLAGS+=-I$(SRC_PATH)/slirp |
432 |
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ |
433 |
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ |
434 |
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
435 |
VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
436 |
endif |
437 |
|
438 |
VL_LDFLAGS= |
439 |
VL_LIBS=$(AIOLIBS) |
440 |
# specific flags are needed for non soft mmu emulator |
441 |
ifdef CONFIG_STATIC |
442 |
VL_LDFLAGS+=-static |
443 |
endif |
444 |
ifndef CONFIG_SOFTMMU |
445 |
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld |
446 |
endif |
447 |
ifndef CONFIG_DARWIN |
448 |
ifndef CONFIG_WIN32 |
449 |
ifndef CONFIG_SOLARIS |
450 |
VL_LIBS+=-lutil |
451 |
endif |
452 |
endif |
453 |
endif |
454 |
ifdef TARGET_GPROF |
455 |
vl.o: BASE_CFLAGS+=-p |
456 |
VL_LDFLAGS+=-p |
457 |
endif |
458 |
|
459 |
ifeq ($(ARCH),ia64) |
460 |
VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
461 |
endif |
462 |
|
463 |
ifeq ($(ARCH),sparc64) |
464 |
VL_LDFLAGS+=-m64 |
465 |
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/sparc64.ld |
466 |
endif |
467 |
|
468 |
ifdef CONFIG_WIN32 |
469 |
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole |
470 |
endif |
471 |
|
472 |
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
473 |
$(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
474 |
|
475 |
cocoa.o: cocoa.m |
476 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
477 |
|
478 |
sdl.o: sdl.c keymaps.c sdl_keysym.h |
479 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
480 |
|
481 |
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h |
482 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
483 |
|
484 |
sdlaudio.o: sdlaudio.c |
485 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
486 |
|
487 |
depend: $(SRCS) |
488 |
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
489 |
|
490 |
vldepend: $(VL_OBJS:.o=.c) |
491 |
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
492 |
|
493 |
# libqemu |
494 |
|
495 |
libqemu.a: $(LIBOBJS) |
496 |
rm -f $@ |
497 |
$(AR) rcs $@ $(LIBOBJS) |
498 |
|
499 |
translate.o: translate.c gen-op.h opc.h cpu.h |
500 |
|
501 |
translate-all.o: translate-all.c opc.h cpu.h |
502 |
|
503 |
translate-op.o: translate-all.c op.h opc.h cpu.h |
504 |
|
505 |
op.h: op.o $(DYNGEN) |
506 |
$(DYNGEN) -o $@ $< |
507 |
|
508 |
opc.h: op.o $(DYNGEN) |
509 |
$(DYNGEN) -c -o $@ $< |
510 |
|
511 |
gen-op.h: op.o $(DYNGEN) |
512 |
$(DYNGEN) -g -o $@ $< |
513 |
|
514 |
op.o: op.c |
515 |
$(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< |
516 |
|
517 |
# HELPER_CFLAGS is used for all the code compiled with static register |
518 |
# variables |
519 |
ifeq ($(TARGET_BASE_ARCH), i386) |
520 |
# XXX: rename helper.c to op_helper.c |
521 |
helper.o: helper.c |
522 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
523 |
else |
524 |
op_helper.o: op_helper.c |
525 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
526 |
endif |
527 |
|
528 |
cpu-exec.o: cpu-exec.c |
529 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
530 |
|
531 |
# Note: this is a workaround. The real fix is to avoid compiling |
532 |
# cpu_signal_handler() in cpu-exec.c. |
533 |
signal.o: signal.c |
534 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
535 |
|
536 |
ifeq ($(TARGET_BASE_ARCH), i386) |
537 |
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
538 |
endif |
539 |
|
540 |
ifeq ($(TARGET_ARCH), arm) |
541 |
op.o: op.c op_template.h |
542 |
pl110.o: pl110_template.h |
543 |
endif |
544 |
|
545 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
546 |
op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h |
547 |
magic_load.o: elf_op.h |
548 |
endif |
549 |
|
550 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
551 |
op.o: op.c op_template.h op_mem.h |
552 |
op_helper.o: op_helper_mem.h |
553 |
translate.o: translate.c translate_init.c |
554 |
endif |
555 |
|
556 |
ifeq ($(TARGET_ARCH), mips) |
557 |
op.o: op.c op_template.c fop_template.c op_mem.c |
558 |
op_helper.o: op_helper_mem.c |
559 |
translate.o: translate.c translate_init.c |
560 |
endif |
561 |
|
562 |
loader.o: loader.c elf_ops.h |
563 |
|
564 |
ifeq ($(TARGET_ARCH), sh4) |
565 |
op.o: op.c op_mem.c cpu.h |
566 |
op_helper.o: op_helper.c exec.h cpu.h |
567 |
helper.o: helper.c exec.h cpu.h |
568 |
sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h |
569 |
shix.o: shix.c sh7750_regs.h sh7750_regnames.h |
570 |
sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h |
571 |
tc58128.o: tc58128.c |
572 |
endif |
573 |
|
574 |
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h |
575 |
|
576 |
%.o: %.c |
577 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
578 |
|
579 |
%.o: %.S |
580 |
$(CC) $(CPPFLAGS) -c -o $@ $< |
581 |
|
582 |
clean: |
583 |
rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
584 |
|
585 |
install: all |
586 |
ifneq ($(PROGS),) |
587 |
$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" |
588 |
endif |
589 |
|
590 |
ifneq ($(wildcard .depend),) |
591 |
include .depend |
592 |
endif |
593 |
|
594 |
ifeq (1, 0) |
595 |
audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \ |
596 |
fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \ |
597 |
CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare |
598 |
endif |