root / Makefile.target @ 7ed208c4
History | View | Annotate | Download (18.3 kB)
1 |
include config.mak |
---|---|
2 |
include $(SRC_PATH)/rules.mak |
3 |
|
4 |
TARGET_BASE_ARCH:=$(TARGET_ARCH) |
5 |
ifeq ($(TARGET_ARCH), x86_64) |
6 |
TARGET_BASE_ARCH:=i386 |
7 |
endif |
8 |
ifeq ($(TARGET_ARCH), mipsn32) |
9 |
TARGET_BASE_ARCH:=mips |
10 |
endif |
11 |
ifeq ($(TARGET_ARCH), mips64) |
12 |
TARGET_BASE_ARCH:=mips |
13 |
endif |
14 |
ifeq ($(TARGET_ARCH), ppc64) |
15 |
TARGET_BASE_ARCH:=ppc |
16 |
endif |
17 |
ifeq ($(TARGET_ARCH), ppc64h) |
18 |
TARGET_BASE_ARCH:=ppc |
19 |
endif |
20 |
ifeq ($(TARGET_ARCH), ppcemb) |
21 |
TARGET_BASE_ARCH:=ppc |
22 |
endif |
23 |
ifeq ($(TARGET_ARCH), sparc64) |
24 |
TARGET_BASE_ARCH:=sparc |
25 |
endif |
26 |
TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) |
27 |
VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw |
28 |
CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) -MMD -MT $@ -MP -DNEED_CPU_H |
29 |
#CFLAGS+=-Werror |
30 |
LIBS= |
31 |
# user emulator name |
32 |
ifndef TARGET_ARCH2 |
33 |
TARGET_ARCH2=$(TARGET_ARCH) |
34 |
endif |
35 |
ifeq ($(TARGET_ARCH),arm) |
36 |
ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
37 |
TARGET_ARCH2=armeb |
38 |
endif |
39 |
endif |
40 |
ifeq ($(TARGET_ARCH),sh4) |
41 |
ifeq ($(TARGET_WORDS_BIGENDIAN),yes) |
42 |
TARGET_ARCH2=sh4eb |
43 |
endif |
44 |
endif |
45 |
ifeq ($(TARGET_ARCH),mips) |
46 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
47 |
TARGET_ARCH2=mipsel |
48 |
endif |
49 |
endif |
50 |
ifeq ($(TARGET_ARCH),mipsn32) |
51 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
52 |
TARGET_ARCH2=mipsn32el |
53 |
endif |
54 |
endif |
55 |
ifeq ($(TARGET_ARCH),mips64) |
56 |
ifneq ($(TARGET_WORDS_BIGENDIAN),yes) |
57 |
TARGET_ARCH2=mips64el |
58 |
endif |
59 |
endif |
60 |
|
61 |
ifdef CONFIG_USER_ONLY |
62 |
# user emulator name |
63 |
QEMU_PROG=qemu-$(TARGET_ARCH2) |
64 |
else |
65 |
# system emulator name |
66 |
ifeq ($(TARGET_ARCH), i386) |
67 |
QEMU_PROG=qemu$(EXESUF) |
68 |
else |
69 |
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
70 |
endif |
71 |
endif |
72 |
|
73 |
PROGS=$(QEMU_PROG) |
74 |
|
75 |
# cc-option |
76 |
# Usage: CFLAGS+=$(call cc-option, $(CFLAGS), -falign-functions=0, -malign-functions=0) |
77 |
|
78 |
cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \ |
79 |
> /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;) |
80 |
|
81 |
HELPER_CFLAGS= |
82 |
|
83 |
ifeq ($(ARCH),i386) |
84 |
HELPER_CFLAGS+=-fomit-frame-pointer |
85 |
endif |
86 |
|
87 |
ifeq ($(subst ppc64,ppc,$(ARCH))$(TARGET_BASE_ARCH),ppcppc) |
88 |
translate.o: CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-unit-at-a-time,) |
89 |
endif |
90 |
|
91 |
ifeq ($(ARCH),sparc) |
92 |
ifneq ($(CONFIG_SOLARIS),yes) |
93 |
HELPER_CFLAGS+=-ffixed-i0 |
94 |
endif |
95 |
endif |
96 |
|
97 |
ifeq ($(ARCH),alpha) |
98 |
# Ensure there's only a single GP |
99 |
CFLAGS+=-msmall-data |
100 |
endif |
101 |
|
102 |
ifeq ($(ARCH),hppa) |
103 |
BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
104 |
endif |
105 |
|
106 |
ifeq ($(ARCH),ia64) |
107 |
CFLAGS+=-mno-sdata |
108 |
endif |
109 |
|
110 |
CFLAGS+=$(OS_CFLAGS) $(ARCH_CFLAGS) |
111 |
LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS) |
112 |
|
113 |
CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
114 |
CPPFLAGS+=-U_FORTIFY_SOURCE |
115 |
LIBS+=-lm |
116 |
ifdef CONFIG_WIN32 |
117 |
LIBS+=-lwinmm -lws2_32 -liphlpapi |
118 |
endif |
119 |
ifdef CONFIG_SOLARIS |
120 |
LIBS+=-lsocket -lnsl -lresolv |
121 |
ifdef NEEDS_LIBSUNMATH |
122 |
LIBS+=-lsunmath |
123 |
LDFLAGS+=-L/opt/SUNWspro/prod/lib -R/opt/SUNWspro/prod/lib |
124 |
CFLAGS+=-I/opt/SUNWspro/prod/include/cc |
125 |
endif |
126 |
endif |
127 |
|
128 |
kvm.o: CFLAGS+=$(KVM_CFLAGS) |
129 |
kvm-all.o: CFLAGS+=$(KVM_CFLAGS) |
130 |
|
131 |
all: $(PROGS) |
132 |
# Dummy command so that make thinks it has done something |
133 |
@true |
134 |
|
135 |
######################################################### |
136 |
# cpu emulator library |
137 |
libobj-y = exec.o translate-all.o cpu-exec.o translate.o host-utils.o |
138 |
libobj-$(CONFIG_KQEMU) += kqemu.o |
139 |
# TCG code generator |
140 |
libobj-y += tcg/tcg.o tcg/tcg-runtime.o |
141 |
CPPFLAGS+=-I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/$(ARCH) |
142 |
ifeq ($(ARCH),sparc64) |
143 |
CPPFLAGS+=-I$(SRC_PATH)/tcg/sparc |
144 |
endif |
145 |
ifdef CONFIG_SOFTFLOAT |
146 |
libobj-y += fpu/softfloat.o |
147 |
else |
148 |
libobj-y += fpu/softfloat-native.o |
149 |
endif |
150 |
CPPFLAGS+=-I$(SRC_PATH)/fpu |
151 |
libobj-y += op_helper.o helper.o |
152 |
|
153 |
ifeq ($(TARGET_BASE_ARCH), arm) |
154 |
libobj-y += neon_helper.o iwmmxt_helper.o |
155 |
endif |
156 |
|
157 |
ifeq ($(TARGET_BASE_ARCH), alpha) |
158 |
libobj-y += alpha_palcode.o |
159 |
endif |
160 |
|
161 |
ifeq ($(TARGET_BASE_ARCH), cris) |
162 |
libobj-y += cris-dis.o |
163 |
|
164 |
ifndef CONFIG_USER_ONLY |
165 |
libobj-y += mmu.o |
166 |
endif |
167 |
endif |
168 |
|
169 |
# NOTE: the disassembler code is only needed for debugging |
170 |
libobj-y += disas.o |
171 |
ifeq ($(findstring i386, $(TARGET_ARCH) $(ARCH)),i386) |
172 |
USE_I386_DIS=y |
173 |
endif |
174 |
ifeq ($(findstring x86_64, $(TARGET_ARCH) $(ARCH)),x86_64) |
175 |
USE_I386_DIS=y |
176 |
endif |
177 |
libobj-$(USE_I386_DIS) += i386-dis.o |
178 |
ifeq ($(findstring alpha, $(TARGET_ARCH) $(ARCH)),alpha) |
179 |
libobj-y += alpha-dis.o |
180 |
endif |
181 |
ifeq ($(findstring ppc, $(TARGET_BASE_ARCH) $(ARCH)),ppc) |
182 |
libobj-y += ppc-dis.o |
183 |
endif |
184 |
ifeq ($(findstring microblaze, $(TARGET_BASE_ARCH) $(ARCH)),microblaze) |
185 |
libobj-y += microblaze-dis.o |
186 |
ifndef CONFIG_USER_ONLY |
187 |
libobj-y += mmu.o |
188 |
endif |
189 |
endif |
190 |
ifeq ($(findstring mips, $(TARGET_BASE_ARCH) $(ARCH)),mips) |
191 |
libobj-y += mips-dis.o |
192 |
endif |
193 |
ifeq ($(findstring sparc, $(TARGET_BASE_ARCH) $(ARCH)),sparc) |
194 |
libobj-y += sparc-dis.o |
195 |
endif |
196 |
ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
197 |
libobj-y += arm-dis.o |
198 |
endif |
199 |
ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) |
200 |
libobj-y += m68k-dis.o |
201 |
endif |
202 |
ifeq ($(findstring sh4, $(TARGET_ARCH) $(ARCH)),sh4) |
203 |
libobj-y += sh4-dis.o |
204 |
endif |
205 |
ifeq ($(findstring hppa, $(TARGET_BASE_ARCH) $(ARCH)),hppa) |
206 |
libobj-y += hppa-dis.o |
207 |
endif |
208 |
ifeq ($(findstring s390, $(TARGET_ARCH) $(ARCH)),s390) |
209 |
libobj-y += s390-dis.o |
210 |
endif |
211 |
|
212 |
# libqemu |
213 |
|
214 |
libqemu.a: $(libobj-y) |
215 |
|
216 |
translate.o: translate.c cpu.h |
217 |
|
218 |
translate-all.o: translate-all.c cpu.h |
219 |
|
220 |
tcg/tcg.o: cpu.h |
221 |
|
222 |
# HELPER_CFLAGS is used for all the code compiled with static register |
223 |
# variables |
224 |
op_helper.o: CFLAGS += $(HELPER_CFLAGS) $(I386_CFLAGS) |
225 |
|
226 |
cpu-exec.o: CFLAGS += $(HELPER_CFLAGS) |
227 |
|
228 |
######################################################### |
229 |
# Linux user emulator target |
230 |
|
231 |
ifdef CONFIG_LINUX_USER |
232 |
|
233 |
ifndef TARGET_ABI_DIR |
234 |
TARGET_ABI_DIR=$(TARGET_ARCH) |
235 |
endif |
236 |
VPATH+=:$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) |
237 |
CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) |
238 |
|
239 |
ifdef CONFIG_STATIC |
240 |
LDFLAGS+=-static |
241 |
endif |
242 |
|
243 |
ifeq ($(ARCH),i386) |
244 |
ifdef TARGET_GPROF |
245 |
USE_I386_LD=y |
246 |
endif |
247 |
ifdef CONFIG_STATIC |
248 |
USE_I386_LD=y |
249 |
endif |
250 |
ifdef USE_I386_LD |
251 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
252 |
else |
253 |
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
254 |
# that the kernel ELF loader considers as an executable. I think this |
255 |
# is the simplest way to make it self virtualizable! |
256 |
LDFLAGS+=-Wl,-shared |
257 |
endif |
258 |
endif |
259 |
|
260 |
ifeq ($(ARCH),x86_64) |
261 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
262 |
endif |
263 |
|
264 |
ifeq ($(ARCH),ppc) |
265 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
266 |
endif |
267 |
|
268 |
ifeq ($(ARCH),ppc64) |
269 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
270 |
endif |
271 |
|
272 |
ifeq ($(ARCH),s390) |
273 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
274 |
endif |
275 |
|
276 |
ifeq ($(ARCH),sparc) |
277 |
# -static is used to avoid g1/g3 usage by the dynamic linker |
278 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static |
279 |
endif |
280 |
|
281 |
ifeq ($(ARCH),sparc64) |
282 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
283 |
endif |
284 |
|
285 |
ifeq ($(ARCH),alpha) |
286 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
287 |
endif |
288 |
|
289 |
ifeq ($(ARCH),ia64) |
290 |
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld |
291 |
endif |
292 |
|
293 |
ifeq ($(ARCH),arm) |
294 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
295 |
endif |
296 |
|
297 |
ifeq ($(ARCH),m68k) |
298 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
299 |
endif |
300 |
|
301 |
ifeq ($(ARCH),mips) |
302 |
ifeq ($(WORDS_BIGENDIAN),yes) |
303 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
304 |
else |
305 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
306 |
endif |
307 |
endif |
308 |
|
309 |
ifeq ($(ARCH),mips64) |
310 |
ifeq ($(WORDS_BIGENDIAN),yes) |
311 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
312 |
else |
313 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
314 |
endif |
315 |
endif |
316 |
|
317 |
# profiling code |
318 |
ifdef TARGET_GPROF |
319 |
LDFLAGS+=-p |
320 |
CFLAGS+=-p |
321 |
endif |
322 |
|
323 |
obj-y = main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \ |
324 |
elfload.o linuxload.o uaccess.o envlist.o gdbstub.o gdbstub-xml.o \ |
325 |
ioport-user.o |
326 |
LIBS+= $(PTHREADLIBS) |
327 |
LIBS+= $(CLOCKLIBS) |
328 |
obj-$(TARGET_HAS_BFLT) += flatload.o |
329 |
|
330 |
ifdef TARGET_HAS_ELFLOAD32 |
331 |
elfload32.o: elfload.c |
332 |
endif |
333 |
obj-$(TARGET_HAS_ELFLOAD32) += elfload32.o |
334 |
|
335 |
ifeq ($(TARGET_ARCH), i386) |
336 |
obj-y += vm86.o |
337 |
endif |
338 |
ifeq ($(TARGET_ARCH), arm) |
339 |
obj-y += nwfpe/fpa11.o nwfpe/fpa11_cpdo.o \ |
340 |
nwfpe/fpa11_cpdt.o nwfpe/fpa11_cprt.o nwfpe/fpopcode.o nwfpe/single_cpdo.o \ |
341 |
nwfpe/double_cpdo.o nwfpe/extended_cpdo.o arm-semi.o |
342 |
endif |
343 |
ifeq ($(TARGET_ARCH), m68k) |
344 |
obj-y += m68k-sim.o m68k-semi.o |
345 |
endif |
346 |
|
347 |
# Note: this is a workaround. The real fix is to avoid compiling |
348 |
# cpu_signal_handler() in cpu-exec.c. |
349 |
signal.o: CFLAGS += $(HELPER_CFLAGS) |
350 |
|
351 |
$(QEMU_PROG): ARLIBS=../libqemu_user.a libqemu.a |
352 |
$(QEMU_PROG): $(obj-y) ../libqemu_user.a libqemu.a |
353 |
$(call LINK,$(obj-y)) |
354 |
ifeq ($(ARCH),alpha) |
355 |
# Mark as 32 bit binary, i. e. it will be mapped into the low 31 bit of |
356 |
# the address space (31 bit so sign extending doesn't matter) |
357 |
echo -ne '\001\000\000\000' | dd of=qemu bs=1 seek=48 count=4 conv=notrunc |
358 |
endif |
359 |
|
360 |
endif #CONFIG_LINUX_USER |
361 |
|
362 |
######################################################### |
363 |
# Darwin user emulator target |
364 |
|
365 |
ifdef CONFIG_DARWIN_USER |
366 |
|
367 |
VPATH+=:$(SRC_PATH)/darwin-user |
368 |
CPPFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) |
369 |
|
370 |
# Leave some space for the regular program loading zone |
371 |
LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e000000 |
372 |
|
373 |
LIBS+=-lmx |
374 |
|
375 |
obj-y = main.o commpage.o machload.o mmap.o signal.o syscall.o thunk.o \ |
376 |
gdbstub.o gdbstub-xml.o ioport-user.o |
377 |
|
378 |
# Note: this is a workaround. The real fix is to avoid compiling |
379 |
# cpu_signal_handler() in cpu-exec.c. |
380 |
signal.o: CFLAGS += $(HELPER_CFLAGS) |
381 |
|
382 |
$(QEMU_PROG): ARLIBS=libqemu.a |
383 |
$(QEMU_PROG): $(obj-y) libqemu.a |
384 |
$(call LINK,$(obj-y)) |
385 |
|
386 |
endif #CONFIG_DARWIN_USER |
387 |
|
388 |
######################################################### |
389 |
# BSD user emulator target |
390 |
|
391 |
ifdef CONFIG_BSD_USER |
392 |
|
393 |
VPATH+=:$(SRC_PATH)/bsd-user |
394 |
CPPFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) |
395 |
|
396 |
ifdef CONFIG_STATIC |
397 |
LDFLAGS+=-static |
398 |
endif |
399 |
|
400 |
ifeq ($(ARCH),i386) |
401 |
ifdef TARGET_GPROF |
402 |
USE_I386_LD=y |
403 |
endif |
404 |
ifdef CONFIG_STATIC |
405 |
USE_I386_LD=y |
406 |
endif |
407 |
ifdef USE_I386_LD |
408 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
409 |
else |
410 |
# WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
411 |
# that the kernel ELF loader considers as an executable. I think this |
412 |
# is the simplest way to make it self virtualizable! |
413 |
LDFLAGS+=-Wl,-shared |
414 |
endif |
415 |
endif |
416 |
|
417 |
ifeq ($(ARCH),x86_64) |
418 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
419 |
endif |
420 |
|
421 |
ifeq ($(ARCH),ppc) |
422 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
423 |
endif |
424 |
|
425 |
ifeq ($(ARCH),ppc64) |
426 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
427 |
endif |
428 |
|
429 |
ifeq ($(ARCH),s390) |
430 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
431 |
endif |
432 |
|
433 |
ifeq ($(ARCH),sparc) |
434 |
# -static is used to avoid g1/g3 usage by the dynamic linker |
435 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld -static |
436 |
endif |
437 |
|
438 |
ifeq ($(ARCH),sparc64) |
439 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
440 |
endif |
441 |
|
442 |
ifeq ($(ARCH),alpha) |
443 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
444 |
endif |
445 |
|
446 |
ifeq ($(ARCH),ia64) |
447 |
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld |
448 |
endif |
449 |
|
450 |
ifeq ($(ARCH),arm) |
451 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
452 |
endif |
453 |
|
454 |
ifeq ($(ARCH),m68k) |
455 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
456 |
endif |
457 |
|
458 |
ifeq ($(ARCH),mips) |
459 |
ifeq ($(WORDS_BIGENDIAN),yes) |
460 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
461 |
else |
462 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
463 |
endif |
464 |
endif |
465 |
|
466 |
ifeq ($(ARCH),mips64) |
467 |
ifeq ($(WORDS_BIGENDIAN),yes) |
468 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld |
469 |
else |
470 |
LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld |
471 |
endif |
472 |
endif |
473 |
|
474 |
obj-y = main.o bsdload.o elfload.o mmap.o path.o signal.o strace.o syscall.o \ |
475 |
gdbstub.o gdbstub-xml.o ioport-user.o |
476 |
obj-y += uaccess.o |
477 |
|
478 |
# Note: this is a workaround. The real fix is to avoid compiling |
479 |
# cpu_signal_handler() in cpu-exec.c. |
480 |
signal.o: CFLAGS += $(HELPER_CFLAGS) |
481 |
|
482 |
$(QEMU_PROG): ARLIBS=libqemu.a ../libqemu_user.a |
483 |
$(QEMU_PROG): $(obj-y) libqemu.a ../libqemu_user.a |
484 |
$(call LINK,$(obj-y)) |
485 |
|
486 |
endif #CONFIG_BSD_USER |
487 |
|
488 |
######################################################### |
489 |
# System emulator target |
490 |
ifndef CONFIG_USER_ONLY |
491 |
|
492 |
obj-y = vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o \ |
493 |
gdbstub.o gdbstub-xml.o msix.o ioport.o |
494 |
# virtio has to be here due to weird dependency between PCI and virtio-net. |
495 |
# need to fix this properly |
496 |
obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-console.o |
497 |
obj-$(CONFIG_KVM) += kvm.o kvm-all.o |
498 |
|
499 |
LIBS+=-lz |
500 |
ifdef CONFIG_ALSA |
501 |
LIBS += -lasound |
502 |
endif |
503 |
ifdef CONFIG_ESD |
504 |
LIBS += -lesd |
505 |
endif |
506 |
ifdef CONFIG_PA |
507 |
LIBS += -lpulse-simple |
508 |
endif |
509 |
ifdef CONFIG_DSOUND |
510 |
LIBS += -lole32 -ldxguid |
511 |
endif |
512 |
ifdef CONFIG_FMOD |
513 |
LIBS += $(CONFIG_FMOD_LIB) |
514 |
endif |
515 |
ifdef CONFIG_OSS |
516 |
LIBS += $(CONFIG_OSS_LIB) |
517 |
endif |
518 |
|
519 |
sound-obj-y = |
520 |
sound-obj-$(CONFIG_SB16) += sb16.o |
521 |
sound-obj-$(CONFIG_ES1370) += es1370.o |
522 |
sound-obj-$(CONFIG_AC97) += ac97.o |
523 |
sound-obj-$(CONFIG_ADLIB) += fmopl.o adlib.o |
524 |
sound-obj-$(CONFIG_GUS) += gus.o gusemu_hal.o gusemu_mixer.o |
525 |
sound-obj-$(CONFIG_CS4231A) += cs4231a.o |
526 |
|
527 |
ifdef CONFIG_ADLIB |
528 |
adlib.o fmopl.o: CFLAGS := ${CFLAGS} -DBUILD_Y8950=0 |
529 |
endif |
530 |
|
531 |
ifdef CONFIG_VNC_TLS |
532 |
CPPFLAGS += $(CONFIG_VNC_TLS_CFLAGS) |
533 |
LIBS += $(CONFIG_VNC_TLS_LIBS) |
534 |
endif |
535 |
|
536 |
ifdef CONFIG_VNC_SASL |
537 |
CPPFLAGS += $(CONFIG_VNC_SASL_CFLAGS) |
538 |
LIBS += $(CONFIG_VNC_SASL_LIBS) |
539 |
endif |
540 |
|
541 |
ifdef CONFIG_BLUEZ |
542 |
LIBS += $(CONFIG_BLUEZ_LIBS) |
543 |
endif |
544 |
|
545 |
# xen backend driver support |
546 |
obj-$(CONFIG_XEN) += xen_machine_pv.o xen_domainbuild.o |
547 |
ifeq ($(CONFIG_XEN), y) |
548 |
LIBS += $(XEN_LIBS) |
549 |
endif |
550 |
|
551 |
# USB layer |
552 |
obj-y += usb-ohci.o |
553 |
|
554 |
# PCI network cards |
555 |
obj-y += eepro100.o |
556 |
obj-y += ne2000.o |
557 |
obj-y += pcnet.o |
558 |
obj-y += rtl8139.o |
559 |
obj-y += e1000.o |
560 |
|
561 |
# Generic watchdog support and some watchdog devices |
562 |
obj-y += wdt_ib700.o wdt_i6300esb.o |
563 |
|
564 |
ifeq ($(TARGET_BASE_ARCH), i386) |
565 |
# Hardware support |
566 |
obj-y += ide.o pckbd.o vga.o $(sound-obj-y) dma.o |
567 |
obj-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o |
568 |
obj-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o |
569 |
obj-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o |
570 |
obj-y += device-hotplug.o pci-hotplug.o smbios.o |
571 |
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE |
572 |
endif |
573 |
ifeq ($(TARGET_BASE_ARCH), ppc) |
574 |
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE |
575 |
# shared objects |
576 |
obj-y += ppc.o ide.o vga.o $(sound-obj-y) dma.o openpic.o |
577 |
# PREP target |
578 |
obj-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o |
579 |
obj-y += prep_pci.o ppc_prep.o |
580 |
# Mac shared devices |
581 |
obj-y += macio.o cuda.o adb.o mac_nvram.o mac_dbdma.o |
582 |
# OldWorld PowerMac |
583 |
obj-y += heathrow_pic.o grackle_pci.o ppc_oldworld.o |
584 |
# NewWorld PowerMac |
585 |
obj-y += unin_pci.o ppc_newworld.o |
586 |
# PowerPC 4xx boards |
587 |
obj-y += pflash_cfi02.o ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o |
588 |
obj-y += ppc440.o ppc440_bamboo.o |
589 |
# PowerPC E500 boards |
590 |
obj-y += ppce500_pci.o ppce500_mpc8544ds.o |
591 |
ifdef FDT_LIBS |
592 |
obj-y += device_tree.o |
593 |
LIBS+= $(FDT_LIBS) |
594 |
endif |
595 |
obj-$(CONFIG_KVM) += kvm_ppc.o |
596 |
endif |
597 |
ifeq ($(TARGET_BASE_ARCH), mips) |
598 |
obj-y += mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o |
599 |
obj-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o |
600 |
obj-y += g364fb.o jazz_led.o dp8393x.o |
601 |
obj-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o |
602 |
obj-y += piix_pci.o parallel.o cirrus_vga.o pcspk.o $(sound-obj-y) |
603 |
obj-y += mipsnet.o |
604 |
obj-y += pflash_cfi01.o |
605 |
obj-y += vmware_vga.o |
606 |
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE |
607 |
endif |
608 |
ifeq ($(TARGET_BASE_ARCH), microblaze) |
609 |
obj-y += petalogix_s3adsp1800_mmu.o |
610 |
|
611 |
obj-y += microblaze_pic_cpu.o |
612 |
obj-y += xilinx_intc.o |
613 |
obj-y += xilinx_timer.o |
614 |
obj-y += xilinx_uartlite.o |
615 |
obj-y += xilinx_ethlite.o |
616 |
|
617 |
obj-y += pflash_cfi02.o |
618 |
ifdef FDT_LIBS |
619 |
obj-y += device_tree.o |
620 |
LIBS+= $(FDT_LIBS) |
621 |
endif |
622 |
endif |
623 |
ifeq ($(TARGET_BASE_ARCH), cris) |
624 |
# Boards |
625 |
obj-y += cris_pic_cpu.o etraxfs.o axis_dev88.o |
626 |
|
627 |
# IO blocks |
628 |
obj-y += etraxfs_dma.o |
629 |
obj-y += etraxfs_pic.o |
630 |
obj-y += etraxfs_eth.o |
631 |
obj-y += etraxfs_timer.o |
632 |
obj-y += etraxfs_ser.o |
633 |
|
634 |
obj-y += pflash_cfi02.o |
635 |
endif |
636 |
ifeq ($(TARGET_BASE_ARCH), sparc) |
637 |
ifeq ($(TARGET_ARCH), sparc64) |
638 |
obj-y += sun4u.o ide.o pckbd.o vga.o apb_pci.o |
639 |
obj-y += fdc.o mc146818rtc.o serial.o |
640 |
obj-y += cirrus_vga.o parallel.o |
641 |
else |
642 |
obj-y += sun4m.o tcx.o iommu.o slavio_intctl.o |
643 |
obj-y += slavio_timer.o slavio_misc.o fdc.o sparc32_dma.o |
644 |
obj-y += cs4231.o eccmemctl.o sbi.o sun4c_intctl.o |
645 |
endif |
646 |
endif |
647 |
ifeq ($(TARGET_BASE_ARCH), arm) |
648 |
obj-y += integratorcp.o versatilepb.o smc91c111.o arm_pic.o arm_timer.o |
649 |
obj-y += arm_boot.o pl011.o pl031.o pl050.o pl080.o pl110.o pl181.o pl190.o |
650 |
obj-y += versatile_pci.o |
651 |
obj-y += realview_gic.o realview.o arm_sysctl.o mpcore.o |
652 |
obj-y += armv7m.o armv7m_nvic.o stellaris.o pl022.o stellaris_enet.o |
653 |
obj-y += pl061.o |
654 |
obj-y += arm-semi.o |
655 |
obj-y += pxa2xx.o pxa2xx_pic.o pxa2xx_gpio.o pxa2xx_timer.o pxa2xx_dma.o |
656 |
obj-y += pxa2xx_lcd.o pxa2xx_mmci.o pxa2xx_pcmcia.o pxa2xx_keypad.o |
657 |
obj-y += pflash_cfi01.o gumstix.o |
658 |
obj-y += zaurus.o ide.o serial.o spitz.o tosa.o tc6393xb.o |
659 |
obj-y += omap1.o omap_lcdc.o omap_dma.o omap_clk.o omap_mmc.o omap_i2c.o |
660 |
obj-y += omap2.o omap_dss.o soc_dma.o |
661 |
obj-y += omap_sx1.o palm.o tsc210x.o |
662 |
obj-y += nseries.o blizzard.o onenand.o vga.o cbus.o tusb6010.o usb-musb.o |
663 |
obj-y += mst_fpga.o mainstone.o |
664 |
obj-y += musicpal.o pflash_cfi02.o |
665 |
obj-y += framebuffer.o |
666 |
obj-y += syborg.o syborg_fb.o syborg_interrupt.o syborg_keyboard.o |
667 |
obj-y += syborg_serial.o syborg_timer.o syborg_pointer.o syborg_rtc.o |
668 |
obj-y += syborg_virtio.o |
669 |
CPPFLAGS += -DHAS_AUDIO |
670 |
endif |
671 |
ifeq ($(TARGET_BASE_ARCH), sh4) |
672 |
obj-y += shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o |
673 |
obj-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o |
674 |
obj-y += ide.o |
675 |
endif |
676 |
ifeq ($(TARGET_BASE_ARCH), m68k) |
677 |
obj-y += an5206.o mcf5206.o mcf_uart.o mcf_intc.o mcf5208.o mcf_fec.o |
678 |
obj-y += m68k-semi.o dummy_m68k.o |
679 |
endif |
680 |
ifdef CONFIG_COCOA |
681 |
COCOA_LIBS=-F/System/Library/Frameworks -framework Cocoa -framework IOKit |
682 |
ifdef CONFIG_COREAUDIO |
683 |
COCOA_LIBS+=-framework CoreAudio |
684 |
endif |
685 |
endif |
686 |
ifdef CONFIG_SLIRP |
687 |
CPPFLAGS+=-I$(SRC_PATH)/slirp |
688 |
endif |
689 |
|
690 |
LIBS+=$(PTHREADLIBS) |
691 |
LIBS+=$(CLOCKLIBS) |
692 |
# specific flags are needed for non soft mmu emulator |
693 |
ifdef CONFIG_STATIC |
694 |
LDFLAGS+=-static |
695 |
endif |
696 |
ifndef CONFIG_DARWIN |
697 |
ifndef CONFIG_WIN32 |
698 |
ifndef CONFIG_SOLARIS |
699 |
ifndef CONFIG_AIX |
700 |
LIBS+=-lutil |
701 |
endif |
702 |
endif |
703 |
endif |
704 |
endif |
705 |
ifdef TARGET_GPROF |
706 |
vl.o: CFLAGS+=-p |
707 |
LDFLAGS+=-p |
708 |
endif |
709 |
|
710 |
ifeq ($(ARCH),ia64) |
711 |
LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld |
712 |
endif |
713 |
|
714 |
ifdef CONFIG_WIN32 |
715 |
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole |
716 |
endif |
717 |
|
718 |
# profiling code |
719 |
ifdef TARGET_GPROF |
720 |
LDFLAGS+=-p |
721 |
main.o: CFLAGS+=-p |
722 |
endif |
723 |
|
724 |
vl.o: CFLAGS+=$(SDL_CFLAGS) |
725 |
|
726 |
vl.o: qemu-options.h |
727 |
|
728 |
monitor.o: qemu-monitor.h |
729 |
|
730 |
$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS) |
731 |
$(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB) |
732 |
$(QEMU_PROG): $(obj-y) ../libqemu_common.a libqemu.a $(HWLIB) |
733 |
$(call LINK,$(obj-y)) |
734 |
|
735 |
endif # !CONFIG_USER_ONLY |
736 |
|
737 |
gdbstub-xml.c: $(TARGET_XML_FILES) feature_to_c.sh |
738 |
ifeq ($(TARGET_XML_FILES),) |
739 |
$(call quiet-command,rm -f $@ && echo > $@," GEN $(TARGET_DIR)$@") |
740 |
else |
741 |
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") |
742 |
endif |
743 |
|
744 |
qemu-options.h: $(SRC_PATH)/qemu-options.hx |
745 |
$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
746 |
|
747 |
qemu-monitor.h: $(SRC_PATH)/qemu-monitor.hx |
748 |
$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
749 |
|
750 |
clean: |
751 |
rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o |
752 |
rm -f *.d */*.d tcg/*.o |
753 |
rm -f qemu-options.h qemu-monitor.h gdbstub-xml.c |
754 |
|
755 |
install: all |
756 |
ifneq ($(PROGS),) |
757 |
$(INSTALL) -m 755 $(STRIP_OPT) $(PROGS) "$(DESTDIR)$(bindir)" |
758 |
endif |
759 |
|
760 |
# Include automatically generated dependency files |
761 |
-include $(wildcard *.d */*.d) |