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