blob: 3e45c61473b73c8993f7b6db0385c4d915f27ac9 [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 Hsieh83df59c2012-07-24 16:06:28 -0700284ifneq ($(filter linux darwin,$(HOST_OS)),)
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
Andrew Hsieh83df59c2012-07-24 16:06:28 -0700293endif # HOST_OS == linux || darwin
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700294
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) \
Lars Poeschel33da99a2012-08-22 09:42:42 +0200321 emulator-libjpeg \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100322 emulator-libelff \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700323 emulator-common
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100324
325LOCAL_LDLIBS += \
326 $(EMULATOR_COMMON_LDLIBS) \
327 $(EMULATOR_LIBQEMU_LDLIBS) \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700328 $(ELFF_LDLIBS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100329
330LOCAL_SRC_FILES := \
331 audio/audio.c \
332 disas.c \
333 dma-helpers.c \
334 gdbstub.c \
335 keymaps.c \
336 loader.c \
337 monitor.c \
338 qemu-timer.c \
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200339 qemu-timer-common.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100340 user-events-qemu.c \
341 vl-android.c \
342 android/console.c \
David 'Digit' Turnercb88e792011-08-26 01:35:14 +0200343 android/opengles.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100344 android/display-core.c \
345 android/protocol/attach-ui-proxy.c \
346 android/protocol/fb-updates-proxy.c \
347 android/protocol/user-events-impl.c \
348 android/protocol/ui-commands-proxy.c \
349 android/protocol/core-commands-impl.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700350 android/protocol/core-commands-qemu.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100351
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200352$(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200353$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
David 'Digit' Turner42fc4492011-06-29 13:16:16 +0200354$(call gen-hw-config-defs)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100355
356ifeq ($(HOST_OS),darwin)
357 FRAMEWORKS := OpenGL Cocoa QuickTime ApplicationServices Carbon IOKit
358 LOCAL_LDLIBS += $(FRAMEWORKS:%=-Wl,-framework,%)
359endif
360
361# Generate a completely static executable if needed.
362# Note that this means no sound and graphics on Linux.
363#
Andrew Hsieh632a0e12012-04-28 00:48:53 +0800364ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100365 LOCAL_SRC_FILES += dynlink-static.c
366 LOCAL_LDLIBS += -static
367endif
368
369# The following files cannot be in static libraries because they contain
370# constructor functions that are otherwise stripped by the final linker
371LOCAL_SRC_FILES += $(HW_OBJ_SOURCES)
372LOCAL_CFLAGS += $(HW_OBJ_CFLAGS)
373
374LOCAL_SRC_FILES += $(BLOCK_SOURCES)
375LOCAL_CFLAGS += $(BLOCK_CFLAGS)
376
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100377$(call end-emulator-program)
378
379##############################################################################
380##############################################################################
381###
382### emulator-$ARCH: Standalone emulator program
383###
384###
385
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700386common_LOCAL_LDLIBS =
387common_LOCAL_CFLAGS =
388common_LOCAL_SRC_FILES =
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100389
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700390
391common_LOCAL_STATIC_LIBRARIES := \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100392 emulator-libui \
393 emulator-libqemu \
394 emulator-target-$(EMULATOR_TARGET_CPU) \
395 emulator-libelff \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700396 emulator-common
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100397
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700398common_LOCAL_LDLIBS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100399 $(EMULATOR_COMMON_LDLIBS) \
400 $(EMULATOR_LIBQEMU_LDLIBS) \
401 $(EMULATOR_LIBUI_LDLIBS) \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700402 $(ELFF_LDLIBS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100403
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700404common_LOCAL_CFLAGS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100405 $(EMULATOR_TARGET_CFLAGS) \
406 $(EMULATOR_COMMON_CFLAGS) \
407 $(EMULATOR_LIBQEMU_CFLAGS) \
408 $(EMULATOR_LIBUI_CFLAGS)
409
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700410common_LOCAL_SRC_FILES := \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100411 audio/audio.c \
412 disas.c \
413 dma-helpers.c \
414 gdbstub.c \
415 keymaps.c \
416 loader.c \
417 monitor.c \
418 qemu-timer.c \
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200419 qemu-timer-common.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100420 user-events-qemu.c \
421 vl-android.c \
422 android/cmdline-option.c \
423 android/console.c \
424 android/display.c \
425 android/display-core.c \
426 android/help.c \
427 android/main-common.c \
428 android/main.c \
David 'Digit' Turnercb88e792011-08-26 01:35:14 +0200429 android/opengles.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100430 android/protocol/core-commands-qemu.c \
431 android/protocol/ui-commands-qemu.c \
432 android/
433
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100434
435# The following files cannot be in static libraries because they contain
436# constructor functions that are otherwise stripped by the final linker
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700437common_LOCAL_SRC_FILES += $(HW_OBJ_SOURCES)
438common_LOCAL_CFLAGS += $(HW_OBJ_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100439
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700440common_LOCAL_SRC_FILES += $(BLOCK_SOURCES)
441common_LOCAL_CFLAGS += $(BLOCK_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100442
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700443common_LOCAL_SRC_FILES += $(SDLMAIN_SOURCES)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100444
445# Generate a completely static executable if needed.
446# Note that this means no sound and graphics on Linux.
447#
Andrew Hsieh632a0e12012-04-28 00:48:53 +0800448ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700449 common_LOCAL_SRC_FILES += dynlink-static.c
450 common_LOCAL_LDLIBS += -static
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100451endif
452
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700453## one for 32-bit
454$(call start-emulator-program, emulator-$(EMULATOR_TARGET_ARCH))
455LOCAL_STATIC_LIBRARIES += \
456 emulator-libui \
457 emulator-libqemu \
458 emulator-target-$(EMULATOR_TARGET_CPU) \
Lars Poeschel33da99a2012-08-22 09:42:42 +0200459 emulator-libjpeg \
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700460 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 Hsieh83df59c2012-07-24 16:06:28 -0700478ifneq ($(filter linux darwin,$(HOST_OS)),)
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) \
Lars Poeschel33da99a2012-08-22 09:42:42 +0200485 emulator64-libjpeg \
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700486 emulator64-libelff \
487 emulator64-common \
488 $(SDL_STATIC_LIBRARIES_64)
489 LOCAL_LDLIBS += $(common_LOCAL_LDLIBS) -m64
490 LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
491 LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
492 $(call gen-hx-header,qemu-monitor.hx,qemu-monitor.h,monitor.c)
493 $(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
494 $(call gen-hw-config-defs)
495 $(call end-emulator-program)
496 endif # BUILD_STANDALONE_EMULATOR == nil
Andrew Hsieh83df59c2012-07-24 16:06:28 -0700497endif # HOST_OS == linux || darwin
Raphael Mollcdbea232012-05-04 15:04:27 -0700498