root / Makefile.target @ 22f8a8b3
History | View | Annotate | Download (18 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), mipsn32) |
8 |
TARGET_BASE_ARCH:=mips |
9 |
endif |
10 |
ifeq ($(TARGET_ARCH), mips64) |
11 |
TARGET_BASE_ARCH:=mips |
12 |
endif |
13 |
ifeq ($(TARGET_ARCH), ppc64) |
14 |
TARGET_BASE_ARCH:=ppc |
15 |
endif |
16 |
ifeq ($(TARGET_ARCH), ppc64h) |
17 |
TARGET_BASE_ARCH:=ppc |
18 |
endif |
19 |
ifeq ($(TARGET_ARCH), ppcemb) |
20 |
TARGET_BASE_ARCH:=ppc |
21 |
endif |
22 |
ifeq ($(TARGET_ARCH), sparc64) |
23 |
TARGET_BASE_ARCH:=sparc |
24 |
endif |
25 |
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
26 |
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio |
27 |
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) |
28 |
ifdef CONFIG_DARWIN_USER |
29 |
VPATH+=:$(SRC_PATH)/darwin-user |
30 |
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) |
31 |
endif |
32 |
ifdef CONFIG_LINUX_USER |
33 |
VPATH+=:$(SRC_PATH)/linux-user |
34 |
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) |
35 |
endif |
36 |
BASE_CFLAGS= |
37 |
BASE_LDFLAGS= |
38 |
#CFLAGS+=-Werror |
39 |
LIBS= |
40 |
HELPER_CFLAGS=$(CFLAGS) |
41 |
DYNGEN=../dyngen$(EXESUF) |
42 |
# user emulator name |
43 |
TARGET_ARCH2=$(TARGET_ARCH) |
44 |
ifeq ($(TARGET_ARCH),arm) |
45 |
ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
46 |
TARGET_ARCH2=armeb |
47 |
endif |
48 |
endif |
49 |
ifeq ($(TARGET_ARCH),sh4) |
50 |
ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
51 |
TARGET_ARCH2=sh4eb |
52 |
endif |
53 |
endif |
54 |
ifeq ($(TARGET_ARCH),mips) |
55 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
56 |
TARGET_ARCH2=mipsel |
57 |
endif |
58 |
endif |
59 |
ifeq ($(TARGET_ARCH),mipsn32) |
60 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
61 |
TARGET_ARCH2=mipsn32el |
62 |
endif |
63 |
endif |
64 |
ifeq ($(TARGET_ARCH),mips64) |
65 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
66 |
TARGET_ARCH2=mips64el |
67 |
endif |
68 |
endif |
69 |
QEMU_USER=qemu-$(TARGET_ARCH2) |
70 |
# system emulator name |
71 |
ifdef CONFIG_SOFTMMU |
72 |
ifeq ($(TARGET_ARCH), i386) |
73 |
QEMU_SYSTEM=qemu$(EXESUF) |
74 |
else |
75 |
QEMU_SYSTEM=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
76 |
endif |
77 |
else |
78 |
QEMU_SYSTEM=qemu-fast |
79 |
endif |
80 |
|
81 |
ifdef CONFIG_USER_ONLY |
82 |
PROGS=$(QEMU_USER) |
83 |
else |
84 |
PROGS+=$(QEMU_SYSTEM) |
85 |
ifndef CONFIG_SOFTMMU |
86 |
CONFIG_STATIC=y |
87 |
endif |
88 |
endif # !CONFIG_USER_ONLY |
89 |
|
90 |
ifdef CONFIG_STATIC |
91 |
BASE_LDFLAGS+=-static |
92 |
endif |
93 |
|
94 |
# We require -O2 to avoid the stack setup prologue in EXIT_TB |
95 |
OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing |
96 |
|
97 |
# cc-option |
98 |
# Usage: OP_CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0) |
99 |
|
100 |
cc-option = $(shell if $(CC) $(OP_CFLAGS) $(1) -S -o /dev/null -xc /dev/null \ |
101 |
> /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) |
102 |
|
103 |
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "") |
104 |
OP_CFLAGS+=$(call cc-option, -fno-gcse, "") |
105 |
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "") |
106 |
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "") |
107 |
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "") |
108 |
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "") |
109 |
OP_CFLAGS+=$(call cc-option, -fno-align-jumps, "") |
110 |
OP_CFLAGS+=$(call cc-option, -fno-align-functions, $(call cc-option, -malign-functions=0, "")) |
111 |
OP_CFLAGS+=$(call cc-option, -fno-section-anchors, "") |
112 |
|
113 |
ifeq ($(ARCH),i386) |
114 |
HELPER_CFLAGS+=-fomit-frame-pointer |
115 |
OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer |
116 |
ifdef TARGET_GPROF |
117 |
USE_I386_LD=y |
118 |
endif |
119 |
ifdef CONFIG_STATIC |
120 |
USE_I386_LD=y |
121 |
endif |
122 |
ifdef USE_I386_LD |
123 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
124 |
else |
125 |
ifdef CONFIG_LINUX_USER |
126 |
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
127 |
# that the kernel ELF loader considers as an executable. I think this |
128 |
# is the simplest way to make it self virtualizable! |
129 |
BASE_LDFLAGS+=-Wl,-shared |
130 |
endif |
131 |
endif |
132 |
endif |
133 |
|
134 |
ifeq ($(ARCH),x86_64) |
135 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
136 |
endif |
137 |
|
138 |
ifeq ($(ARCH),ppc) |
139 |
CPPFLAGS+= -D__powerpc__ |
140 |
ifdef CONFIG_LINUX_USER |
141 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
142 |
endif |
143 |
endif |
144 |
|
145 |
ifeq ($(ARCH),s390) |
146 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
147 |
endif |
148 |
|
149 |
ifeq ($(ARCH),sparc) |
150 |
BASE_CFLAGS+=-ffixed-g2 -ffixed-g3 |
151 |
OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 |
152 |
ifeq ($(CONFIG_SOLARIS),yes) |
153 |
OP_CFLAGS+=-fno-omit-frame-pointer |
154 |
else |
155 |
BASE_CFLAGS+=-ffixed-g1 -ffixed-g6 |
156 |
HELPER_CFLAGS=$(CFLAGS) -ffixed-i0 -mflat |
157 |
# -static is used to avoid g1/g3 usage by the dynamic linker |
158 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static |
159 |
endif |
160 |
endif |
161 |
|
162 |
ifeq ($(ARCH),sparc64) |
163 |
BASE_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 |
164 |
OP_CFLAGS+=-mcpu=ultrasparc -m64 -fno-delayed-branch -ffixed-i0 |
165 |
ifneq ($(CONFIG_SOLARIS),yes) |
166 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
167 |
OP_CFLAGS+=-ffixed-g1 -ffixed-g4 -ffixed-g5 -ffixed-g7 |
168 |
endif |
169 |
endif |
170 |
|
171 |
ifeq ($(ARCH),alpha) |
172 |
# -msmall-data is not used for OP_CFLAGS because we want two-instruction |
173 |
# relocations for the constant constructions |
174 |
# Ensure there's only a single GP |
175 |
BASE_CFLAGS+=-msmall-data |
176 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
177 |
endif |
178 |
|
179 |
ifeq ($(ARCH),ia64) |
180 |
BASE_CFLAGS+=-mno-sdata |
181 |
OP_CFLAGS+=-mno-sdata |
182 |
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld |
183 |
endif |
184 |
|
185 |
ifeq ($(ARCH),arm) |
186 |
OP_CFLAGS+=-mno-sched-prolog -fno-omit-frame-pointer |
187 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
188 |
endif |
189 |
|
190 |
ifeq ($(ARCH),m68k) |
191 |
OP_CFLAGS+=-fomit-frame-pointer |
192 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
193 |
endif |
194 |
|
195 |
ifeq ($(ARCH),mips) |
196 |
OP_CFLAGS+=-mabi=32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0 |
197 |
ifeq ($(WORDS_BIGENDIAN),yes) |
198 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
199 |
else |
200 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
201 |
endif |
202 |
endif |
203 |
|
204 |
ifeq ($(ARCH),mips64) |
205 |
OP_CFLAGS+=-mabi=n32 -G0 -fno-PIC -mno-abicalls -fomit-frame-pointer -fno-delayed-branch -Wa,-O0 |
206 |
ifeq ($(WORDS_BIGENDIAN),yes) |
207 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
208 |
else |
209 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
210 |
endif |
211 |
endif |
212 |
|
213 |
ifeq ($(CONFIG_DARWIN),yes) |
214 |
LIBS+=-lmx |
215 |
endif |
216 |
|
217 |
ifdef CONFIG_DARWIN_USER |
218 |
# Leave some space for the regular program loading zone |
219 |
BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 |
220 |
endif |
221 |
|
222 |
BASE_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS) |
223 |
BASE_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS) |
224 |
OP_CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS) |
225 |
OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS) |
226 |
|
227 |
######################################################### |
228 |
|
229 |
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
230 |
LIBS+=-lm |
231 |
ifndef CONFIG_USER_ONLY |
232 |
LIBS+=-lz |
233 |
endif |
234 |
ifdef CONFIG_WIN32 |
235 |
LIBS+=-lwinmm -lws2_32 -liphlpapi |
236 |
endif |
237 |
ifdef CONFIG_SOLARIS |
238 |
LIBS+=-lsocket -lnsl -lresolv |
239 |
ifdef NEEDS_LIBSUNMATH |
240 |
LIBS+=-lsunmath |
241 |
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib |
242 |
OP_CFLAGS+=-I/opt/SUNWspro/prod/include/cc |
243 |
BASE_CFLAGS+=-I/opt/SUNWspro/prod/include/cc |
244 |
endif |
245 |
endif |
246 |
|
247 |
# profiling code |
248 |
ifdef TARGET_GPROF |
249 |
BASE_LDFLAGS+=-p |
250 |
main.o: BASE_CFLAGS+=-p |
251 |
endif |
252 |
|
253 |
ifdef CONFIG_LINUX_USER |
254 |
OBJS= main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o \ |
255 |
elfload.o linuxload.o |
256 |
LIBS+= $(AIOLIBS) |
257 |
ifdef TARGET_HAS_BFLT |
258 |
OBJS+= flatload.o |
259 |
endif |
260 |
ifdef TARGET_HAS_ELFLOAD32 |
261 |
OBJS+= elfload32.o |
262 |
elfload32.o: elfload.c |
263 |
endif |
264 |
|
265 |
ifeq ($(TARGET_ARCH), i386) |
266 |
OBJS+= vm86.o |
267 |
endif |
268 |
ifeq ($(TARGET_ARCH), arm) |
269 |
OBJS+=nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
270 |
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
271 |
nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
272 |
endif |
273 |
ifeq ($(TARGET_ARCH), m68k) |
274 |
OBJS+= m68k-sim.o m68k-semi.o |
275 |
endif |
276 |
endif #CONFIG_LINUX_USER |
277 |
|
278 |
ifdef CONFIG_DARWIN_USER |
279 |
OBJS= main.o commpage.o machload.o mmap.o osdep.o signal.o syscall.o thunk.o |
280 |
endif |
281 |
|
282 |
SRCS:= $(OBJS:.o=.c) |
283 |
OBJS+= libqemu.a |
284 |
|
285 |
# cpu emulator library |
286 |
LIBOBJS=exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o\ |
287 |
translate.o op.o host-utils.o |
288 |
ifdef CONFIG_SOFTFLOAT |
289 |
LIBOBJS+=fpu/softfloat.o |
290 |
else |
291 |
LIBOBJS+=fpu/softfloat-native.o |
292 |
endif |
293 |
CPPFLAGS+=-I$(SRC_PATH)/fpu |
294 |
|
295 |
ifeq ($(TARGET_ARCH), i386) |
296 |
LIBOBJS+=helper.o helper2.o |
297 |
ifeq ($(ARCH), i386) |
298 |
LIBOBJS+=translate-copy.o |
299 |
endif |
300 |
endif |
301 |
|
302 |
ifeq ($(TARGET_ARCH), x86_64) |
303 |
LIBOBJS+=helper.o helper2.o |
304 |
endif |
305 |
|
306 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
307 |
LIBOBJS+= op_helper.o helper.o |
308 |
endif |
309 |
|
310 |
ifeq ($(TARGET_BASE_ARCH), mips) |
311 |
LIBOBJS+= op_helper.o helper.o |
312 |
endif |
313 |
|
314 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
315 |
LIBOBJS+= op_helper.o helper.o |
316 |
endif |
317 |
|
318 |
ifeq ($(TARGET_BASE_ARCH), arm) |
319 |
LIBOBJS+= op_helper.o helper.o |
320 |
endif |
321 |
|
322 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
323 |
LIBOBJS+= op_helper.o helper.o |
324 |
endif |
325 |
|
326 |
ifeq ($(TARGET_BASE_ARCH), m68k) |
327 |
LIBOBJS+= op_helper.o helper.o |
328 |
endif |
329 |
|
330 |
ifeq ($(TARGET_BASE_ARCH), alpha) |
331 |
LIBOBJS+= op_helper.o helper.o alpha_palcode.o |
332 |
endif |
333 |
|
334 |
ifeq ($(TARGET_BASE_ARCH), cris) |
335 |
LIBOBJS+= op_helper.o helper.o |
336 |
LIBOBJS+= cris-dis.o |
337 |
|
338 |
ifndef CONFIG_USER_ONLY |
339 |
LIBOBJS+= mmu.o |
340 |
endif |
341 |
endif |
342 |
|
343 |
# NOTE: the disassembler code is only needed for debugging |
344 |
LIBOBJS+=disas.o |
345 |
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) |
346 |
USE_I386_DIS=y |
347 |
endif |
348 |
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
349 |
USE_I386_DIS=y |
350 |
endif |
351 |
ifdef USE_I386_DIS |
352 |
LIBOBJS+=i386-dis.o |
353 |
endif |
354 |
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) |
355 |
LIBOBJS+=alpha-dis.o |
356 |
endif |
357 |
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
358 |
LIBOBJS+=ppc-dis.o |
359 |
endif |
360 |
ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips) |
361 |
LIBOBJS+=mips-dis.o |
362 |
endif |
363 |
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
364 |
LIBOBJS+=sparc-dis.o |
365 |
endif |
366 |
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
367 |
LIBOBJS+=arm-dis.o |
368 |
endif |
369 |
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
370 |
LIBOBJS+=m68k-dis.o |
371 |
endif |
372 |
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
373 |
LIBOBJS+=sh4-dis.o |
374 |
endif |
375 |
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390) |
376 |
LIBOBJS+=s390-dis.o |
377 |
endif |
378 |
|
379 |
ifdef CONFIG_GDBSTUB |
380 |
OBJS+=gdbstub.o |
381 |
endif |
382 |
|
383 |
all: $(PROGS) |
384 |
|
385 |
$(QEMU_USER): $(OBJS) |
386 |
$(CC) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ $(LIBS) |
387 |
ifeq ($(ARCH),alpha) |
388 |
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
389 |
# the address space (31 bit so sign extending doesn't matter) |
390 |
echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc |
391 |
endif |
392 |
|
393 |
# must use static linking to avoid leaving stuff in virtual address space |
394 |
VL_OBJS=vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o |
395 |
VL_OBJS+=cutils.o |
396 |
VL_OBJS+=block.o block-raw.o |
397 |
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 block-parallels.o |
398 |
VL_OBJS+=irq.o |
399 |
ifdef CONFIG_WIN32 |
400 |
VL_OBJS+=tap-win32.o |
401 |
endif |
402 |
|
403 |
SOUND_HW = sb16.o es1370.o |
404 |
AUDIODRV = audio.o noaudio.o wavaudio.o mixeng.o |
405 |
ifdef CONFIG_SDL |
406 |
AUDIODRV += sdlaudio.o |
407 |
endif |
408 |
ifdef CONFIG_OSS |
409 |
AUDIODRV += ossaudio.o |
410 |
endif |
411 |
ifdef CONFIG_COREAUDIO |
412 |
AUDIODRV += coreaudio.o |
413 |
endif |
414 |
ifdef CONFIG_ALSA |
415 |
AUDIODRV += alsaaudio.o |
416 |
LIBS += -lasound |
417 |
endif |
418 |
ifdef CONFIG_DSOUND |
419 |
AUDIODRV += dsoundaudio.o |
420 |
LIBS += -lole32 -ldxguid |
421 |
endif |
422 |
ifdef CONFIG_FMOD |
423 |
AUDIODRV += fmodaudio.o |
424 |
audio.o fmodaudio.o: CPPFLAGS := -I$(CONFIG_FMOD_INC) $(CPPFLAGS) |
425 |
LIBS += $(CONFIG_FMOD_LIB) |
426 |
endif |
427 |
ifdef CONFIG_ADLIB |
428 |
SOUND_HW += fmopl.o adlib.o |
429 |
endif |
430 |
AUDIODRV+= wavcapture.o |
431 |
|
432 |
ifdef CONFIG_VNC_TLS |
433 |
CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS) |
434 |
LIBS += $(CONFIG_VNC_TLS_LIBS) |
435 |
endif |
436 |
|
437 |
VL_OBJS += i2c.o smbus.o |
438 |
|
439 |
# SCSI layer |
440 |
VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o |
441 |
|
442 |
# USB layer |
443 |
VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o |
444 |
VL_OBJS+= usb-wacom.o |
445 |
|
446 |
# EEPROM emulation |
447 |
VL_OBJS += eeprom93xx.o |
448 |
|
449 |
# PCI network cards |
450 |
VL_OBJS += eepro100.o |
451 |
VL_OBJS += ne2000.o |
452 |
VL_OBJS += pcnet.o |
453 |
VL_OBJS += rtl8139.o |
454 |
|
455 |
ifeq ($(TARGET_BASE_ARCH), i386) |
456 |
# Hardware support |
457 |
VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
458 |
VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
459 |
VL_OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o |
460 |
VL_OBJS+= usb-uhci.o smbus_eeprom.o vmmouse.o vmport.o vmware_vga.o |
461 |
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE |
462 |
endif |
463 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
464 |
VL_OBJS+= ppc.o ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV) |
465 |
VL_OBJS+= mc146818rtc.o serial.o i8259.o i8254.o fdc.o m48t59.o pflash_cfi02.o |
466 |
VL_OBJS+= ppc_prep.o ppc_chrp.o cuda.o adb.o openpic.o heathrow_pic.o |
467 |
VL_OBJS+= grackle_pci.o prep_pci.o unin_pci.o |
468 |
# PowerPC 4xx boards |
469 |
VL_OBJS+= ppc4xx_devs.o ppc405_uc.o ppc405_boards.o |
470 |
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE |
471 |
endif |
472 |
ifeq ($(TARGET_BASE_ARCH), mips) |
473 |
VL_OBJS+= mips_r4k.o mips_malta.o mips_pica61.o |
474 |
VL_OBJS+= mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o |
475 |
VL_OBJS+= jazz_led.o |
476 |
VL_OBJS+= ide.o gt64xxx.o pckbd.o ps2.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o |
477 |
VL_OBJS+= piix_pci.o smbus_eeprom.o parallel.o mixeng.o cirrus_vga.o $(SOUND_HW) $(AUDIODRV) |
478 |
CPPFLAGS += -DHAS_AUDIO |
479 |
endif |
480 |
ifeq ($(TARGET_BASE_ARCH), cris) |
481 |
VL_OBJS+= etraxfs.o |
482 |
VL_OBJS+= ptimer.o |
483 |
VL_OBJS+= etraxfs_timer.o |
484 |
VL_OBJS+= etraxfs_ser.o |
485 |
endif |
486 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
487 |
ifeq ($(TARGET_ARCH), sparc64) |
488 |
VL_OBJS+= sun4u.o ide.o pckbd.o ps2.o vga.o apb_pci.o |
489 |
VL_OBJS+= fdc.o mc146818rtc.o serial.o m48t59.o |
490 |
VL_OBJS+= cirrus_vga.o parallel.o ptimer.o |
491 |
else |
492 |
VL_OBJS+= sun4m.o tcx.o pcnet.o iommu.o m48t59.o slavio_intctl.o |
493 |
VL_OBJS+= slavio_timer.o slavio_serial.o slavio_misc.o fdc.o esp.o sparc32_dma.o |
494 |
VL_OBJS+= cs4231.o ptimer.o |
495 |
endif |
496 |
endif |
497 |
ifeq ($(TARGET_BASE_ARCH), arm) |
498 |
VL_OBJS+= integratorcp.o versatilepb.o ps2.o smc91c111.o arm_pic.o arm_timer.o |
499 |
VL_OBJS+= arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o |
500 |
VL_OBJS+= versatile_pci.o sd.o ptimer.o |
501 |
VL_OBJS+= arm_gic.o realview.o arm_sysctl.o |
502 |
VL_OBJS+= arm-semi.o |
503 |
VL_OBJS+= pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o |
504 |
VL_OBJS+= pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o max111x.o max7310.o |
505 |
VL_OBJS+= spitz.o ads7846.o ide.o serial.o nand.o $(AUDIODRV) wm8750.o |
506 |
VL_OBJS+= omap.o omap_lcdc.o omap1_clk.o omap_mmc.o palm.o ecc.o |
507 |
CPPFLAGS += -DHAS_AUDIO |
508 |
endif |
509 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
510 |
VL_OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o |
511 |
VL_OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o |
512 |
endif |
513 |
ifeq ($(TARGET_BASE_ARCH), m68k) |
514 |
VL_OBJS+= an5206.o mcf5206.o ptimer.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o |
515 |
VL_OBJS+= m68k-semi.o |
516 |
endif |
517 |
ifdef CONFIG_GDBSTUB |
518 |
VL_OBJS+=gdbstub.o |
519 |
endif |
520 |
ifdef CONFIG_SDL |
521 |
VL_OBJS+=sdl.o x_keymap.o |
522 |
endif |
523 |
VL_OBJS+=vnc.o d3des.o |
524 |
ifdef CONFIG_COCOA |
525 |
VL_OBJS+=cocoa.o |
526 |
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
527 |
ifdef CONFIG_COREAUDIO |
528 |
COCOA_LIBS+=-framework CoreAudio |
529 |
endif |
530 |
endif |
531 |
ifdef CONFIG_SLIRP |
532 |
CPPFLAGS+=-I$(SRC_PATH)/slirp |
533 |
SLIRP_OBJS=cksum.o if.o ip_icmp.o ip_input.o ip_output.o \ |
534 |
slirp.o mbuf.o misc.o sbuf.o socket.o tcp_input.o tcp_output.o \ |
535 |
tcp_subr.o tcp_timer.o udp.o bootp.o debug.o tftp.o |
536 |
VL_OBJS+=$(addprefix slirp/, $(SLIRP_OBJS)) |
537 |
endif |
538 |
|
539 |
VL_LDFLAGS=$(VL_OS_LDFLAGS) |
540 |
VL_LIBS=$(AIOLIBS) |
541 |
# specific flags are needed for non soft mmu emulator |
542 |
ifdef CONFIG_STATIC |
543 |
VL_LDFLAGS+=-static |
544 |
endif |
545 |
ifndef CONFIG_SOFTMMU |
546 |
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386-vl.ld |
547 |
endif |
548 |
ifndef CONFIG_DARWIN |
549 |
ifndef CONFIG_WIN32 |
550 |
ifndef CONFIG_SOLARIS |
551 |
VL_LIBS+=-lutil |
552 |
endif |
553 |
endif |
554 |
endif |
555 |
ifdef TARGET_GPROF |
556 |
vl.o: BASE_CFLAGS+=-p |
557 |
VL_LDFLAGS+=-p |
558 |
endif |
559 |
|
560 |
ifeq ($(ARCH),ia64) |
561 |
VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
562 |
endif |
563 |
|
564 |
ifeq ($(ARCH),sparc64) |
565 |
VL_LDFLAGS+=-m64 |
566 |
ifneq ($(CONFIG_SOLARIS),yes) |
567 |
VL_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
568 |
endif |
569 |
endif |
570 |
|
571 |
ifdef CONFIG_WIN32 |
572 |
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole |
573 |
endif |
574 |
|
575 |
$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a |
576 |
$(CC) $(VL_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) |
577 |
|
578 |
cocoa.o: cocoa.m |
579 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
580 |
|
581 |
sdl.o: sdl.c keymaps.c sdl_keysym.h |
582 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
583 |
|
584 |
vnc.o: vnc.c keymaps.c sdl_keysym.h vnchextile.h d3des.c d3des.h |
585 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
586 |
|
587 |
sdlaudio.o: sdlaudio.c |
588 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(SDL_CFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
589 |
|
590 |
depend: $(SRCS) |
591 |
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
592 |
|
593 |
vldepend: $(VL_OBJS:.o=.c) |
594 |
$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $^ 1>.depend |
595 |
|
596 |
# libqemu |
597 |
|
598 |
libqemu.a: $(LIBOBJS) |
599 |
rm -f $@ |
600 |
$(AR) rcs $@ $(LIBOBJS) |
601 |
|
602 |
translate.o: translate.c gen-op.h opc.h cpu.h |
603 |
|
604 |
translate-all.o: translate-all.c opc.h cpu.h |
605 |
|
606 |
translate-op.o: translate-all.c op.h opc.h cpu.h |
607 |
|
608 |
op.h: op.o $(DYNGEN) |
609 |
$(DYNGEN) -o $@ $< |
610 |
|
611 |
opc.h: op.o $(DYNGEN) |
612 |
$(DYNGEN) -c -o $@ $< |
613 |
|
614 |
gen-op.h: op.o $(DYNGEN) |
615 |
$(DYNGEN) -g -o $@ $< |
616 |
|
617 |
op.o: op.c |
618 |
$(CC) $(OP_CFLAGS) $(CPPFLAGS) -c -o $@ $< |
619 |
|
620 |
# HELPER_CFLAGS is used for all the code compiled with static register |
621 |
# variables |
622 |
ifeq ($(TARGET_BASE_ARCH), i386) |
623 |
# XXX: rename helper.c to op_helper.c |
624 |
helper.o: helper.c |
625 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
626 |
else |
627 |
op_helper.o: op_helper.c |
628 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
629 |
endif |
630 |
|
631 |
cpu-exec.o: cpu-exec.c |
632 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
633 |
|
634 |
# Note: this is a workaround. The real fix is to avoid compiling |
635 |
# cpu_signal_handler() in cpu-exec.c. |
636 |
signal.o: signal.c |
637 |
$(CC) $(HELPER_CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
638 |
|
639 |
vga.o: pixel_ops.h |
640 |
|
641 |
tcx.o: pixel_ops.h |
642 |
|
643 |
ifeq ($(TARGET_BASE_ARCH), i386) |
644 |
op.o: op.c opreg_template.h ops_template.h ops_template_mem.h ops_mem.h ops_sse.h |
645 |
endif |
646 |
|
647 |
ifeq ($(TARGET_ARCH), arm) |
648 |
op.o: op.c op_template.h |
649 |
pl110.o: pl110_template.h |
650 |
endif |
651 |
|
652 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
653 |
helper.o: cpu.h exec-all.h |
654 |
op.o: op.c op_template.h op_mem.h fop_template.h fbranch_template.h exec.h cpu.h |
655 |
op_helper.o: exec.h softmmu_template.h cpu.h |
656 |
translate.o: cpu.h exec-all.h disas.h |
657 |
endif |
658 |
|
659 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
660 |
op.o: op.c op_template.h op_mem.h op_helper.h |
661 |
op_helper.o: op_helper.c mfrom_table.c op_helper_mem.h op_helper.h |
662 |
translate.o: translate.c translate_init.c |
663 |
endif |
664 |
|
665 |
ifeq ($(TARGET_BASE_ARCH), mips) |
666 |
helper.o: cpu.h exec-all.h |
667 |
op.o: op_template.c fop_template.c op_mem.c exec.h cpu.h |
668 |
op_helper.o: exec.h softmmu_template.h cpu.h |
669 |
translate.o: translate_init.c exec-all.h disas.h |
670 |
endif |
671 |
|
672 |
loader.o: loader.c elf_ops.h |
673 |
|
674 |
ifeq ($(TARGET_ARCH), sh4) |
675 |
op.o: op.c op_mem.c cpu.h |
676 |
op_helper.o: op_helper.c exec.h cpu.h |
677 |
helper.o: helper.c exec.h cpu.h |
678 |
sh7750.o: sh7750.c sh7750_regs.h sh7750_regnames.h cpu.h |
679 |
shix.o: shix.c sh7750_regs.h sh7750_regnames.h |
680 |
sh7750_regnames.o: sh7750_regnames.c sh7750_regnames.h sh7750_regs.h |
681 |
tc58128.o: tc58128.c |
682 |
endif |
683 |
|
684 |
ifeq ($(TARGET_BASE_ARCH), alpha) |
685 |
op.o: op.c op_template.h op_mem.h |
686 |
op_helper.o: op_helper_mem.h |
687 |
endif |
688 |
|
689 |
$(OBJS) $(LIBOBJS) $(VL_OBJS): config.h ../config-host.h |
690 |
|
691 |
%.o: %.c |
692 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -c -o $@ $< |
693 |
|
694 |
%.o: %.S |
695 |
$(CC) $(CPPFLAGS) -c -o $@ $< |
696 |
|
697 |
clean: |
698 |
rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o |
699 |
|
700 |
install: all |
701 |
ifneq ($(PROGS),) |
702 |
$(INSTALL) -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)" |
703 |
endif |
704 |
|
705 |
ifneq ($(wildcard .depend),) |
706 |
include .depend |
707 |
endif |
708 |
|
709 |
ifeq (1, 0) |
710 |
audio.o sdlaudio.o dsoundaudio.o ossaudio.o wavaudio.o noaudio.o \ |
711 |
fmodaudio.o alsaaudio.o mixeng.o sb16.o es1370.o gus.o adlib.o: \ |
712 |
CFLAGS := $(CFLAGS) -Wall -Werror -W -Wsign-compare |
713 |
endif |