blob: 5dbded4d73297d819eea73fe35dbfab34d5010b5 [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' Turner1d1a2af2014-01-10 16:17:40 +010048common_LOCAL_CFLAGS += -I$(GLIB_INCLUDE_DIR)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010049
50# The following is to ensure that "config.h" will map to a target-specific
51# configuration file header.
Andrew Hsiehc7389bd2012-03-13 02:13:40 -070052common_LOCAL_CFLAGS += $(EMULATOR_TARGET_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010053
Andrew Hsiehc7389bd2012-03-13 02:13:40 -070054common_LOCAL_SRC_FILES += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010055 tcg/tcg.c \
56
57##############################################################################
58# Emulated hardware devices.
59#
60
61HW_SOURCES := \
David 'Digit' Turner4b6bb762013-12-17 10:26:45 +010062 bt/core.c \
63 bt/hci.c \
64 bt/hid.c \
65 bt/l2cap.c \
66 bt/sdp.c \
David 'Digit' Turner4023ec82013-12-17 11:35:40 +010067 block/cdrom.c \
David 'Digit' Turner2ec695a2013-12-17 10:03:39 +010068 core/irq.c \
David 'Digit' Turner10745422013-12-17 10:05:40 +010069 core/qdev.c \
David 'Digit' Turner291300f2013-12-17 10:06:47 +010070 core/sysbus.c \
David 'Digit' Turnerf7c8d822013-12-17 14:02:11 +010071 core/dma.c \
David 'Digit' Turnerf0665422013-12-17 10:47:09 +010072 android/goldfish/audio.c \
73 android/goldfish/device.c \
74 android/goldfish/events_device.c \
75 android/goldfish/fb.c \
76 android/goldfish/battery.c \
77 android/goldfish/mmc.c \
78 android/goldfish/memlog.c \
79 android/goldfish/nand.c \
80 android/goldfish/pipe.c \
81 android/goldfish/tty.c \
82 android/goldfish/vmem.c \
David 'Digit' Turner7977bd62013-12-17 11:17:24 +010083 pci/pci.c \
David 'Digit' Turnerbe5c9712013-12-17 13:56:10 +010084 scsi/scsi-disk.c \
David 'Digit' Turner704463f2013-12-17 11:33:57 +010085 usb/dev-hid.c \
86 usb/dev-hub.c \
87 usb/dev-storage.c \
88 usb/hcd-ohci.c \
89 usb/core.c \
David 'Digit' Turnere2f74052013-12-17 11:29:40 +010090 watchdog/watchdog.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010091
David 'Digit' Turner42fc4492011-06-29 13:16:16 +020092
David 'Digit' Turneraff94b82011-02-07 18:10:54 +010093ifeq ($(EMULATOR_TARGET_ARCH),arm)
David 'Digit' Turnerd1298762013-12-17 10:22:24 +010094HW_SOURCES += \
David 'Digit' Turnerea066692013-12-17 14:03:28 +010095 android/android_arm.c \
David 'Digit' Turnerd1298762013-12-17 10:22:24 +010096 arm/pic.c \
97 arm/boot.c \
David 'Digit' Turnerf0665422013-12-17 10:47:09 +010098 android/goldfish/interrupt.c \
99 android/goldfish/switch.c \
100 android/goldfish/timer.c \
101 android/goldfish/trace.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100102
103# The following sources must be compiled with the final executables
104# because they contain device_init() or machine_init() statements.
David 'Digit' Turnerebf1de02013-12-17 13:57:47 +0100105HW_OBJ_SOURCES := hw/net/smc91c111.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100106HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
107
David 'Digit' Turnercc33b2d2013-12-15 00:09:42 +0100108common_LOCAL_SRC_FILES += disas/arm.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100109
110# smc91c111.c requires <zlib.h>
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700111common_LOCAL_CFLAGS += $(ZLIB_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100112endif
113
David 'Digit' Turner764a3c92011-05-05 12:40:49 +0200114# required to ensure we properly initialize virtual audio hardware
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700115common_LOCAL_CFLAGS += -DHAS_AUDIO
David 'Digit' Turner764a3c92011-05-05 12:40:49 +0200116
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100117ifeq ($(EMULATOR_TARGET_ARCH),x86)
118HW_SOURCES += \
David 'Digit' Turner3fbb6562013-12-17 10:08:21 +0100119 intc/apic.c \
David 'Digit' Turner91335252013-12-17 13:52:01 +0100120 intc/i8259.c \
David 'Digit' Turner6d7b5292013-12-17 13:53:17 +0100121 timer/mc146818rtc.c \
David 'Digit' Turnerbfa4dab2013-12-17 11:19:22 +0100122 pci-host/piix.c \
David 'Digit' Turner6459c4a2013-12-17 10:31:05 +0100123 timer/i8254.c \
David 'Digit' Turner7b769262013-12-17 13:54:37 +0100124 input/pckbd.c \
David 'Digit' Turner1079fa72013-12-17 13:55:27 +0100125 intc/ioapic.c \
David 'Digit' Turner4ecc3dd2013-12-17 11:16:00 +0100126 input/ps2.c \
David 'Digit' Turner343e9282013-12-17 13:56:48 +0100127 i386/smbios.c \
David 'Digit' Turnera367a102013-12-17 11:36:33 +0100128 nvram/fw_cfg.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100129
130# The following sources must be compiled with the final executables
131# because they contain device_init() or machine_init() statements.
132HW_OBJ_SOURCES := \
David 'Digit' Turner08405982013-12-17 11:35:00 +0100133 hw/net/ne2000.c \
David 'Digit' Turnerbb228542013-12-17 13:53:59 +0100134 hw/i386/pc.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100135
136HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
137
138endif
139
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700140ifeq ($(EMULATOR_TARGET_ARCH),mips)
141HW_SOURCES += \
David 'Digit' Turnerea066692013-12-17 14:03:28 +0100142 android/android_mips.c \
David 'Digit' Turneraf0fc432013-12-17 14:00:52 +0100143 mips/mips_pic.c \
David 'Digit' Turnerf0665422013-12-17 10:47:09 +0100144 android/goldfish/interrupt.c \
145 android/goldfish/switch.c \
146 android/goldfish/timer.c \
147 android/goldfish/trace.c \
David 'Digit' Turneraf0fc432013-12-17 14:00:52 +0100148 mips/cputimer.c \
149 mips/mips_int.c
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700150
151# The following sources must be compiled with the final executables
152# because they contain device_init() or machine_init() statements.
David 'Digit' Turnerebf1de02013-12-17 13:57:47 +0100153HW_OBJ_SOURCES := hw/net/smc91c111.c
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700154HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS)
155
David 'Digit' Turnercc33b2d2013-12-15 00:09:42 +0100156common_LOCAL_SRC_FILES += disas/mips.c
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700157
158# smc91c111.c requires <zlib.h>
159LOCAL_CFLAGS += $(ZLIB_CFLAGS)
160ifeq ($(ARCH_HAS_BIGENDIAN),true)
161 LOCAL_CFLAGS += -DTARGET_WORDS_BIGENDIAN
162endif
163
164endif
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700165common_LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100166
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700167common_LOCAL_SRC_FILES += \
David 'Digit' Turner2a0488a2013-12-17 11:22:12 +0100168 backends/msmouse.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100169 cpu-exec.c \
David 'Digit' Turner3dc53fc2014-01-17 01:23:40 +0100170 cputlb.c \
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200171 exec.c \
David 'Digit' Turneraa1180c2014-01-28 06:08:00 +0100172 monitor-android.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100173 translate-all.c \
David 'Digit' Turner13209b92013-12-17 09:54:09 +0100174 android/varint.c \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700175 softmmu_outside_jit.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100176
177##############################################################################
178# CPU-specific emulation.
179#
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700180common_LOCAL_CFLAGS += -fno-PIC -fomit-frame-pointer -Wno-sign-compare
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100181
182ifeq ($(HOST_ARCH),ppc)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700183 common_LOCAL_CFLAGS += -D__powerpc__
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100184endif
185
186ifeq ($(EMULATOR_TARGET_ARCH),arm)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700187common_LOCAL_SRC_FILES += \
David 'Digit' Turner82a591c2013-12-17 09:10:58 +0100188 target-arm/arm-semi.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100189 target-arm/op_helper.c \
190 target-arm/iwmmxt_helper.c \
191 target-arm/neon_helper.c \
192 target-arm/helper.c \
David 'Digit' Turner288208c2011-05-11 19:37:35 +0200193 target-arm/helper-android.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100194 target-arm/translate.c \
195 target-arm/machine.c \
David 'Digit' Turnercd0c34b2013-12-17 10:19:44 +0100196 hw/arm/armv7m.c \
197 hw/arm/armv7m_nvic.c
David 'Digit' Turnere2288402014-01-09 18:35:14 +0100198endif # EMULATOR_TARGET_ARCH == arm
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100199
200ifeq ($(EMULATOR_TARGET_ARCH), x86)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700201common_LOCAL_SRC_FILES += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100202 target-i386/op_helper.c \
203 target-i386/helper.c \
204 target-i386/translate.c \
205 target-i386/machine.c \
206
Jun Nakajimae4a3c782011-12-17 19:22:12 -0800207ifeq ($(HOST_OS),darwin)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700208common_LOCAL_SRC_FILES += \
Jun Nakajimae4a3c782011-12-17 19:22:12 -0800209 target-i386/hax-all.c \
210 target-i386/hax-darwin.c
211endif
212
213ifeq ($(HOST_OS),windows)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700214common_LOCAL_SRC_FILES += \
Jun Nakajimae4a3c782011-12-17 19:22:12 -0800215 target-i386/hax-all.c \
216 target-i386/hax-windows.c
217endif
David 'Digit' Turnere2288402014-01-09 18:35:14 +0100218endif # EMULATOR_TARGET_ARCH == x86
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100219
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
David 'Digit' Turnere2288402014-01-09 18:35:14 +0100226endif # EMULATOR_TARGET_ARCH == mips
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700227
228common_LOCAL_SRC_FILES += fpu/softfloat.c
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700229
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)
David 'Digit' Turner1c31e3e2013-12-14 20:07:17 +0100269 common_LOCAL_SRC_FILES += os-win32.c util/oslib-win32.c
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200270else
David 'Digit' Turner1c31e3e2013-12-14 20:07:17 +0100271 common_LOCAL_SRC_FILES += os-posix.c util/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)),)
David 'Digit' Turnerf6f50072014-01-14 14:39:13 +0100285 $(call start-emulator-library, emulator64-target-$(EMULATOR_TARGET_CPU))
286 LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
287 LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
288 $(call gen-hw-config-defs)
289 $(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c)
290 $(call end-emulator-library)
Andrew Hsieh83df59c2012-07-24 16:06:28 -0700291endif # HOST_OS == linux || darwin
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700292
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100293##############################################################################
294##############################################################################
295###
296### emulator-$ARCH: Standalone emulator program
297###
298###
299
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700300common_LOCAL_LDLIBS =
301common_LOCAL_CFLAGS =
302common_LOCAL_SRC_FILES =
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100303
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700304
305common_LOCAL_STATIC_LIBRARIES := \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100306 emulator-libui \
307 emulator-libqemu \
308 emulator-target-$(EMULATOR_TARGET_CPU) \
309 emulator-libelff \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700310 emulator-common
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100311
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700312common_LOCAL_LDLIBS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100313 $(EMULATOR_COMMON_LDLIBS) \
314 $(EMULATOR_LIBQEMU_LDLIBS) \
315 $(EMULATOR_LIBUI_LDLIBS) \
Bhanu Chetlapalli741dc132012-05-08 17:16:03 -0700316 $(ELFF_LDLIBS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100317
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700318common_LOCAL_CFLAGS += \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100319 $(EMULATOR_TARGET_CFLAGS) \
320 $(EMULATOR_COMMON_CFLAGS) \
321 $(EMULATOR_LIBQEMU_CFLAGS) \
322 $(EMULATOR_LIBUI_CFLAGS)
323
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700324common_LOCAL_SRC_FILES := \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100325 audio/audio.c \
326 disas.c \
327 dma-helpers.c \
328 gdbstub.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100329 qemu-timer.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100330 vl-android.c \
331 android/cmdline-option.c \
332 android/console.c \
333 android/display.c \
334 android/display-core.c \
335 android/help.c \
336 android/main-common.c \
337 android/main.c \
David 'Digit' Turnercb88e792011-08-26 01:35:14 +0200338 android/opengles.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100339 android/protocol/core-commands-qemu.c \
340 android/protocol/ui-commands-qemu.c \
David 'Digit' Turnerd4e803c2013-12-14 23:45:50 +0100341 android/user-events-qemu.c \
David 'Digit' Turner70a98202013-12-17 09:30:04 +0100342 hw/core/loader.c \
David 'Digit' Turner852088c2013-12-14 23:04:12 +0100343 ui/keymaps.c \
David 'Digit' Turnera18ede02014-02-06 14:30:48 +0100344 util/qemu-timer-common.c \
David 'Digit' Turner1befd342014-01-15 17:56:45 +0100345 util/iov.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100346
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100347
348# The following files cannot be in static libraries because they contain
349# constructor functions that are otherwise stripped by the final linker
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700350common_LOCAL_SRC_FILES += $(HW_OBJ_SOURCES)
351common_LOCAL_CFLAGS += $(HW_OBJ_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100352
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700353common_LOCAL_SRC_FILES += $(BLOCK_SOURCES)
354common_LOCAL_CFLAGS += $(BLOCK_CFLAGS)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100355
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700356common_LOCAL_SRC_FILES += $(SDLMAIN_SOURCES)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100357
358# Generate a completely static executable if needed.
359# Note that this means no sound and graphics on Linux.
360#
Andrew Hsieh632a0e12012-04-28 00:48:53 +0800361ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),)
David 'Digit' Turner1634ff52013-12-14 23:31:41 +0100362 common_LOCAL_SRC_FILES += android/dynlink-static.c
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700363 common_LOCAL_LDLIBS += -static
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100364endif
365
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700366## one for 32-bit
367$(call start-emulator-program, emulator-$(EMULATOR_TARGET_ARCH))
368LOCAL_STATIC_LIBRARIES += \
369 emulator-libui \
370 emulator-libqemu \
371 emulator-target-$(EMULATOR_TARGET_CPU) \
Lars Poeschel33da99a2012-08-22 09:42:42 +0200372 emulator-libjpeg \
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700373 emulator-libelff \
374 emulator-common \
375 $(SDL_STATIC_LIBRARIES)
376LOCAL_LDLIBS += $(common_LOCAL_LDLIBS)
377LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
378LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700379$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
380$(call gen-hw-config-defs)
Raphael Mollcdbea232012-05-04 15:04:27 -0700381
382ifeq ($(HOST_OS),windows)
383$(eval $(call insert-windows-icon))
384endif
385
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100386$(call end-emulator-program)
Andrew Hsiehc7389bd2012-03-13 02:13:40 -0700387
388
389## another for 64-bit, see note in file Makefile.common emulator64-common
Andrew Hsieh83df59c2012-07-24 16:06:28 -0700390ifneq ($(filter linux darwin,$(HOST_OS)),)
David 'Digit' Turnerf6f50072014-01-14 14:39:13 +0100391 $(call start-emulator-program, emulator64-$(EMULATOR_TARGET_ARCH))
392 LOCAL_STATIC_LIBRARIES += \
393 emulator64-libui \
394 emulator64-libqemu \
395 emulator64-target-$(EMULATOR_TARGET_CPU) \
396 emulator64-libjpeg \
397 emulator64-libelff \
398 emulator64-common \
399 $(SDL_STATIC_LIBRARIES_64)
400 LOCAL_LDLIBS += $(common_LOCAL_LDLIBS) -m64
401 LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
402 LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
David 'Digit' Turnerf6f50072014-01-14 14:39:13 +0100403 $(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
404 $(call gen-hw-config-defs)
405 $(call end-emulator-program)
Andrew Hsieh83df59c2012-07-24 16:06:28 -0700406endif # HOST_OS == linux || darwin
Raphael Mollcdbea232012-05-04 15:04:27 -0700407