forked from aosp-mirror/platform_external_qemu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.qemu1-target.mk
261 lines (225 loc) · 6.44 KB
/
Makefile.qemu1-target.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# This file is included several times to build target-specific
# modules for the Android emulator. It will be called several times
# for arm, x86 and mips
#
ifndef EMULATOR_TARGET_ARCH
$(error EMULATOR_TARGET_ARCH is not defined!)
endif
EMULATOR_TARGET_CPU := $(EMULATOR_TARGET_ARCH)
ifeq ($(EMULATOR_TARGET_CPU),x86)
EMULATOR_TARGET_CPU := i386
endif
##############################################################################
##############################################################################
###
### emulator-target-$CPU: target-specific emulation code.
###
### Used by both the core and standalone programs.
###
TCG_TARGET := $(BUILD_TARGET_ARCH)
ifeq ($(BUILD_TARGET_ARCH),x86)
TCG_TARGET := i386
endif
ifeq ($(BUILD_TARGET_ARCH),x86_64)
TCG_TARGET := i386
endif
# Common compiler flags for all target-dependent libraries
EMULATOR_TARGET_INCLUDES := \
$(LOCAL_PATH)/android/config/target-$(EMULATOR_TARGET_ARCH) \
$(LOCAL_PATH)/target-$(EMULATOR_TARGET_CPU) \
$(LOCAL_PATH)/fpu \
$(LOCAL_PATH)/tcg \
$(LOCAL_PATH)/tcg/$(TCG_TARGET) \
$(LOCAL_PATH)/slirp-android \
$(LIBCURL_INCLUDES) \
EMULATOR_TARGET_CFLAGS := \
-DNEED_CPU_H \
-DTARGET_ARCH=\"$(EMULATOR_TARGET_ARCH)\"
## one for 32-bit
$(call start-emulator-library, emulator-target-$(EMULATOR_TARGET_CPU))
LOCAL_CFLAGS := \
$(QEMU1_COMMON_CFLAGS) \
$(EMULATOR_TARGET_CFLAGS) \
# These are required by the TCG engine.
LOCAL_CFLAGS += \
-fno-PIC \
-fomit-frame-pointer \
-Wno-sign-compare
# required to ensure we properly initialize virtual audio hardware
LOCAL_CFLAGS += \
-DHAS_AUDIO \
LOCAL_C_INCLUDES += \
$(QEMU1_COMMON_INCLUDES) \
$(EMULATOR_TARGET_INCLUDES) \
LOCAL_SRC_FILES += \
android-qemu1-glue/main.c \
android-qemu1-glue/qemu-battery-agent-impl.c \
android-qemu1-glue/qemu-user-event-agent-impl.c \
android-qemu1-glue/qemu-vm-operations-impl.c \
android-qemu1-glue/skin_qt.cpp \
arch_init.c \
backends/msmouse.c \
code-profile.c \
cpus.c \
cputlb.c \
cpu-exec.c \
disas.c \
dma-helpers.c \
exec.c \
fpu/softfloat.c \
gdbstub.c \
hw/android/goldfish/audio.c \
hw/android/goldfish/battery.c \
hw/android/goldfish/device.c \
hw/android/goldfish/events_device.c \
hw/android/goldfish/fb.c \
hw/android/goldfish/mmc.c \
hw/android/goldfish/nand.c \
hw/android/goldfish/pipe.c \
hw/android/goldfish/profile.c \
hw/android/goldfish/trace.c \
hw/android/goldfish/tty.c \
hw/android/goldfish/vmem.c \
hw/core/dma.c \
hw/core/irq.c \
hw/core/loader.c \
hw/core/qdev.c \
hw/core/sysbus.c \
hw/pci/pci.c \
hw/watchdog/watchdog.c \
log-rotate-android.c \
main-loop.c \
memory-android.c \
monitor-android.c \
qemu-timer.c \
translate-all.c \
tcg/optimize.c \
tcg/tcg.c \
tcg-runtime.c \
ui/keymaps.c \
util/bitmap.c \
util/bitops.c \
util/host-utils.c \
util/qemu-timer-common.c \
vl-android.c \
ifeq ($(EMULATOR_TARGET_ARCH),arm)
LOCAL_SRC_FILES += \
disas/arm.c \
hw/android/android_arm.c \
hw/android/goldfish/interrupt.c \
hw/android/goldfish/timer.c \
hw/arm/armv7m.c \
hw/arm/armv7m_nvic.c \
hw/arm/boot.c \
hw/arm/pic.c \
hw/net/smc91c111.c \
target-arm/arm-semi.c \
target-arm/helper.c \
target-arm/iwmmxt_helper.c \
target-arm/machine.c \
target-arm/op_helper.c \
target-arm/neon_helper.c \
target-arm/translate.c \
endif # EMULATOR_TARGET_ARCH == arm
ifeq ($(EMULATOR_TARGET_ARCH),x86)
LOCAL_SRC_FILES += \
hw/i386/pc.c \
hw/i386/smbios.c \
hw/input/pckbd.c \
hw/input/ps2.c \
hw/intc/apic.c \
hw/intc/i8259.c \
hw/intc/ioapic.c \
hw/net/ne2000.c \
hw/nvram/fw_cfg.c \
hw/pci-host/piix.c \
hw/timer/i8254.c \
hw/timer/mc146818rtc.c \
target-i386/cc_helper.c \
target-i386/excp_helper.c \
target-i386/fpu_helper.c \
target-i386/helper.c \
target-i386/int_helper.c \
target-i386/machine.c \
target-i386/mem_helper.c \
target-i386/misc_helper.c \
target-i386/seg_helper.c \
target-i386/smm_helper.c \
target-i386/svm_helper.c \
target-i386/translate.c \
ifeq ($(BUILD_TARGET_OS),darwin)
LOCAL_SRC_FILES += \
target-i386/hax-all.c \
target-i386/hax-darwin.c \
endif
ifeq ($(BUILD_TARGET_OS),windows)
LOCAL_SRC_FILES += \
target-i386/hax-all.c \
target-i386/hax-windows.c \
endif
ifeq ($(BUILD_TARGET_OS),linux)
LOCAL_SRC_FILES += \
target-i386/kvm.c \
target-i386/kvm-gs-restore.c \
kvm-all.c \
kvm-android.c \
endif
endif # EMULATOR_TARGET_ARCH == x86
ifeq ($(EMULATOR_TARGET_ARCH),mips)
LOCAL_SRC_FILES += \
disas/mips.c \
hw/android/android_mips.c \
hw/android/goldfish/interrupt.c \
hw/android/goldfish/timer.c \
hw/mips/cputimer.c \
hw/mips/mips_int.c \
hw/mips/mips_pic.c \
hw/net/smc91c111.c \
target-mips/helper.c \
target-mips/op_helper.c \
target-mips/translate.c \
target-mips/machine.c \
endif # EMULATOR_TARGET_ARCH == mips
# What a mess, os-posix.c depends on the exact values of options
# which are target specific.
ifeq ($(BUILD_TARGET_OS),windows)
LOCAL_SRC_FILES += \
os-win32.c \
tap-win32.c \
util/oslib-win32.c \
else
LOCAL_SRC_FILES += \
os-posix.c \
util/oslib-posix.c \
endif
$(call gen-hw-config-defs)
$(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c)
$(call end-emulator-library)
##############################################################################
##############################################################################
###
### emulator-$ARCH: Standalone emulator program
###
###
$(call start-emulator-program, emulator$(BUILD_TARGET_SUFFIX)-$(EMULATOR_TARGET_ARCH))
LOCAL_STATIC_LIBRARIES += \
emulator-libui \
$(ANDROID_EMU_STATIC_LIBRARIES) \
$(ANDROID_SKIN_STATIC_LIBRARIES) \
$(EMULATOR_LIBUI_STATIC_LIBRARIES) \
LOCAL_WHOLE_STATIC_LIBRARIES := \
emulator-libqemu \
emulator-target-$(EMULATOR_TARGET_CPU) \
LOCAL_LDLIBS := \
$(ANDROID_EMU_LDLIBS) \
$(EMULATOR_LIBQEMU_LDLIBS) \
$(EMULATOR_LIBUI_LDLIBS) \
$(CXX_STD_LIB) \
LOCAL_LDFLAGS := \
$(EMULATOR_LIBUI_LDFLAGS) \
$(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h)
$(call gen-hw-config-defs)
ifeq ($(BUILD_TARGET_OS),windows)
$(eval $(call insert-windows-icon))
endif
$(call end-emulator-program)