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