David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 1 | # This file is included several times to build target-specific |
| 2 | # modules for the Android emulator. It will be called several times |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 3 | # for arm, x86 and mips |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 4 | # |
| 5 | |
| 6 | ifndef EMULATOR_TARGET_ARCH |
| 7 | $(error EMULATOR_TARGET_ARCH is not defined!) |
| 8 | endif |
| 9 | |
| 10 | EMULATOR_TARGET_CPU := $(EMULATOR_TARGET_ARCH) |
| 11 | ifeq ($(EMULATOR_TARGET_CPU),x86) |
| 12 | EMULATOR_TARGET_CPU := i386 |
| 13 | endif |
| 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 |
| 24 | EMULATOR_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 Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 29 | -DNEED_CPU_H |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 30 | |
| 31 | TCG_TARGET := $(HOST_ARCH) |
David 'Digit' Turner | f1d9bf1 | 2011-05-11 18:19:41 +0200 | [diff] [blame] | 32 | ifeq ($(HOST_ARCH),x86) |
| 33 | TCG_TARGET := i386 |
| 34 | endif |
| 35 | ifeq ($(HOST_ARCH),x86_64) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 36 | TCG_TARGET := i386 |
| 37 | endif |
| 38 | |
| 39 | EMULATOR_TARGET_CFLAGS += \ |
| 40 | -I$(LOCAL_PATH)/tcg \ |
| 41 | -I$(LOCAL_PATH)/tcg/$(TCG_TARGET) \ |
| 42 | -DTARGET_ARCH=\"$(EMULATOR_TARGET_ARCH)\" |
| 43 | |
| 44 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 45 | common_LOCAL_CFLAGS = |
| 46 | common_LOCAL_SRC_FILES = |
| 47 | |
David 'Digit' Turner | 1d1a2af | 2014-01-10 16:17:40 +0100 | [diff] [blame] | 48 | common_LOCAL_CFLAGS += -I$(GLIB_INCLUDE_DIR) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 49 | |
| 50 | # The following is to ensure that "config.h" will map to a target-specific |
| 51 | # configuration file header. |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 52 | common_LOCAL_CFLAGS += $(EMULATOR_TARGET_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 53 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 54 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 55 | tcg/tcg.c \ |
| 56 | |
| 57 | ############################################################################## |
| 58 | # Emulated hardware devices. |
| 59 | # |
| 60 | |
| 61 | HW_SOURCES := \ |
David 'Digit' Turner | 4b6bb76 | 2013-12-17 10:26:45 +0100 | [diff] [blame] | 62 | bt/core.c \ |
| 63 | bt/hci.c \ |
| 64 | bt/hid.c \ |
| 65 | bt/l2cap.c \ |
| 66 | bt/sdp.c \ |
David 'Digit' Turner | 4023ec8 | 2013-12-17 11:35:40 +0100 | [diff] [blame] | 67 | block/cdrom.c \ |
David 'Digit' Turner | 2ec695a | 2013-12-17 10:03:39 +0100 | [diff] [blame] | 68 | core/irq.c \ |
David 'Digit' Turner | 1074542 | 2013-12-17 10:05:40 +0100 | [diff] [blame] | 69 | core/qdev.c \ |
David 'Digit' Turner | 291300f | 2013-12-17 10:06:47 +0100 | [diff] [blame] | 70 | core/sysbus.c \ |
David 'Digit' Turner | f7c8d82 | 2013-12-17 14:02:11 +0100 | [diff] [blame] | 71 | core/dma.c \ |
David 'Digit' Turner | f066542 | 2013-12-17 10:47:09 +0100 | [diff] [blame] | 72 | 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' Turner | 7977bd6 | 2013-12-17 11:17:24 +0100 | [diff] [blame] | 83 | pci/pci.c \ |
David 'Digit' Turner | be5c971 | 2013-12-17 13:56:10 +0100 | [diff] [blame] | 84 | scsi/scsi-disk.c \ |
David 'Digit' Turner | 704463f | 2013-12-17 11:33:57 +0100 | [diff] [blame] | 85 | 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' Turner | e2f7405 | 2013-12-17 11:29:40 +0100 | [diff] [blame] | 90 | watchdog/watchdog.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 91 | |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 92 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 93 | ifeq ($(EMULATOR_TARGET_ARCH),arm) |
David 'Digit' Turner | d129876 | 2013-12-17 10:22:24 +0100 | [diff] [blame] | 94 | HW_SOURCES += \ |
David 'Digit' Turner | ea06669 | 2013-12-17 14:03:28 +0100 | [diff] [blame] | 95 | android/android_arm.c \ |
David 'Digit' Turner | d129876 | 2013-12-17 10:22:24 +0100 | [diff] [blame] | 96 | arm/pic.c \ |
| 97 | arm/boot.c \ |
David 'Digit' Turner | f066542 | 2013-12-17 10:47:09 +0100 | [diff] [blame] | 98 | android/goldfish/interrupt.c \ |
| 99 | android/goldfish/switch.c \ |
| 100 | android/goldfish/timer.c \ |
| 101 | android/goldfish/trace.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 102 | |
| 103 | # The following sources must be compiled with the final executables |
| 104 | # because they contain device_init() or machine_init() statements. |
David 'Digit' Turner | ebf1de0 | 2013-12-17 13:57:47 +0100 | [diff] [blame] | 105 | HW_OBJ_SOURCES := hw/net/smc91c111.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 106 | HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS) |
| 107 | |
David 'Digit' Turner | cc33b2d | 2013-12-15 00:09:42 +0100 | [diff] [blame] | 108 | common_LOCAL_SRC_FILES += disas/arm.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 109 | |
| 110 | # smc91c111.c requires <zlib.h> |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 111 | common_LOCAL_CFLAGS += $(ZLIB_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 112 | endif |
| 113 | |
David 'Digit' Turner | 764a3c9 | 2011-05-05 12:40:49 +0200 | [diff] [blame] | 114 | # required to ensure we properly initialize virtual audio hardware |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 115 | common_LOCAL_CFLAGS += -DHAS_AUDIO |
David 'Digit' Turner | 764a3c9 | 2011-05-05 12:40:49 +0200 | [diff] [blame] | 116 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 117 | ifeq ($(EMULATOR_TARGET_ARCH),x86) |
| 118 | HW_SOURCES += \ |
David 'Digit' Turner | 3fbb656 | 2013-12-17 10:08:21 +0100 | [diff] [blame] | 119 | intc/apic.c \ |
David 'Digit' Turner | 9133525 | 2013-12-17 13:52:01 +0100 | [diff] [blame] | 120 | intc/i8259.c \ |
David 'Digit' Turner | 6d7b529 | 2013-12-17 13:53:17 +0100 | [diff] [blame] | 121 | timer/mc146818rtc.c \ |
David 'Digit' Turner | bfa4dab | 2013-12-17 11:19:22 +0100 | [diff] [blame] | 122 | pci-host/piix.c \ |
David 'Digit' Turner | 6459c4a | 2013-12-17 10:31:05 +0100 | [diff] [blame] | 123 | timer/i8254.c \ |
David 'Digit' Turner | 7b76926 | 2013-12-17 13:54:37 +0100 | [diff] [blame] | 124 | input/pckbd.c \ |
David 'Digit' Turner | 1079fa7 | 2013-12-17 13:55:27 +0100 | [diff] [blame] | 125 | intc/ioapic.c \ |
David 'Digit' Turner | 4ecc3dd | 2013-12-17 11:16:00 +0100 | [diff] [blame] | 126 | input/ps2.c \ |
David 'Digit' Turner | 343e928 | 2013-12-17 13:56:48 +0100 | [diff] [blame] | 127 | i386/smbios.c \ |
David 'Digit' Turner | a367a10 | 2013-12-17 11:36:33 +0100 | [diff] [blame] | 128 | nvram/fw_cfg.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 129 | |
| 130 | # The following sources must be compiled with the final executables |
| 131 | # because they contain device_init() or machine_init() statements. |
| 132 | HW_OBJ_SOURCES := \ |
David 'Digit' Turner | 0840598 | 2013-12-17 11:35:00 +0100 | [diff] [blame] | 133 | hw/net/ne2000.c \ |
David 'Digit' Turner | bb22854 | 2013-12-17 13:53:59 +0100 | [diff] [blame] | 134 | hw/i386/pc.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 135 | |
| 136 | HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS) |
| 137 | |
| 138 | endif |
| 139 | |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 140 | ifeq ($(EMULATOR_TARGET_ARCH),mips) |
| 141 | HW_SOURCES += \ |
David 'Digit' Turner | ea06669 | 2013-12-17 14:03:28 +0100 | [diff] [blame] | 142 | android/android_mips.c \ |
David 'Digit' Turner | af0fc43 | 2013-12-17 14:00:52 +0100 | [diff] [blame] | 143 | mips/mips_pic.c \ |
David 'Digit' Turner | f066542 | 2013-12-17 10:47:09 +0100 | [diff] [blame] | 144 | android/goldfish/interrupt.c \ |
| 145 | android/goldfish/switch.c \ |
| 146 | android/goldfish/timer.c \ |
| 147 | android/goldfish/trace.c \ |
David 'Digit' Turner | af0fc43 | 2013-12-17 14:00:52 +0100 | [diff] [blame] | 148 | mips/cputimer.c \ |
| 149 | mips/mips_int.c |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 150 | |
| 151 | # The following sources must be compiled with the final executables |
| 152 | # because they contain device_init() or machine_init() statements. |
David 'Digit' Turner | ebf1de0 | 2013-12-17 13:57:47 +0100 | [diff] [blame] | 153 | HW_OBJ_SOURCES := hw/net/smc91c111.c |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 154 | HW_OBJ_CFLAGS := $(EMULATOR_TARGET_CFLAGS) |
| 155 | |
David 'Digit' Turner | cc33b2d | 2013-12-15 00:09:42 +0100 | [diff] [blame] | 156 | common_LOCAL_SRC_FILES += disas/mips.c |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 157 | |
| 158 | # smc91c111.c requires <zlib.h> |
| 159 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) |
| 160 | ifeq ($(ARCH_HAS_BIGENDIAN),true) |
| 161 | LOCAL_CFLAGS += -DTARGET_WORDS_BIGENDIAN |
| 162 | endif |
| 163 | |
| 164 | endif |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 165 | common_LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 166 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 167 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | 2a0488a | 2013-12-17 11:22:12 +0100 | [diff] [blame] | 168 | backends/msmouse.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 169 | cpu-exec.c \ |
David 'Digit' Turner | 3dc53fc | 2014-01-17 01:23:40 +0100 | [diff] [blame] | 170 | cputlb.c \ |
David 'Digit' Turner | 317c9d5 | 2011-05-10 06:38:21 +0200 | [diff] [blame] | 171 | exec.c \ |
David 'Digit' Turner | f9077a8 | 2014-02-10 23:10:47 +0100 | [diff] [blame] | 172 | main-loop.c \ |
David 'Digit' Turner | aa1180c | 2014-01-28 06:08:00 +0100 | [diff] [blame] | 173 | monitor-android.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 174 | translate-all.c \ |
David 'Digit' Turner | 13209b9 | 2013-12-17 09:54:09 +0100 | [diff] [blame] | 175 | android/varint.c \ |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 176 | softmmu_outside_jit.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 177 | |
| 178 | ############################################################################## |
| 179 | # CPU-specific emulation. |
| 180 | # |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 181 | common_LOCAL_CFLAGS += -fno-PIC -fomit-frame-pointer -Wno-sign-compare |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 182 | |
| 183 | ifeq ($(HOST_ARCH),ppc) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 184 | common_LOCAL_CFLAGS += -D__powerpc__ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 185 | endif |
| 186 | |
| 187 | ifeq ($(EMULATOR_TARGET_ARCH),arm) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 188 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | 82a591c | 2013-12-17 09:10:58 +0100 | [diff] [blame] | 189 | target-arm/arm-semi.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 190 | target-arm/op_helper.c \ |
| 191 | target-arm/iwmmxt_helper.c \ |
| 192 | target-arm/neon_helper.c \ |
| 193 | target-arm/helper.c \ |
David 'Digit' Turner | 288208c | 2011-05-11 19:37:35 +0200 | [diff] [blame] | 194 | target-arm/helper-android.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 195 | target-arm/translate.c \ |
| 196 | target-arm/machine.c \ |
David 'Digit' Turner | cd0c34b | 2013-12-17 10:19:44 +0100 | [diff] [blame] | 197 | hw/arm/armv7m.c \ |
| 198 | hw/arm/armv7m_nvic.c |
David 'Digit' Turner | e228840 | 2014-01-09 18:35:14 +0100 | [diff] [blame] | 199 | endif # EMULATOR_TARGET_ARCH == arm |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 200 | |
| 201 | ifeq ($(EMULATOR_TARGET_ARCH), x86) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 202 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 203 | target-i386/op_helper.c \ |
| 204 | target-i386/helper.c \ |
| 205 | target-i386/translate.c \ |
| 206 | target-i386/machine.c \ |
| 207 | |
Jun Nakajima | e4a3c78 | 2011-12-17 19:22:12 -0800 | [diff] [blame] | 208 | ifeq ($(HOST_OS),darwin) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 209 | common_LOCAL_SRC_FILES += \ |
Jun Nakajima | e4a3c78 | 2011-12-17 19:22:12 -0800 | [diff] [blame] | 210 | target-i386/hax-all.c \ |
| 211 | target-i386/hax-darwin.c |
| 212 | endif |
| 213 | |
| 214 | ifeq ($(HOST_OS),windows) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 215 | common_LOCAL_SRC_FILES += \ |
Jun Nakajima | e4a3c78 | 2011-12-17 19:22:12 -0800 | [diff] [blame] | 216 | target-i386/hax-all.c \ |
| 217 | target-i386/hax-windows.c |
| 218 | endif |
David 'Digit' Turner | e228840 | 2014-01-09 18:35:14 +0100 | [diff] [blame] | 219 | endif # EMULATOR_TARGET_ARCH == x86 |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 220 | |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 221 | ifeq ($(EMULATOR_TARGET_ARCH), mips) |
| 222 | common_LOCAL_SRC_FILES += \ |
| 223 | target-mips/op_helper.c \ |
| 224 | target-mips/helper.c \ |
| 225 | target-mips/translate.c \ |
| 226 | target-mips/machine.c |
David 'Digit' Turner | e228840 | 2014-01-09 18:35:14 +0100 | [diff] [blame] | 227 | endif # EMULATOR_TARGET_ARCH == mips |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 228 | |
| 229 | common_LOCAL_SRC_FILES += fpu/softfloat.c |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 230 | |
Jun Nakajima | 1321c76 | 2011-03-04 17:17:45 -0800 | [diff] [blame] | 231 | # compile KVM only if target is x86 on x86 Linux |
David 'Digit' Turner | 3659775 | 2011-05-20 01:18:01 +0200 | [diff] [blame] | 232 | QEMU_KVM_TAG := $(QEMU_HOST_TAG)-$(EMULATOR_TARGET_ARCH) |
| 233 | QEMU_DO_KVM := $(if $(filter linux-x86-x86 linux-x86_64-x86,$(QEMU_KVM_TAG)),true,false) |
| 234 | ifeq ($(QEMU_DO_KVM),true) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 235 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | 3659775 | 2011-05-20 01:18:01 +0200 | [diff] [blame] | 236 | target-i386/kvm.c \ |
Jun Nakajima | bb0140b | 2011-05-27 18:24:21 -0700 | [diff] [blame] | 237 | target-i386/kvm-gs-restore.c \ |
David 'Digit' Turner | 3659775 | 2011-05-20 01:18:01 +0200 | [diff] [blame] | 238 | kvm-all.c \ |
| 239 | kvm-android.c |
Jun Nakajima | 1321c76 | 2011-03-04 17:17:45 -0800 | [diff] [blame] | 240 | endif |
| 241 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 242 | ############################################################################## |
| 243 | # Memory-access checking support. |
| 244 | # Memory access checker uses information collected by instrumented code in |
| 245 | # libc.so in order to keep track of memory blocks allocated from heap. Memory |
| 246 | # checker then uses this information to make sure that every access to allocated |
| 247 | # memory is within allocated block. This information also allows detecting |
| 248 | # memory leaks and attempts to free/realloc invalid pointers. |
| 249 | # |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 250 | common_LOCAL_CFLAGS += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 251 | -I$(LOCAL_PATH)/memcheck \ |
| 252 | -I$(LOCAL_PATH)/elff |
| 253 | |
| 254 | MCHK_SOURCES := \ |
| 255 | memcheck.c \ |
| 256 | memcheck_proc_management.c \ |
| 257 | memcheck_malloc_map.c \ |
| 258 | memcheck_mmrange_map.c \ |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 259 | memcheck_util.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 260 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 261 | common_LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 262 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 263 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | ae3098a | 2011-05-11 16:01:57 +0200 | [diff] [blame] | 264 | cpus.c \ |
| 265 | arch_init.c |
| 266 | |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 267 | # What a mess, os-posix.c depends on the exact values of options |
| 268 | # which are target specific. |
| 269 | ifeq ($(HOST_OS),windows) |
David 'Digit' Turner | 1c31e3e | 2013-12-14 20:07:17 +0100 | [diff] [blame] | 270 | common_LOCAL_SRC_FILES += os-win32.c util/oslib-win32.c |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 271 | else |
David 'Digit' Turner | 1c31e3e | 2013-12-14 20:07:17 +0100 | [diff] [blame] | 272 | common_LOCAL_SRC_FILES += os-posix.c util/oslib-posix.c |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 273 | endif |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 274 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 275 | |
| 276 | ## one for 32-bit |
| 277 | $(call start-emulator-library, emulator-target-$(EMULATOR_TARGET_CPU)) |
| 278 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) |
| 279 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 280 | $(call gen-hw-config-defs) |
| 281 | $(call gen-hx-header,qemu-options.hx,qemu-options.def,os-posix.c os-win32.c) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 282 | $(call end-emulator-library) |
| 283 | |
David 'Digit' Turner | af061c5 | 2014-02-28 23:33:54 +0100 | [diff] [blame] | 284 | ifdef EMULATOR_BUILD_64BITS |
David 'Digit' Turner | f6f5007 | 2014-01-14 14:39:13 +0100 | [diff] [blame] | 285 | $(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) |
David 'Digit' Turner | af061c5 | 2014-02-28 23:33:54 +0100 | [diff] [blame] | 291 | endif # EMULATOR_BUILD_64BITS |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 292 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 293 | ############################################################################## |
| 294 | ############################################################################## |
| 295 | ### |
| 296 | ### emulator-$ARCH: Standalone emulator program |
| 297 | ### |
| 298 | ### |
| 299 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 300 | common_LOCAL_LDLIBS = |
| 301 | common_LOCAL_CFLAGS = |
| 302 | common_LOCAL_SRC_FILES = |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 303 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 304 | |
| 305 | common_LOCAL_STATIC_LIBRARIES := \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 306 | emulator-libui \ |
| 307 | emulator-libqemu \ |
| 308 | emulator-target-$(EMULATOR_TARGET_CPU) \ |
| 309 | emulator-libelff \ |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 310 | emulator-common |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 311 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 312 | common_LOCAL_LDLIBS += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 313 | $(EMULATOR_COMMON_LDLIBS) \ |
| 314 | $(EMULATOR_LIBQEMU_LDLIBS) \ |
| 315 | $(EMULATOR_LIBUI_LDLIBS) \ |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 316 | $(ELFF_LDLIBS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 317 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 318 | common_LOCAL_CFLAGS += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 319 | $(EMULATOR_TARGET_CFLAGS) \ |
| 320 | $(EMULATOR_COMMON_CFLAGS) \ |
| 321 | $(EMULATOR_LIBQEMU_CFLAGS) \ |
| 322 | $(EMULATOR_LIBUI_CFLAGS) |
| 323 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 324 | common_LOCAL_SRC_FILES := \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 325 | audio/audio.c \ |
| 326 | disas.c \ |
| 327 | dma-helpers.c \ |
| 328 | gdbstub.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 329 | qemu-timer.c \ |
David 'Digit' Turner | f9077a8 | 2014-02-10 23:10:47 +0100 | [diff] [blame] | 330 | log-rotate-android.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 331 | vl-android.c \ |
| 332 | android/cmdline-option.c \ |
| 333 | android/console.c \ |
| 334 | android/display.c \ |
| 335 | android/display-core.c \ |
| 336 | android/help.c \ |
| 337 | android/main-common.c \ |
| 338 | android/main.c \ |
David 'Digit' Turner | cb88e79 | 2011-08-26 01:35:14 +0200 | [diff] [blame] | 339 | android/opengles.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 340 | android/protocol/core-commands-qemu.c \ |
| 341 | android/protocol/ui-commands-qemu.c \ |
David 'Digit' Turner | d4e803c | 2013-12-14 23:45:50 +0100 | [diff] [blame] | 342 | android/user-events-qemu.c \ |
David 'Digit' Turner | 70a9820 | 2013-12-17 09:30:04 +0100 | [diff] [blame] | 343 | hw/core/loader.c \ |
David 'Digit' Turner | 852088c | 2013-12-14 23:04:12 +0100 | [diff] [blame] | 344 | ui/keymaps.c \ |
David 'Digit' Turner | a18ede0 | 2014-02-06 14:30:48 +0100 | [diff] [blame] | 345 | util/qemu-timer-common.c \ |
David 'Digit' Turner | 1befd34 | 2014-01-15 17:56:45 +0100 | [diff] [blame] | 346 | util/iov.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 347 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 348 | # The following files cannot be in static libraries because they contain |
| 349 | # constructor functions that are otherwise stripped by the final linker |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 350 | common_LOCAL_SRC_FILES += $(HW_OBJ_SOURCES) |
| 351 | common_LOCAL_CFLAGS += $(HW_OBJ_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 352 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 353 | common_LOCAL_SRC_FILES += $(BLOCK_SOURCES) |
| 354 | common_LOCAL_CFLAGS += $(BLOCK_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 355 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 356 | # Generate a completely static executable if needed. |
| 357 | # Note that this means no sound and graphics on Linux. |
| 358 | # |
Andrew Hsieh | 632a0e1 | 2012-04-28 00:48:53 +0800 | [diff] [blame] | 359 | ifneq ($(strip $(CONFIG_STATIC_EXECUTABLE)$(BUILD_HOST_static)),) |
David 'Digit' Turner | 1634ff5 | 2013-12-14 23:31:41 +0100 | [diff] [blame] | 360 | common_LOCAL_SRC_FILES += android/dynlink-static.c |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 361 | common_LOCAL_LDLIBS += -static |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 362 | endif |
| 363 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 364 | ## one for 32-bit |
| 365 | $(call start-emulator-program, emulator-$(EMULATOR_TARGET_ARCH)) |
| 366 | LOCAL_STATIC_LIBRARIES += \ |
| 367 | emulator-libui \ |
| 368 | emulator-libqemu \ |
| 369 | emulator-target-$(EMULATOR_TARGET_CPU) \ |
Lars Poeschel | 33da99a | 2012-08-22 09:42:42 +0200 | [diff] [blame] | 370 | emulator-libjpeg \ |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 371 | emulator-libelff \ |
| 372 | emulator-common \ |
| 373 | $(SDL_STATIC_LIBRARIES) |
| 374 | LOCAL_LDLIBS += $(common_LOCAL_LDLIBS) |
David 'Digit' Turner | af061c5 | 2014-02-28 23:33:54 +0100 | [diff] [blame] | 375 | LOCAL_LDFLAGS += $(common_LOCAL_LDFLAGS) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 376 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) |
| 377 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 378 | $(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h) |
| 379 | $(call gen-hw-config-defs) |
Raphael Moll | cdbea23 | 2012-05-04 15:04:27 -0700 | [diff] [blame] | 380 | |
| 381 | ifeq ($(HOST_OS),windows) |
David 'Digit' Turner | af061c5 | 2014-02-28 23:33:54 +0100 | [diff] [blame] | 382 | $(eval $(call insert-windows-icon)) |
| 383 | ifneq ($(BUILD_STANDALONE_EMULATOR),) |
| 384 | # Special exception for Windows: -lmingw32 must appear before libSDLmain |
| 385 | # on the link command-line, because it depends on _WinMain@16 which is |
| 386 | # exported by the latter. |
| 387 | LOCAL_LDFLAGS += -lmingw32 |
| 388 | else |
| 389 | # The previous trick doesn't work with the platform build system because |
| 390 | # it places all linker flags _after_ the actually libraries, so instead |
| 391 | # recompiler SDLmain from source so its object file is listed in the link |
| 392 | # command, forcing the linker to use it. |
| 393 | LOCAL_SRC_FILES += $(SDLMAIN_SOURCES:%=$(SDL_DIR)/%) |
| 394 | endif |
Raphael Moll | cdbea23 | 2012-05-04 15:04:27 -0700 | [diff] [blame] | 395 | endif |
| 396 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 397 | $(call end-emulator-program) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 398 | |
| 399 | |
David 'Digit' Turner | af061c5 | 2014-02-28 23:33:54 +0100 | [diff] [blame] | 400 | ifdef EMULATOR_BUILD_64BITS |
David 'Digit' Turner | f6f5007 | 2014-01-14 14:39:13 +0100 | [diff] [blame] | 401 | $(call start-emulator-program, emulator64-$(EMULATOR_TARGET_ARCH)) |
| 402 | LOCAL_STATIC_LIBRARIES += \ |
| 403 | emulator64-libui \ |
| 404 | emulator64-libqemu \ |
| 405 | emulator64-target-$(EMULATOR_TARGET_CPU) \ |
| 406 | emulator64-libjpeg \ |
| 407 | emulator64-libelff \ |
| 408 | emulator64-common \ |
| 409 | $(SDL_STATIC_LIBRARIES_64) |
| 410 | LOCAL_LDLIBS += $(common_LOCAL_LDLIBS) -m64 |
| 411 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64 |
| 412 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
David 'Digit' Turner | f6f5007 | 2014-01-14 14:39:13 +0100 | [diff] [blame] | 413 | $(call gen-hx-header,qemu-options.hx,qemu-options.def,vl-android.c qemu-options.h) |
| 414 | $(call gen-hw-config-defs) |
| 415 | $(call end-emulator-program) |
David 'Digit' Turner | af061c5 | 2014-02-28 23:33:54 +0100 | [diff] [blame] | 416 | endif # EMULATOR_BUILD_64BITS |
Raphael Moll | cdbea23 | 2012-05-04 15:04:27 -0700 | [diff] [blame] | 417 | |