blob: 608761c87b837554fb3b33bb4ff23ab620e240bf [file] [log] [blame]
David 'Digit' Turneraff94b82011-02-07 18:10:54 +01001# This file is included several times to build target-specific
2# modules for the Android emulator. It will be called several times
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -07003# for arm, x86 and mips
David 'Digit' Turneraff94b82011-02-07 18:10:54 +01004#
5
6ifndef EMULATOR_TARGET_ARCH
7$(error EMULATOR_TARGET_ARCH is not defined!)
8endif
9
10EMULATOR_TARGET_CPU := $(EMULATOR_TARGET_ARCH)
11ifeq ($(EMULATOR_TARGET_CPU),x86)
12 EMULATOR_TARGET_CPU := i386
13endif
14
15##############################################################################
16##############################################################################
17###
18### emulator-target-$CPU: target-specific emulation code.
19###
20### Used by both the core and standalone programs.
21###
22
23# Common compiler flags for all target-dependent libraries
24EMULATOR_TARGET_CFLAGS := \
25 -I$(LOCAL_PATH)/android/config/$(HOST_PREBUILT_TAG) \
26 -I$(LOCAL_PATH)/android/config/target-$(EMULATOR_TARGET_ARCH) \
27 -I$(LOCAL_PATH)/target-$(EMULATOR_TARGET_CPU) \
28 -I$(LOCAL_PATH)/fpu \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -070029 -DNEED_CPU_H
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010030
31TCG_TARGET := $(HOST_ARCH)
David 'Digit' Turnerf1d9bf12011-05-11 18:19:41 +020032ifeq ($(HOST_ARCH),x86)
33 TCG_TARGET := i386
34endif
35ifeq ($(HOST_ARCH),x86_64)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010036 TCG_TARGET := i386
37endif
38
39EMULATOR_TARGET_CFLAGS += \
40 -I$(LOCAL_PATH)/tcg \
41 -I$(LOCAL_PATH)/tcg/$(TCG_TARGET) \
42 -DTARGET_ARCH=\"$(EMULATOR_TARGET_ARCH)\"
43
44
Andrew Hsiehc7389bd2012-03-13 02:13:40 -070045common_LOCAL_CFLAGS =
46common_LOCAL_SRC_FILES =
47
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010048
49# The following is to ensure that "config.h" will map to a target-specific
50# configuration file header.
Andrew Hsiehc7389bd2012-03-13 02:13:40 -070051common_LOCAL_CFLAGS += $(EMULATOR_TARGET_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010052
Andrew Hsiehc7389bd2012-03-13 02:13:40 -070053common_LOCAL_SRC_FILES += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010054 tcg/tcg.c \
55
56##############################################################################
57# Emulated hardware devices.
58#
59
60HW_SOURCES := \
61 bt.c \
62 bt-hci.c \
63 bt-hid.c \
64 bt-l2cap.c \
65 bt-sdp.c \
66 cdrom.c \
67 dma.c \
68 irq.c \
Jun Nakajima6f198362011-02-24 13:16:01 -080069 goldfish_audio.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010070 goldfish_device.c \
71 goldfish_events_device.c \
72 goldfish_fb.c \
73 goldfish_battery.c \
74 goldfish_mmc.c \
75 goldfish_memlog.c \
76 goldfish_nand.c \
David 'Digit' Turner89217f52011-03-21 17:51:03 +010077 goldfish_pipe.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010078 goldfish_tty.c \
79 msmouse.c \
80 pci.c \
81 qdev.c \
82 scsi-disk.c \
83 sysbus.c \
84 usb-hid.c \
85 usb-hub.c \
86 usb-msd.c \
87 usb-ohci.c \
88 usb.c \
89 watchdog.c
90
David 'Digit' Turner42fc4492011-06-29 13:16:16 +020091
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010092ifeq ($(EMULATOR_TARGET_ARCH),arm)
93HW_SOURCES += android_arm.c \
94 arm_pic.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010095 goldfish_interrupt.c \
96 goldfish_switch.c \
97 goldfish_timer.c \
98 goldfish_trace.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -070099 arm_boot.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100100
101# The following sources must be compiled with the final executables
102# because they contain device_init() or machine_init() statements.
103HW_OBJ_SOURCES := hw/smc91c111.c
104HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
105
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700106common_LOCAL_SRC_FILES += arm-dis.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100107
108# smc91c111.c requires <zlib.h>
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700109common_LOCAL_CFLAGS += $(ZLIB_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100110endif
111
David 'Digit' Turner764a3c92011-05-05 12:40:49 +0200112# required to ensure we properly initialize virtual audio hardware
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700113common_LOCAL_CFLAGS += -DHAS_AUDIO
David 'Digit' Turner764a3c92011-05-05 12:40:49 +0200114
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100115ifeq ($(EMULATOR_TARGET_ARCH),x86)
116HW_SOURCES += \
117 apic.c \
118 i8259.c \
119 mc146818rtc.c \
120 piix_pci.c \
121 i8254.c \
122 pckbd.c \
123 ioapic.c \
124 ps2.c \
125 smbios.c \
126 fw_cfg.c
127
128# The following sources must be compiled with the final executables
129# because they contain device_init() or machine_init() statements.
130HW_OBJ_SOURCES := \
131 hw/ne2000.c \
132 hw/pc.c
133
134HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
135
136endif
137
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700138ifeq ($(EMULATOR_TARGET_ARCH),mips)
139HW_SOURCES += \
140 android_mips.c \
141 mips_pic.c \
142 goldfish_interrupt.c \
143 goldfish_switch.c \
144 goldfish_timer.c \
145 goldfish_trace.c \
146 mips_timer.c \
147 mips_int.c
148
149# The following sources must be compiled with the final executables
150# because they contain device_init() or machine_init() statements.
151HW_OBJ_SOURCES := hw/smc91c111.c
152HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
153
154common_LOCAL_SRC_FILES += mips-dis.c
155
156# smc91c111.c requires <zlib.h>
157LOCAL_CFLAGS += $(ZLIB_CFLAGS)
158ifeq ($(ARCH_HAS_BIGENDIAN),true)
159 LOCAL_CFLAGS += -DTARGET_WORDS_BIGENDIAN
160endif
161
162endif
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700163common_LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100164
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700165common_LOCAL_SRC_FILES += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100166 cpu-exec.c \
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200167 exec.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100168 translate-all.c \
169 trace.c \
170 varint.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700171 softmmu_outside_jit.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100172
173##############################################################################
174# CPU-specific emulation.
175#
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700176common_LOCAL_CFLAGS += -fno-PIC -fomit-frame-pointer -Wno-sign-compare
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100177
178ifeq ($(HOST_ARCH),ppc)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700179 common_LOCAL_CFLAGS += -D__powerpc__
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100180endif
181
182ifeq ($(EMULATOR_TARGET_ARCH),arm)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700183common_LOCAL_SRC_FILES += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100184 target-arm/op_helper.c \
185 target-arm/iwmmxt_helper.c \
186 target-arm/neon_helper.c \
187 target-arm/helper.c \
David 'Digit' Turner288208c2011-05-11 19:37:35 +0200188 target-arm/helper-android.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100189 target-arm/translate.c \
190 target-arm/machine.c \
191 hw/armv7m.c \
192 hw/armv7m_nvic.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700193 arm-semi.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100194
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700195common_LOCAL_SRC_FILES += fpu/softfloat.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100196endif
197
198ifeq ($(EMULATOR_TARGET_ARCH), x86)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700199common_LOCAL_SRC_FILES += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100200 target-i386/op_helper.c \
201 target-i386/helper.c \
202 target-i386/translate.c \
203 target-i386/machine.c \
204
Jun Nakajimae4a3c782011-12-17 19:22:12 -0800205ifeq ($(HOST_OS),darwin)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700206common_LOCAL_SRC_FILES += \
Jun Nakajimae4a3c782011-12-17 19:22:12 -0800207 target-i386/hax-all.c \
208 target-i386/hax-darwin.c
209endif
210
211ifeq ($(HOST_OS),windows)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700212common_LOCAL_SRC_FILES += \
Jun Nakajimae4a3c782011-12-17 19:22:12 -0800213 target-i386/hax-all.c \
214 target-i386/hax-windows.c
215endif
216
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700217common_LOCAL_SRC_FILES += fpu/softfloat-native.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100218endif
219
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700220ifeq ($(EMULATOR_TARGET_ARCH), mips)
221common_LOCAL_SRC_FILES += \
222 target-mips/op_helper.c \
223 target-mips/helper.c \
224 target-mips/translate.c \
225 target-mips/machine.c
226
227common_LOCAL_SRC_FILES += fpu/softfloat.c
228endif
229
Jun Nakajima1321c762011-03-04 17:17:45 -0800230# compile KVM only if target is x86 on x86 Linux
David 'Digit' Turner36597752011-05-20 01:18:01 +0200231QEMU_KVM_TAG := $(QEMU_HOST_TAG)-$(EMULATOR_TARGET_ARCH)
232QEMU_DO_KVM := $(if $(filter linux-x86-x86 linux-x86_64-x86,$(QEMU_KVM_TAG)),true,false)
233ifeq ($(QEMU_DO_KVM),true)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700234 common_LOCAL_SRC_FILES += \
David 'Digit' Turner36597752011-05-20 01:18:01 +0200235 target-i386/kvm.c \
Jun Nakajimabb0140b2011-05-27 18:24:21 -0700236 target-i386/kvm-gs-restore.c \
David 'Digit' Turner36597752011-05-20 01:18:01 +0200237 kvm-all.c \
238 kvm-android.c
Jun Nakajima1321c762011-03-04 17:17:45 -0800239endif
240
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100241##############################################################################
242# Memory-access checking support.
243# Memory access checker uses information collected by instrumented code in
244# libc.so in order to keep track of memory blocks allocated from heap. Memory
245# checker then uses this information to make sure that every access to allocated
246# memory is within allocated block. This information also allows detecting
247# memory leaks and attempts to free/realloc invalid pointers.
248#
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700249common_LOCAL_CFLAGS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100250 -I$(LOCAL_PATH)/memcheck \
251 -I$(LOCAL_PATH)/elff
252
253MCHK_SOURCES := \
254 memcheck.c \
255 memcheck_proc_management.c \
256 memcheck_malloc_map.c \
257 memcheck_mmrange_map.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700258 memcheck_util.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100259
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700260common_LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100261
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700262common_LOCAL_SRC_FILES += \
David 'Digit' Turnerae3098a2011-05-11 16:01:57 +0200263 cpus.c \
264 arch_init.c
265
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200266# What a mess, os-posix.c depends on the exact values of options
267# which are target specific.
268ifeq ($(HOST_OS),windows)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700269 common_LOCAL_SRC_FILES += os-win32.c oslib-win32.c
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200270else
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700271 common_LOCAL_SRC_FILES += os-posix.c oslib-posix.c
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200272endif
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100273
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700274
275## one for 32-bit
276$(call start-emulator-library, emulator-target-$(EMULATOR_TARGET_CPU))
277LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
278LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
279$(call gen-hw-config-defs)
280$(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100281$(call end-emulator-library)
282
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700283## another for 64-bit, see note in file Makefile.common emulator64-common
Andrew Hsiehd0f2ab62012-03-23 17:35:11 +0800284ifeq ($(HOST_OS),linux)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700285 ifneq ($(BUILD_STANDALONE_EMULATOR),true)
286 $(call start-emulator-library, emulator64-target-$(EMULATOR_TARGET_CPU))
287 LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
288 LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
289 $(call gen-hw-config-defs)
290 $(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c)
291 $(call end-emulator-library)
292 endif # BUILD_STANDALONE_EMULATOR == nil
293endif # HOST_OS == linux
294
295
296
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100297##############################################################################
298##############################################################################
299###
300### qemu-android-$CPU: headless emulator core program
301###
302###
303$(call start-emulator-program, qemu-android-$(EMULATOR_TARGET_ARCH))
304
305LOCAL_CFLAGS += \
306 $(EMULATOR_COMMON_CFLAGS) \
307 $(ELFF_CFLAGS) \
308 $(EMULATOR_LIBQEMU_CFLAGS) \
309 $(EMULATOR_TARGET_CFLAGS) \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700310 -DCONFIG_STANDALONE_CORE
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100311
Jesse Hall183e9272012-04-26 15:13:27 -0700312ifneq ($(QEMU_OPENGLES_INCLUDE),)
313 LOCAL_CFLAGS += -I$(QEMU_OPENGLES_INCLUDE)
314endif
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100315
Jesse Hall183e9272012-04-26 15:13:27 -0700316LOCAL_CFLAGS += -Wno-missing-field-initializers
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100317
318LOCAL_STATIC_LIBRARIES := \
319 emulator-libqemu \
320 emulator-target-$(EMULATOR_TARGET_CPU) \
321 emulator-libelff \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700322 emulator-common
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100323
324LOCAL_LDLIBS += \
325 $(EMULATOR_COMMON_LDLIBS) \
326 $(EMULATOR_LIBQEMU_LDLIBS) \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700327 $(ELFF_LDLIBS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100328
329LOCAL_SRC_FILES := \
330 audio/audio.c \
331 disas.c \
332 dma-helpers.c \
333 gdbstub.c \
334 keymaps.c \
335 loader.c \
336 monitor.c \
337 qemu-timer.c \
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200338 qemu-timer-common.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100339 user-events-qemu.c \
340 vl-android.c \
341 android/console.c \
David 'Digit' Turnercb88e792011-08-26 01:35:14 +0200342 android/opengles.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100343 android/display-core.c \
344 android/protocol/attach-ui-proxy.c \
345 android/protocol/fb-updates-proxy.c \
346 android/protocol/user-events-impl.c \
347 android/protocol/ui-commands-proxy.c \
348 android/protocol/core-commands-impl.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700349 android/protocol/core-commands-qemu.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100350
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200351$(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200352$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
David 'Digit' Turner42fc4492011-06-29 13:16:16 +0200353$(call gen-hw-config-defs)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100354
355ifeq ($(HOST_OS),darwin)
356 FRAMEWORKS := OpenGL Cocoa QuickTime ApplicationServices Carbon IOKit
357 LOCAL_LDLIBS += $(FRAMEWORKS:%=-Wl,-framework,%)
358endif
359
360# Generate a completely static executable if needed.
361# Note that this means no sound and graphics on Linux.
362#
Andrew Hsieh632a0e12012-04-28 00:48:53 +0800363ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100364 LOCAL_SRC_FILES += dynlink-static.c
365 LOCAL_LDLIBS += -static
366endif
367
368# The following files cannot be in static libraries because they contain
369# constructor functions that are otherwise stripped by the final linker
370LOCAL_SRC_FILES += $(HW_OBJ_SOURCES)
371LOCAL_CFLAGS += $(HW_OBJ_CFLAGS)
372
373LOCAL_SRC_FILES += $(BLOCK_SOURCES)
374LOCAL_CFLAGS += $(BLOCK_CFLAGS)
375
376LOCAL_MODULE_TAGS := debug
377
378$(call end-emulator-program)
379
380##############################################################################
381##############################################################################
382###
383### emulator-$ARCH: Standalone emulator program
384###
385###
386
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700387common_LOCAL_LDLIBS =
388common_LOCAL_CFLAGS =
389common_LOCAL_SRC_FILES =
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100390
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700391
392common_LOCAL_STATIC_LIBRARIES := \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100393 emulator-libui \
394 emulator-libqemu \
395 emulator-target-$(EMULATOR_TARGET_CPU) \
396 emulator-libelff \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700397 emulator-common
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100398
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700399common_LOCAL_LDLIBS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100400 $(EMULATOR_COMMON_LDLIBS) \
401 $(EMULATOR_LIBQEMU_LDLIBS) \
402 $(EMULATOR_LIBUI_LDLIBS) \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700403 $(ELFF_LDLIBS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100404
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700405common_LOCAL_CFLAGS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100406 $(EMULATOR_TARGET_CFLAGS) \
407 $(EMULATOR_COMMON_CFLAGS) \
408 $(EMULATOR_LIBQEMU_CFLAGS) \
409 $(EMULATOR_LIBUI_CFLAGS)
410
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700411common_LOCAL_SRC_FILES := \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100412 audio/audio.c \
413 disas.c \
414 dma-helpers.c \
415 gdbstub.c \
416 keymaps.c \
417 loader.c \
418 monitor.c \
419 qemu-timer.c \
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200420 qemu-timer-common.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100421 user-events-qemu.c \
422 vl-android.c \
423 android/cmdline-option.c \
424 android/console.c \
425 android/display.c \
426 android/display-core.c \
427 android/help.c \
428 android/main-common.c \
429 android/main.c \
David 'Digit' Turnercb88e792011-08-26 01:35:14 +0200430 android/opengles.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100431 android/protocol/core-commands-qemu.c \
432 android/protocol/ui-commands-qemu.c \
433 android/
434
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100435
436# The following files cannot be in static libraries because they contain
437# constructor functions that are otherwise stripped by the final linker
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700438common_LOCAL_SRC_FILES += $(HW_OBJ_SOURCES)
439common_LOCAL_CFLAGS += $(HW_OBJ_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100440
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700441common_LOCAL_SRC_FILES += $(BLOCK_SOURCES)
442common_LOCAL_CFLAGS += $(BLOCK_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100443
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700444common_LOCAL_SRC_FILES += $(SDLMAIN_SOURCES)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100445
446# Generate a completely static executable if needed.
447# Note that this means no sound and graphics on Linux.
448#
Andrew Hsieh632a0e12012-04-28 00:48:53 +0800449ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700450 common_LOCAL_SRC_FILES += dynlink-static.c
451 common_LOCAL_LDLIBS += -static
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100452endif
453
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700454## one for 32-bit
455$(call start-emulator-program, emulator-$(EMULATOR_TARGET_ARCH))
456LOCAL_STATIC_LIBRARIES += \
457 emulator-libui \
458 emulator-libqemu \
459 emulator-target-$(EMULATOR_TARGET_CPU) \
460 emulator-libelff \
461 emulator-common \
462 $(SDL_STATIC_LIBRARIES)
463LOCAL_LDLIBS += $(common_LOCAL_LDLIBS)
464LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
465LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
466$(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
467$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
468$(call gen-hw-config-defs)
Raphael Mollcdbea232012-05-04 15:04:27 -0700469
470ifeq ($(HOST_OS),windows)
471$(eval $(call insert-windows-icon))
472endif
473
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100474$(call end-emulator-program)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700475
476
477## another for 64-bit, see note in file Makefile.common emulator64-common
Andrew Hsiehd0f2ab62012-03-23 17:35:11 +0800478ifeq ($(HOST_OS),linux)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700479 ifneq ($(BUILD_STANDALONE_EMULATOR),true)
480 $(call start-emulator-program, emulator64-$(EMULATOR_TARGET_ARCH))
481 LOCAL_STATIC_LIBRARIES += \
482 emulator64-libui \
483 emulator64-libqemu \
484 emulator64-target-$(EMULATOR_TARGET_CPU) \
485 emulator64-libelff \
486 emulator64-common \
487 $(SDL_STATIC_LIBRARIES_64)
488 LOCAL_LDLIBS += $(common_LOCAL_LDLIBS) -m64
489 LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
490 LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
491 $(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
492 $(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
493 $(call gen-hw-config-defs)
494 $(call end-emulator-program)
495 endif # BUILD_STANDALONE_EMULATOR == nil
496endif # HOST_OS == linux
Raphael Mollcdbea232012-05-04 15:04:27 -0700497