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