The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 1 | ifeq ($(TARGET_ARCH),arm) |
| 2 | LOCAL_PATH:= $(call my-dir) |
| 3 | |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 4 | # determine the host tag to use |
| 5 | QEMU_HOST_TAG := $(HOST_PREBUILT_TAG) |
| 6 | ifneq ($(USE_MINGW),) |
| 7 | QEMU_HOST_TAG := windows |
| 8 | endif |
| 9 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 10 | # determine the location of platform-specific directories |
| 11 | # |
| 12 | CONFIG_DIRS := \ |
| 13 | $(LOCAL_PATH)/android/config \ |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 14 | $(LOCAL_PATH)/android/config/$(QEMU_HOST_TAG) |
| 15 | |
| 16 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 17 | CONFIG_DIRS := $(LOCAL_PATH)/objs $(CONFIG_DIRS) |
| 18 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 19 | |
| 20 | CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%) |
| 21 | |
Kenny Root | 095cd0f | 2009-09-19 18:32:44 -0500 | [diff] [blame] | 22 | MY_CC := $(HOST_CC) |
| 23 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 24 | MY_OPTIM := -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer |
| 25 | ifeq ($(BUILD_DEBUG_EMULATOR),true) |
| 26 | MY_OPTIM := -O0 -g |
| 27 | endif |
| 28 | |
David 'Digit' Turner | 9a0f1fb | 2010-02-25 14:22:29 -0800 | [diff] [blame] | 29 | MY_CFLAGS := $(CONFIG_INCLUDES) $(MY_OPTIM) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 30 | |
David 'Digit' Turner | 466f548 | 2009-07-30 15:50:19 +0200 | [diff] [blame] | 31 | # Overwrite configuration for debug builds. |
| 32 | # |
| 33 | ifeq ($(BUILD_DEBUG_EMULATOR),true) |
| 34 | MY_CFLAGS := $(CONFIG_INCLUDES) -O0 -g \ |
| 35 | -fno-PIC -falign-functions=0 |
| 36 | endif |
| 37 | |
David 'Digit' Turner | 9a0f1fb | 2010-02-25 14:22:29 -0800 | [diff] [blame] | 38 | MY_CFLAGS += -DCONFIG_MEMCHECK |
| 39 | |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 40 | MY_LDLIBS := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 41 | |
| 42 | # this is needed to build the emulator on 64-bit Linux systems |
| 43 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
| 44 | MY_CFLAGS += -Wa,--32 |
| 45 | endif |
| 46 | |
| 47 | ifeq ($(HOST_OS),freebsd) |
| 48 | MY_CFLAGS += -Wa,--32 -I /usr/local/include |
| 49 | endif |
| 50 | |
| 51 | ifeq ($(HOST_OS),windows) |
| 52 | MY_CFLAGS += -D_WIN32 -mno-cygwin |
| 53 | # we need Win32 features that are available since Windows 2000 Professional/Server (NT 5.0) |
| 54 | MY_CFLAGS += -DWINVER=0x501 |
| 55 | endif |
| 56 | |
| 57 | ifeq ($(HOST_ARCH),ppc) |
| 58 | MY_CFLAGS += -D__powerpc__ |
| 59 | endif |
| 60 | |
| 61 | ifeq ($(HOST_OS),darwin) |
David 'Digit' Turner | 747f7d1 | 2011-01-06 22:24:26 +0100 | [diff] [blame] | 62 | MY_CFLAGS += -mdynamic-no-pic -D_DARWIN_C_SOURCE=1 |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 63 | |
| 64 | # When building on Leopard or above, we need to use the 10.4 SDK |
| 65 | # or the generated binary will not run on Tiger. |
| 66 | DARWIN_VERSION := $(strip $(shell sw_vers -productVersion)) |
Jeff Hamilton | d0d9734 | 2010-05-27 11:41:41 -0500 | [diff] [blame] | 67 | ifneq ($(filter 10.1 10.2 10.3 10.1.% 10.2.% 10.3.% 10.4 10.4.%,$(DARWIN_VERSION)),) |
| 68 | $(error Building the Android emulator requires OS X 10.5 or above) |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 69 | endif |
Jeff Hamilton | d0d9734 | 2010-05-27 11:41:41 -0500 | [diff] [blame] | 70 | ifeq ($(filter 10.5 10.5.%,$(DARWIN_VERSION)),) |
| 71 | # We are on Snow Leopard or above |
| 72 | LEOPARD_SDK := /Developer/SDKs/MacOSX10.5.sdk |
| 73 | ifeq ($(strip $(wildcard $(LEOPARD_SDK))),) |
| 74 | $(info Please install the 10.5 SDK on this machine at $(LEOPARD_SDK)) |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 75 | $(error Aborting the build.) |
| 76 | endif |
Jeff Hamilton | d0d9734 | 2010-05-27 11:41:41 -0500 | [diff] [blame] | 77 | MY_CFLAGS += -isysroot $(LEOPARD_SDK) -mmacosx-version-min=10.5 -DMACOSX_DEPLOYMENT_TARGET=10.5 |
| 78 | MY_LDLIBS += -isysroot $(LEOPARD_SDK) -Wl,-syslibroot,$(LEOPARD_SDK) -mmacosx-version-min=10.5 |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 79 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 80 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 81 | |
| 82 | # BUILD_STANDALONE_EMULATOR is only defined when building with |
| 83 | # the android-rebuild.sh script. The script will also provide |
| 84 | # adequate values for HOST_CC |
| 85 | # |
| 86 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 87 | |
| 88 | ifneq ($(USE_CCACHE),) |
Ying Wang | 7bf9d7f | 2010-10-07 15:12:11 -0700 | [diff] [blame] | 89 | ccache := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache |
| 90 | ifneq ($(ccache),$(firstword $(MY_CC))) |
| 91 | MY_CC := $(ccache) $(MY_CC) |
| 92 | endif |
| 93 | ccache := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 94 | endif |
| 95 | endif |
| 96 | |
| 97 | |
| 98 | ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true) |
| 99 | ifneq ($(HOST_ARCH),x86_64) |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 100 | MY_CFLAGS += -m32 |
| 101 | MY_LDLIBS += -m32 |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 102 | endif |
| 103 | endif |
| 104 | |
David 'Digit' Turner | 4e024bb | 2010-09-22 14:19:28 +0200 | [diff] [blame] | 105 | # Enable warning, except those related to missing field initializers |
| 106 | # (the QEMU coding style loves using these). |
| 107 | # |
| 108 | MY_CFLAGS += -Wall -Wno-missing-field-initializers |
| 109 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 110 | include $(CLEAR_VARS) |
| 111 | |
| 112 | ########################################################### |
| 113 | # Zlib configuration |
| 114 | # |
| 115 | ZLIB_DIR := distrib/zlib-1.2.3 |
| 116 | include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make |
| 117 | |
| 118 | ########################################################### |
| 119 | # Libpng configuration |
| 120 | # |
| 121 | LIBPNG_DIR := distrib/libpng-1.2.19 |
| 122 | include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make |
| 123 | |
| 124 | ############################################################################### |
| 125 | # build the TCG code generator |
| 126 | # |
| 127 | include $(CLEAR_VARS) |
| 128 | |
| 129 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 130 | LOCAL_CC := $(MY_CC) |
| 131 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 132 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 133 | LOCAL_MODULE := emulator-tcg |
| 134 | |
| 135 | TCG_TARGET := $(HOST_ARCH) |
| 136 | ifeq ($(TCG_TARGET),x86) |
| 137 | TCG_TARGET := i386 |
| 138 | endif |
| 139 | |
| 140 | TCG_CFLAGS := -I$(LOCAL_PATH)/tcg -I$(LOCAL_PATH)/tcg/$(TCG_TARGET) |
| 141 | |
David Turner | 6a9ef17 | 2010-09-09 22:54:36 +0200 | [diff] [blame] | 142 | LOCAL_CFLAGS += $(TCG_CFLAGS) -DNEED_CPU_H \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 143 | -I$(LOCAL_PATH)/target-arm \ |
| 144 | -I$(LOCAL_PATH)/fpu \ |
| 145 | |
| 146 | LOCAL_SRC_FILES := \ |
| 147 | tcg/tcg.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 148 | |
| 149 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 150 | |
| 151 | ############################################################################## |
| 152 | # build the HW emulation support |
| 153 | # |
| 154 | include $(CLEAR_VARS) |
| 155 | |
| 156 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 157 | LOCAL_CC := $(MY_CC) |
Jeff Hamilton | d0d9734 | 2010-05-27 11:41:41 -0500 | [diff] [blame] | 158 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 159 | LOCAL_MODULE := emulator-hw |
| 160 | |
| 161 | HW_CFLAGS := -I$(LOCAL_PATH)/hw |
| 162 | |
David Turner | 6a9ef17 | 2010-09-09 22:54:36 +0200 | [diff] [blame] | 163 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) -DNEED_CPU_H |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 164 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(HW_CFLAGS) |
| 165 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 166 | |
| 167 | HW_SOURCES := \ |
| 168 | android_arm.c \ |
| 169 | arm_pic.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 170 | bt.c \ |
| 171 | bt-hci.c \ |
| 172 | bt-hid.c \ |
| 173 | bt-l2cap.c \ |
| 174 | bt-sdp.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 175 | cdrom.c \ |
| 176 | dma.c \ |
| 177 | irq.c \ |
| 178 | goldfish_audio.c \ |
| 179 | goldfish_battery.c \ |
| 180 | goldfish_device.c \ |
| 181 | goldfish_events_device.c \ |
| 182 | goldfish_fb.c \ |
| 183 | goldfish_interrupt.c \ |
| 184 | goldfish_memlog.c \ |
| 185 | goldfish_mmc.c \ |
| 186 | goldfish_nand.c \ |
| 187 | goldfish_switch.c \ |
| 188 | goldfish_timer.c \ |
| 189 | goldfish_trace.c \ |
| 190 | goldfish_tty.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 191 | msmouse.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 192 | pci.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 193 | qdev.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 194 | scsi-disk.c \ |
| 195 | smc91c111.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 196 | sysbus.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 197 | usb-hid.c \ |
| 198 | usb-hub.c \ |
| 199 | usb-msd.c \ |
| 200 | usb-ohci.c \ |
| 201 | usb.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 202 | watchdog.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 203 | |
| 204 | LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%) |
| 205 | |
| 206 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 207 | |
| 208 | ############################################################################## |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 209 | # build the ELF/DWARF stuff |
| 210 | # This library is used by emulator's memory checker to extract debug information |
| 211 | # from the symbol files when reporting memory allocation violations. In |
| 212 | # particular, this library is used to extract routine name and source file |
| 213 | # location for the code address where violation has been detected. |
| 214 | # |
| 215 | include $(CLEAR_VARS) |
| 216 | |
| 217 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 218 | LOCAL_CC := $(MY_CC) |
Jeff Hamilton | d0d9734 | 2010-05-27 11:41:41 -0500 | [diff] [blame] | 219 | LOCAL_LDLIBS := $(MY_LDLIBS) |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 220 | LOCAL_MODULE := emulator-elff |
| 221 | LOCAL_CPP_EXTENSION := .cc |
| 222 | |
| 223 | ELFF_CFLAGS := -I$(LOCAL_PATH)/elff |
| 224 | |
David 'Digit' Turner | 3d66dc7 | 2010-01-27 18:18:41 -0800 | [diff] [blame] | 225 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) -fno-exceptions |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 226 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(ELFF_CFLAGS) |
| 227 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 228 | |
| 229 | ELFF_SOURCES := \ |
| 230 | dwarf_cu.cc \ |
| 231 | dwarf_die.cc \ |
| 232 | dwarf_utils.cc \ |
| 233 | elf_alloc.cc \ |
| 234 | elf_file.cc \ |
| 235 | elf_mapped_section.cc \ |
| 236 | elff_api.cc \ |
| 237 | |
| 238 | LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%) |
| 239 | ELFF_LDLIBS := -lstdc++ |
| 240 | |
| 241 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 242 | |
| 243 | ############################################################################## |
| 244 | # build the memory access checking support |
| 245 | # Memory access checker uses information collected by instrumented code in |
| 246 | # libc.so in order to keep track of memory blocks allocated from heap. Memory |
| 247 | # checker then uses this information to make sure that every access to allocated |
| 248 | # memory is within allocated block. This information also allows detecting |
| 249 | # memory leaks and attempts to free/realloc invalid pointers. |
| 250 | # |
| 251 | include $(CLEAR_VARS) |
| 252 | |
| 253 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 254 | LOCAL_CC := $(MY_CC) |
Jeff Hamilton | d0d9734 | 2010-05-27 11:41:41 -0500 | [diff] [blame] | 255 | LOCAL_LDLIBS := $(MY_LDLIBS) |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 256 | LOCAL_MODULE := emulator-memcheck |
| 257 | |
| 258 | MCHK_CFLAGS := -I$(LOCAL_PATH)/memcheck -I$(LOCAL_PATH)/elff |
| 259 | |
David Turner | 6a9ef17 | 2010-09-09 22:54:36 +0200 | [diff] [blame] | 260 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) -DNEED_CPU_H |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 261 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(MCHK_CFLAGS) |
| 262 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 263 | |
| 264 | MCHK_SOURCES := \ |
| 265 | memcheck.c \ |
| 266 | memcheck_proc_management.c \ |
| 267 | memcheck_malloc_map.c \ |
| 268 | memcheck_mmrange_map.c \ |
| 269 | memcheck_util.c \ |
| 270 | |
| 271 | LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%) |
| 272 | |
| 273 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 274 | |
| 275 | ############################################################################## |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 276 | # build the ARM-specific emulation engine sources |
| 277 | # |
| 278 | include $(CLEAR_VARS) |
| 279 | |
| 280 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 281 | LOCAL_CC := $(MY_CC) |
| 282 | LOCAL_MODULE := emulator-arm |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 283 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 284 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 285 | LOCAL_STATIC_LIBRARIES := emulator-hw |
| 286 | |
| 287 | LOCAL_CFLAGS := -fno-PIC -fomit-frame-pointer -Wno-sign-compare |
| 288 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 289 | |
| 290 | LOCAL_CFLAGS += -I$(LOCAL_PATH) \ |
| 291 | -I$(LOCAL_PATH)/target-arm \ |
| 292 | -I$(LOCAL_PATH)/fpu \ |
| 293 | $(TCG_CFLAGS) \ |
| 294 | $(HW_CFLAGS) \ |
David Turner | 6a9ef17 | 2010-09-09 22:54:36 +0200 | [diff] [blame] | 295 | -DNEED_CPU_H \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 296 | |
| 297 | ifeq ($(HOST_ARCH),ppc) |
| 298 | LOCAL_CFLAGS += -D__powerpc__ |
| 299 | endif |
| 300 | |
| 301 | LOCAL_SRC_FILES += exec.c cpu-exec.c \ |
| 302 | target-arm/op_helper.c \ |
| 303 | target-arm/iwmmxt_helper.c \ |
| 304 | target-arm/neon_helper.c \ |
| 305 | target-arm/helper.c \ |
| 306 | target-arm/translate.c \ |
| 307 | target-arm/machine.c \ |
| 308 | translate-all.c \ |
| 309 | hw/armv7m.c \ |
| 310 | hw/armv7m_nvic.c \ |
| 311 | arm-semi.c \ |
| 312 | trace.c \ |
| 313 | varint.c \ |
| 314 | dcache.c \ |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 315 | softmmu_outside_jit.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 316 | |
| 317 | LOCAL_SRC_FILES += fpu/softfloat.c |
| 318 | |
| 319 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 320 | |
| 321 | ############################################################################## |
| 322 | # SDL-related definitions |
| 323 | # |
| 324 | |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 325 | # Build SDL from sources except on linux-x86, to avoid installing all |
| 326 | # the X11 development packages on our build servers. |
| 327 | # |
| 328 | BUILD_SDL_FROM_SOURCES := true |
| 329 | ifeq ($(QEMU_HOST_TAG),linux-x86) |
| 330 | BUILD_SDL_FROM_SOURCES := false |
| 331 | endif |
David 'Digit' Turner | b74c48f | 2010-05-20 15:17:32 -0700 | [diff] [blame] | 332 | ifeq ($(QEMU_HOST_TAG),darwin-x86) |
| 333 | BUILD_SDL_FROM_SOURCES := false |
| 334 | endif |
David 'Digit' Turner | 34f2974 | 2010-05-25 18:16:10 -0700 | [diff] [blame] | 335 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 336 | BUILD_SDL_FROM_SOURCES := true |
| 337 | endif |
| 338 | |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 339 | ifneq ($(SDL_CONFIG),) |
| 340 | BUILD_SDL_FROM_SOURCES := false |
| 341 | endif |
| 342 | |
| 343 | ifneq ($(BUILD_SDL_FROM_SOURCES),true) |
| 344 | |
| 345 | SDL_CONFIG ?= prebuilt/$(QEMU_HOST_TAG)/sdl/bin/sdl-config |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 346 | SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) |
| 347 | |
| 348 | # We need to filter out the _GNU_SOURCE variable because it breaks recent |
| 349 | # releases of Cygwin when using the -mno-cygwin option. Moreover, we don't |
| 350 | # need this macro at all to build the Android emulator. |
| 351 | SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS)) |
| 352 | SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs)) |
| 353 | |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 354 | # Circular dependencies between libSDL and libSDLmain; |
| 355 | # We repeat the libraries in the final link to work around it. |
| 356 | SDL_STATIC_LIBRARIES := libSDL libSDLmain libSDL libSDLmain |
| 357 | |
| 358 | else # !BUILD_STANDALONE_EMULATOR |
| 359 | |
| 360 | SDL_DIR := distrib/sdl-1.2.12 |
| 361 | include $(LOCAL_PATH)/$(SDL_DIR)/sources.make |
| 362 | |
| 363 | endif # !BUILD_STANDALONE_EMULATOR |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 364 | |
| 365 | ############################################################################## |
| 366 | # determine audio sources, build the prebuilt audio-library if needed |
| 367 | # |
| 368 | |
| 369 | # determine AUDIO sources based on current configuration |
| 370 | # |
Vladimir Chtchetkine | eeac013 | 2010-05-03 10:46:28 -0700 | [diff] [blame] | 371 | AUDIO_SOURCES := audio.c noaudio.c wavaudio.c wavcapture.c mixeng.c |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 372 | AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO |
| 373 | AUDIO_LDLIBS := |
| 374 | |
| 375 | ifeq ($(HOST_OS),darwin) |
| 376 | CONFIG_COREAUDIO ?= yes |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 377 | AUDIO_CFLAGS += -DHOST_BSD=1 |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 378 | endif |
| 379 | |
| 380 | ifeq ($(HOST_OS),windows) |
| 381 | CONFIG_WINAUDIO ?= yes |
| 382 | endif |
| 383 | |
| 384 | ifeq ($(HOST_OS),linux) |
| 385 | CONFIG_OSS ?= yes |
| 386 | CONFIG_ALSA ?= yes |
David 'Digit' Turner | 415a4b1 | 2010-07-28 12:20:14 -0700 | [diff] [blame] | 387 | CONFIG_PULSEAUDIO ?= yes |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 388 | CONFIG_ESD ?= yes |
| 389 | endif |
| 390 | |
| 391 | ifeq ($(HOST_OS),freebsd) |
| 392 | CONFIG_OSS ?= yes |
| 393 | endif |
| 394 | |
| 395 | ifeq ($(CONFIG_COREAUDIO),yes) |
| 396 | AUDIO_SOURCES += coreaudio.c |
| 397 | AUDIO_CFLAGS += -DCONFIG_COREAUDIO |
| 398 | AUDIO_LDLIBS += -Wl,-framework,CoreAudio |
| 399 | endif |
| 400 | |
| 401 | ifeq ($(CONFIG_WINAUDIO),yes) |
| 402 | AUDIO_SOURCES += winaudio.c |
| 403 | AUDIO_CFLAGS += -DCONFIG_WINAUDIO |
| 404 | endif |
| 405 | |
David 'Digit' Turner | 415a4b1 | 2010-07-28 12:20:14 -0700 | [diff] [blame] | 406 | ifeq ($(CONFIG_PULSEAUDIO),yes) |
| 407 | AUDIO_SOURCES += paaudio.c audio_pt_int.c |
| 408 | AUDIO_CFLAGS += -DCONFIG_PULSEAUDIO |
| 409 | endif |
| 410 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 411 | ifeq ($(CONFIG_ALSA),yes) |
| 412 | AUDIO_SOURCES += alsaaudio.c audio_pt_int.c |
| 413 | AUDIO_CFLAGS += -DCONFIG_ALSA |
| 414 | endif |
| 415 | |
| 416 | ifeq ($(CONFIG_ESD),yes) |
| 417 | AUDIO_SOURCES += esdaudio.c |
| 418 | AUDIO_CFLAGS += -DCONFIG_ESD |
| 419 | endif |
| 420 | |
| 421 | ifeq ($(CONFIG_OSS),yes) |
| 422 | AUDIO_SOURCES += ossaudio.c |
| 423 | AUDIO_CFLAGS += -DCONFIG_OSS |
| 424 | endif |
| 425 | |
David 'Digit' Turner | 415a4b1 | 2010-07-28 12:20:14 -0700 | [diff] [blame] | 426 | AUDIO_SOURCES := $(call sort,$(AUDIO_SOURCES:%=audio/%)) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 427 | |
| 428 | # determine whether we're going to use the prebuilt |
| 429 | # audio library (this is useful on Linux to avoid requiring |
| 430 | # all sound-related development packages to be installed on |
| 431 | # the build and developer machines). |
| 432 | # |
| 433 | # note that you can define BUILD_QEMU_AUDIO_LIB to true |
| 434 | # in your environment to force recompilation. |
| 435 | # |
| 436 | QEMU_AUDIO_LIB := |
| 437 | |
| 438 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 439 | QEMU_AUDIO_LIB := $(wildcard \ |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 440 | prebuilt/$(QEMU_HOST_TAG)/emulator/libqemu-audio.a) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 441 | endif |
| 442 | |
| 443 | ifeq ($(BUILD_QEMU_AUDIO_LIB),true) |
| 444 | include $(CLEAR_VARS) |
| 445 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 446 | LOCAL_CC := $(MY_CC) |
| 447 | LOCAL_MODULE := libqemu-audio |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 448 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 449 | |
| 450 | LOCAL_CFLAGS := -Wno-sign-compare \ |
| 451 | -fno-strict-aliasing -W -Wall -Wno-unused-parameter \ |
| 452 | -I$(LOCAL_PATH) \ |
| 453 | -I$(LOCAL_PATH)/target-arm \ |
| 454 | -I$(LOCAL_PATH)/fpu \ |
| 455 | |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 456 | # this is very important, otherwise the generated binaries may |
| 457 | # not link properly on our build servers |
| 458 | ifeq ($(HOST_OS),linux) |
| 459 | LOCAL_CFLAGS += -fno-stack-protector |
| 460 | endif |
| 461 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 462 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(AUDIO_CFLAGS) |
| 463 | |
| 464 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 465 | |
| 466 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 467 | |
| 468 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 469 | QEMU_AUDIO_LIB := $(LOCAL_BUILT_MODULE) |
| 470 | |
| 471 | endif # !QEMU_AUDIO_LIB |
| 472 | |
| 473 | ############################################################################## |
David 'Digit' Turner | 04a18e5 | 2010-10-23 01:52:33 +0200 | [diff] [blame] | 474 | # Common CFLAGS for UI and Core builds |
| 475 | |
| 476 | # add the build ID to the default macro definitions |
| 477 | UI_AND_CORE_CFLAGS := -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))" |
| 478 | |
| 479 | # For non-standalone builds, extract the major version number from the Android SDK |
| 480 | # tools revision number. |
| 481 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 482 | ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties) |
| 483 | endif |
| 484 | |
| 485 | ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION)) |
| 486 | ifdef ANDROID_SDK_TOOLS_REVISION |
| 487 | UI_AND_CORE_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION) |
| 488 | endif |
| 489 | |
| 490 | UI_AND_CORE_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
| 491 | |
| 492 | |
| 493 | ############################################################################## |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 494 | # Build emulator core library. |
| 495 | # This library contains "pure" emulation code separated from the intricacies |
| 496 | # of the UI. |
| 497 | # |
| 498 | include $(CLEAR_VARS) |
| 499 | |
| 500 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 501 | LOCAL_CC := $(MY_CC) |
| 502 | LOCAL_LDLIBS := $(MY_LDLIBS) |
| 503 | LOCAL_MODULE := emulator-core |
| 504 | |
| 505 | # don't remove the -fno-strict-aliasing, or you'll break things |
| 506 | # (e.g. slirp-android/network support) |
| 507 | # |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 508 | EMULATOR_CORE_CFLAGS := -fno-PIC -Wno-sign-compare \ |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 509 | -fno-strict-aliasing -g -W -Wall -Wno-unused-parameter |
| 510 | |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 511 | # Needed by the upstream code |
| 512 | EMULATOR_CORE_CFLAGS += -DNEED_CPU_H |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 513 | |
| 514 | # Common includes for the emulator |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 515 | EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/ \ |
| 516 | -I$(LOCAL_PATH)/target-arm \ |
| 517 | -I$(LOCAL_PATH)/fpu \ |
| 518 | $(TCG_CFLAGS) \ |
| 519 | $(HW_CFLAGS) \ |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 520 | |
David 'Digit' Turner | cb42a1b | 2010-12-23 02:54:08 +0100 | [diff] [blame] | 521 | # Required by block.c, default value is empty in upstream |
| 522 | EMULATOR_CORE_CFLAGS += -DCONFIG_BDRV_WHITELIST="" |
| 523 | |
| 524 | # Required |
| 525 | EMULATOR_CORE_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 526 | # include slirp-android code, i.e. the user-level networking stuff |
| 527 | # |
| 528 | SLIRP_SOURCES := bootp.c cksum.c debug.c if.c ip_icmp.c ip_input.c ip_output.c \ |
| 529 | mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c tcp_output.c \ |
| 530 | tcp_subr.c tcp_timer.c tftp.c udp.c |
| 531 | |
| 532 | LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%) |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 533 | EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/slirp-android |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 534 | |
| 535 | # socket proxy support |
| 536 | # |
| 537 | PROXY_SOURCES := \ |
| 538 | proxy_common.c \ |
| 539 | proxy_http.c \ |
| 540 | proxy_http_connector.c \ |
| 541 | proxy_http_rewriter.c \ |
| 542 | |
| 543 | LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%) |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 544 | EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/proxy |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 545 | |
| 546 | # include telephony stuff |
| 547 | # |
| 548 | TELEPHONY_SOURCES := android_modem.c modem_driver.c gsm.c sim_card.c sysdeps_qemu.c sms.c remote_call.c |
| 549 | LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%) |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 550 | EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/telephony |
| 551 | |
Vladimir Chtchetkine | d81e6d1 | 2010-06-15 16:46:32 -0700 | [diff] [blame] | 552 | # include android related stuff |
| 553 | # |
| 554 | ANDROID_SOURCES := qemu-setup.c |
| 555 | LOCAL_SRC_FILES += $(ANDROID_SOURCES:%=android/%) |
| 556 | |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 557 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS) |
David 'Digit' Turner | 04a18e5 | 2010-10-23 01:52:33 +0200 | [diff] [blame] | 558 | LOCAL_CFLAGS += $(UI_AND_CORE_CFLAGS) |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 559 | |
| 560 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 561 | |
| 562 | ############################################################################## |
| 563 | # Build emulator UI library. |
| 564 | # This library contains some emulator related UI components. |
| 565 | # |
| 566 | include $(CLEAR_VARS) |
| 567 | |
| 568 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 569 | LOCAL_CC := $(MY_CC) |
| 570 | LOCAL_LDLIBS := $(MY_LDLIBS) |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 571 | LOCAL_MODULE := emulator-uilib |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 572 | |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 573 | EMULATOR_UI_CFLAGS := |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 574 | |
| 575 | # include the SDL sources |
| 576 | # |
David 'Digit' Turner | ca85ee2 | 2010-06-10 15:14:55 -0700 | [diff] [blame] | 577 | |
| 578 | # IMPORTANT: Normally, we should add SDLMAIN_SOURCES here, however this breaks |
| 579 | # the Linux mingw32 build. Apparently, the i586-mingw32-ld wants the |
| 580 | # implementation of _WinMain@16 to be in an object file on the final |
| 581 | # link command used to generate the executable, and will not search |
| 582 | # in the static libraries that are used to build it. |
| 583 | # |
| 584 | LOCAL_SRC_FILES += $(SDL_SOURCES) #$(SDLMAIN_SOURCES) |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 585 | EMULATOR_UI_CFLAGS += $(SDL_CFLAGS) -I$(LOCAL_PATH)/$(SDL_DIR)/include |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 586 | |
| 587 | # the skin support sources |
| 588 | # |
| 589 | SKIN_SOURCES := rect.c \ |
| 590 | region.c \ |
| 591 | image.c \ |
| 592 | trackball.c \ |
| 593 | keyboard.c \ |
| 594 | keyset.c \ |
| 595 | file.c \ |
| 596 | window.c \ |
| 597 | scaler.c \ |
| 598 | composer.c \ |
| 599 | surface.c \ |
| 600 | |
| 601 | LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%) |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 602 | EMULATOR_UI_CFLAGS += -I$(LOCAL_PATH)/skin |
| 603 | |
| 604 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS) $(EMULATOR_UI_CFLAGS) |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 605 | |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 606 | LOCAL_MODULE_TAGS := debug |
| 607 | |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 608 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 609 | |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 610 | ############################################################################## |
| 611 | # lists of source files used to build the emulator core |
| 612 | # |
| 613 | |
| 614 | # block sources |
| 615 | # |
| 616 | CORE_BLOCK_SOURCES = block.c \ |
David 'Digit' Turner | cb42a1b | 2010-12-23 02:54:08 +0100 | [diff] [blame] | 617 | blockdev.c \ |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 618 | block/qcow.c \ |
| 619 | block/qcow2.c \ |
| 620 | block/qcow2-refcount.c \ |
| 621 | block/qcow2-snapshot.c \ |
| 622 | block/qcow2-cluster.c \ |
| 623 | block/cloop.c \ |
| 624 | block/dmg.c \ |
David 'Digit' Turner | cb42a1b | 2010-12-23 02:54:08 +0100 | [diff] [blame] | 625 | block/vvfat.c \ |
| 626 | block/raw.c |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 627 | ifeq ($(HOST_OS),windows) |
| 628 | CORE_BLOCK_SOURCES += block/raw-win32.c |
| 629 | else |
| 630 | CORE_BLOCK_SOURCES += block/raw-posix.c |
| 631 | endif |
| 632 | |
| 633 | # hw sources |
| 634 | # |
| 635 | CORE_HW_SOURCES = hw/arm_boot.c \ |
| 636 | hw/android_arm.c |
| 637 | |
| 638 | # migration sources |
| 639 | # |
| 640 | CORE_MIGRATION_SOURCES = iolooper-select.c |
| 641 | ifeq ($(HOST_OS),windows) |
| 642 | CORE_MIGRATION_SOURCES += migration-dummy-android.c |
| 643 | else |
| 644 | CORE_MIGRATION_SOURCES += migration.c \ |
| 645 | migration-exec.c \ |
| 646 | migration-tcp-android.c |
| 647 | endif |
| 648 | |
| 649 | # misc. sources |
| 650 | # |
Vladimir Chtchetkine | 008c97e | 2010-10-08 08:22:06 -0700 | [diff] [blame] | 651 | CORE_MISC_SOURCES = vl-android.c \ |
David 'Digit' Turner | 707c8a8 | 2010-12-22 22:35:58 +0100 | [diff] [blame] | 652 | async.c \ |
Vladimir Chtchetkine | eb83825 | 2010-07-15 12:27:56 -0700 | [diff] [blame] | 653 | console.c \ |
David 'Digit' Turner | 18fe86e | 2010-10-19 08:07:11 +0200 | [diff] [blame] | 654 | qemu-malloc.c \ |
| 655 | cutils.c \ |
| 656 | osdep.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 657 | loader.c \ |
| 658 | monitor.c \ |
| 659 | readline.c \ |
| 660 | qemu-char-android.c \ |
Ot ten Thije | 2ff39a3 | 2010-10-06 17:48:15 +0100 | [diff] [blame] | 661 | outputchannel.c \ |
David Turner | edd3396 | 2010-09-10 00:17:41 +0200 | [diff] [blame] | 662 | qemu-error.c \ |
| 663 | qerror.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 664 | disas.c \ |
| 665 | arm-dis.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 666 | aes.c \ |
| 667 | d3des.c \ |
| 668 | vnc-android.c \ |
| 669 | acl.c \ |
David 'Digit' Turner | 18fe86e | 2010-10-19 08:07:11 +0200 | [diff] [blame] | 670 | keymaps.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 671 | buffered_file.c \ |
| 672 | cbuffer.c \ |
| 673 | gdbstub.c \ |
David Turner | 025c32f | 2010-09-10 14:52:42 +0200 | [diff] [blame] | 674 | input.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 675 | ioport.c \ |
David Turner | 025c32f | 2010-09-10 14:52:42 +0200 | [diff] [blame] | 676 | notify.c \ |
David Turner | b919805 | 2010-09-10 11:50:34 +0200 | [diff] [blame] | 677 | path.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 678 | shaper.c \ |
| 679 | charpipe.c \ |
| 680 | tcpdump.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 681 | qemu-option.c \ |
| 682 | savevm.c \ |
| 683 | net-android.c \ |
| 684 | aio-android.c \ |
| 685 | dma-helpers.c \ |
David Turner | f52506f | 2010-09-10 16:11:22 +0200 | [diff] [blame] | 686 | qemu-config.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 687 | qemu-sockets-android.c \ |
| 688 | bt-host.c \ |
| 689 | bt-vhci.c \ |
| 690 | module.c \ |
David Turner | 6a9ef17 | 2010-09-09 22:54:36 +0200 | [diff] [blame] | 691 | qemu-timer.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 692 | android/boot-properties.c \ |
Vladimir Chtchetkine | 13682a0 | 2010-06-23 16:39:44 -0700 | [diff] [blame] | 693 | android/hw-kmsg.c \ |
Vladimir Chtchetkine | a21ac69 | 2010-06-28 10:47:18 -0700 | [diff] [blame] | 694 | android/hw-lcd.c \ |
Vladimir Chtchetkine | 4057561 | 2010-07-08 10:25:06 -0700 | [diff] [blame] | 695 | android/gps.c \ |
| 696 | android/hw-events.c \ |
| 697 | android/hw-control.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 698 | android/console.c \ |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 699 | android/hw-sensors.c \ |
Vladimir Chtchetkine | cefa744 | 2010-09-01 09:17:11 -0700 | [diff] [blame] | 700 | android/hw-qemud.c \ |
Vladimir Chtchetkine | 7746af0 | 2010-10-07 05:40:39 -0700 | [diff] [blame] | 701 | android/core-init-utils.c \ |
Jaime Lopez | 1a00085 | 2010-07-21 18:03:58 -0700 | [diff] [blame] | 702 | android/config.c \ |
Ot ten Thije | ae835ac | 2010-10-18 13:37:37 +0100 | [diff] [blame] | 703 | android/snapshot.c \ |
Vladimir Chtchetkine | 90c6235 | 2011-01-13 11:24:07 -0800 | [diff] [blame] | 704 | android/utils/timezone.c \ |
Vladimir Chtchetkine | 13682a0 | 2010-06-23 16:39:44 -0700 | [diff] [blame] | 705 | |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 706 | ifeq ($(HOST_ARCH),x86) |
| 707 | CORE_MISC_SOURCES += i386-dis.c |
| 708 | endif |
| 709 | ifeq ($(HOST_ARCH),x86_64) |
| 710 | CORE_MISC_SOURCES += i386-dis.c |
| 711 | endif |
| 712 | ifeq ($(HOST_ARCH),ppc) |
Marcus Comstedt | 5e8728d | 2010-09-26 00:37:30 +0200 | [diff] [blame] | 713 | CORE_MISC_SOURCES += ppc-dis.c \ |
| 714 | cache-utils.c |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 715 | endif |
| 716 | |
| 717 | ifeq ($(HOST_OS),linux) |
| 718 | CORE_MISC_SOURCES += usb-linux.c \ |
| 719 | qemu-thread.c |
| 720 | else |
| 721 | CORE_MISC_SOURCES += usb-dummy-android.c |
| 722 | endif |
| 723 | |
| 724 | ifeq ($(HOST_OS),windows) |
| 725 | CORE_MISC_SOURCES += tap-win32.c |
David 'Digit' Turner | cb42a1b | 2010-12-23 02:54:08 +0100 | [diff] [blame] | 726 | else |
| 727 | CORE_MISC_SOURCES += posix-aio-compat.c |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 728 | endif |
| 729 | |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 730 | # sources inherited from upstream, but not fully |
| 731 | # integrated into android emulator |
| 732 | # |
| 733 | CORE_UPSTREAM_SOURCES = json-lexer.c \ |
| 734 | json-parser.c \ |
| 735 | json-streamer.c \ |
| 736 | qjson.c \ |
| 737 | qbool.c \ |
| 738 | qdict.c \ |
| 739 | qfloat.c \ |
| 740 | qint.c \ |
| 741 | qlist.c \ |
| 742 | qstring.c \ |
| 743 | |
| 744 | |
Vladimir Chtchetkine | ceb0fd0 | 2010-06-22 10:07:00 -0700 | [diff] [blame] | 745 | CORE_SOURCES = $(CORE_BLOCK_SOURCES) $(CORE_HW_SOURCES) |
| 746 | CORE_SOURCES += $(CORE_MIGRATION_SOURCES) $(CORE_MISC_SOURCES) |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 747 | CORE_SOURCES += $(CORE_UPSTREAM_SOURCES) |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 748 | |
David 'Digit' Turner | ca29fbb | 2011-01-02 13:17:22 +0100 | [diff] [blame] | 749 | CORE_SOURCES += android/audio-test.c |
| 750 | |
Vladimir Chtchetkine | a05284d | 2010-06-10 10:45:55 -0700 | [diff] [blame] | 751 | ############################################################################## |
Vladimir Chtchetkine | 13682a0 | 2010-06-23 16:39:44 -0700 | [diff] [blame] | 752 | # lists of source files used to build the emulator UI |
| 753 | # |
| 754 | |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 755 | UI_SOURCES = loadpng.c \ |
Vladimir Chtchetkine | 7258f6b | 2010-07-14 10:04:01 -0700 | [diff] [blame] | 756 | android/user-config.c \ |
Vladimir Chtchetkine | 13682a0 | 2010-06-23 16:39:44 -0700 | [diff] [blame] | 757 | android/resource.c \ |
Vladimir Chtchetkine | 13682a0 | 2010-06-23 16:39:44 -0700 | [diff] [blame] | 758 | android/qemulator.c \ |
| 759 | android/keycode.c \ |
Vladimir Chtchetkine | 4057561 | 2010-07-08 10:25:06 -0700 | [diff] [blame] | 760 | android/help.c \ |
Vladimir Chtchetkine | 90c6235 | 2011-01-13 11:24:07 -0800 | [diff] [blame] | 761 | android/avd/info.c \ |
Vladimir Chtchetkine | 13682a0 | 2010-06-23 16:39:44 -0700 | [diff] [blame] | 762 | |
| 763 | ############################################################################## |
Vladimir Chtchetkine | 71bb14f | 2010-07-07 15:57:00 -0700 | [diff] [blame] | 764 | # lists of source files used by both, emulator UI and emulator core |
| 765 | # |
| 766 | |
David 'Digit' Turner | 18fe86e | 2010-10-19 08:07:11 +0200 | [diff] [blame] | 767 | UI_AND_CORE_SOURCES = \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 768 | sockets.c \ |
| 769 | android/keycode-array.c \ |
Vladimir Chtchetkine | 71bb14f | 2010-07-07 15:57:00 -0700 | [diff] [blame] | 770 | android/charmap.c \ |
David 'Digit' Turner | 6d44880 | 2010-11-18 16:14:03 +0100 | [diff] [blame] | 771 | android/async-utils.c \ |
Vladimir Chtchetkine | a8fc491 | 2010-11-30 09:32:55 -0800 | [diff] [blame] | 772 | android/sync-utils.c \ |
David 'Digit' Turner | 6d44880 | 2010-11-18 16:14:03 +0100 | [diff] [blame] | 773 | android/async-console.c \ |
David 'Digit' Turner | 4c0f745 | 2010-11-17 17:55:17 +0100 | [diff] [blame] | 774 | android/utils/assert.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 775 | android/utils/bufprint.c \ |
| 776 | android/utils/debug.c \ |
David 'Digit' Turner | 7a17b60 | 2010-11-17 17:58:29 +0100 | [diff] [blame] | 777 | android/utils/path.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 778 | android/utils/dirscanner.c \ |
| 779 | android/utils/filelock.c \ |
David 'Digit' Turner | 4c0f745 | 2010-11-17 17:55:17 +0100 | [diff] [blame] | 780 | android/utils/mapfile.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 781 | android/utils/misc.c \ |
David 'Digit' Turner | 4c0f745 | 2010-11-17 17:55:17 +0100 | [diff] [blame] | 782 | android/utils/panic.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 783 | android/utils/reflist.c \ |
David 'Digit' Turner | 4c0f745 | 2010-11-17 17:55:17 +0100 | [diff] [blame] | 784 | android/utils/refset.c \ |
Vladimir Chtchetkine | a678138 | 2010-07-09 09:19:37 -0700 | [diff] [blame] | 785 | android/utils/stralloc.c \ |
| 786 | android/utils/system.c \ |
| 787 | android/utils/tempfile.c \ |
David 'Digit' Turner | 4c0f745 | 2010-11-17 17:55:17 +0100 | [diff] [blame] | 788 | android/utils/vector.c \ |
Vladimir Chtchetkine | 074d1f9 | 2010-08-06 09:29:50 -0700 | [diff] [blame] | 789 | android/avd/hw-config.c \ |
Vladimir Chtchetkine | 074d1f9 | 2010-08-06 09:29:50 -0700 | [diff] [blame] | 790 | android/utils/ini.c \ |
Vladimir Chtchetkine | 71bb14f | 2010-07-07 15:57:00 -0700 | [diff] [blame] | 791 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 792 | # include the Zlib sources |
| 793 | # |
| 794 | UI_AND_CORE_SOURCES += $(ZLIB_SOURCES) |
| 795 | UI_AND_CORE_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 796 | |
| 797 | # include the Libpng sources |
| 798 | # |
| 799 | UI_AND_CORE_SOURCES += $(LIBPNG_SOURCES) |
| 800 | UI_AND_CORE_CFLAGS += $(LIBPNG_CFLAGS) -I$(LOCAL_PATH)/$(LIBPNG_DIR) |
| 801 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 802 | # The common libraries |
| 803 | # |
| 804 | QEMU_SYSTEM_LDLIBS := -lm |
| 805 | ifeq ($(HOST_OS),windows) |
| 806 | QEMU_SYSTEM_LDLIBS += -mno-cygwin -mwindows -mconsole |
| 807 | endif |
| 808 | |
| 809 | ifeq ($(HOST_OS),freebsd) |
| 810 | QEMU_SYSTEM_LDLIBS += -L/usr/local/lib -lpthread -lX11 -lutil |
| 811 | endif |
| 812 | |
| 813 | ifeq ($(HOST_OS),linux) |
| 814 | QEMU_SYSTEM_LDLIBS += -lutil -lrt |
| 815 | endif |
| 816 | |
| 817 | ifeq ($(HOST_OS),windows) |
| 818 | QEMU_SYSTEM_LDLIBS += -lwinmm -lws2_32 -liphlpapi |
| 819 | else |
| 820 | QEMU_SYSTEM_LDLIBS += -lpthread |
| 821 | endif |
| 822 | |
David 'Digit' Turner | 393c0f1 | 2010-07-28 12:20:56 -0700 | [diff] [blame] | 823 | ifeq ($(HOST_OS),darwin) |
| 824 | QEMU_SYSTEM_LDLIBS += -Wl,-framework,Cocoa |
| 825 | endif |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 826 | |
| 827 | |
Vladimir Chtchetkine | 71bb14f | 2010-07-07 15:57:00 -0700 | [diff] [blame] | 828 | ############################################################################## |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 829 | # now build the emulator itself |
| 830 | # |
| 831 | include $(CLEAR_VARS) |
| 832 | |
Vladimir Chtchetkine | 2fa5173 | 2010-07-16 11:19:48 -0700 | [diff] [blame] | 833 | LOCAL_GENERATED_SOURCES := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 834 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 835 | LOCAL_CC := $(MY_CC) |
| 836 | LOCAL_MODULE := emulator |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 837 | LOCAL_STATIC_LIBRARIES := emulator-memcheck emulator-hw emulator-arm emulator-tcg |
| 838 | LOCAL_STATIC_LIBRARIES += emulator-elff |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 839 | LOCAL_STATIC_LIBRARIES += emulator-core emulator-uilib |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 840 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 841 | |
Vladimir Chtchetkine | 526a991 | 2010-06-10 11:15:27 -0700 | [diff] [blame] | 842 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS) $(EMULATOR_UI_CFLAGS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 843 | |
| 844 | # add the build ID to the default macro definitions |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 845 | LOCAL_CFLAGS += $(UI_AND_CORE_CFLAGS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 846 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 847 | # include sound support source files. we first try to see if we have a prebuilt audio |
| 848 | # library. if not, we build things the "hard" way. |
| 849 | # |
| 850 | # note that to generate the prebuilt audio library, you should do the following: |
| 851 | # |
| 852 | # cd tools/qemu |
| 853 | # ./android-rebuild.sh |
| 854 | # distrib/update-audio.sh |
| 855 | # |
| 856 | ifeq ($(QEMU_AUDIO_LIB),) |
| 857 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 858 | endif # !QEMU_AUDIO_LIB |
| 859 | |
| 860 | LOCAL_CFLAGS += $(AUDIO_CFLAGS) |
| 861 | LOCAL_LDLIBS += $(AUDIO_LDLIBS) |
| 862 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 863 | # the linux-user sources, I doubt we really need these |
| 864 | # |
| 865 | #LINUX_SOURCES := main.c elfload.c mmap.c signal.c path.c syscall.c |
| 866 | #LOCAL_SRC_FILES += $(LINUX_SOURCES:%=linux-user/%) |
| 867 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 868 | ifeq ($(HOST_ARCH),x86) |
| 869 | # enable MMX code for our skin scaler |
| 870 | LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx |
| 871 | endif |
| 872 | |
| 873 | # include other sources |
| 874 | # |
David 'Digit' Turner | e3fdd07 | 2011-02-02 14:43:23 +0100 | [diff] [blame] | 875 | VL_SOURCES := android/framebuffer.c \ |
David 'Digit' Turner | 34f2974 | 2010-05-25 18:16:10 -0700 | [diff] [blame] | 876 | user-events-qemu.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 877 | android/cmdline-option.c \ |
David 'Digit' Turner | 07db349 | 2011-02-02 17:36:34 +0100 | [diff] [blame] | 878 | android/display.c \ |
David 'Digit' Turner | 7a17b60 | 2010-11-17 17:58:29 +0100 | [diff] [blame] | 879 | android/looper-qemu.c \ |
Vladimir Chtchetkine | 777eb68 | 2011-01-26 11:19:19 -0800 | [diff] [blame] | 880 | android/protocol/ui-commands-qemu.c \ |
| 881 | android/protocol/core-commands-qemu.c \ |
David 'Digit' Turner | f845627 | 2011-02-02 12:34:14 +0100 | [diff] [blame] | 882 | android/main-common.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 883 | android/main.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 884 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 885 | # Add common system libraries |
| 886 | # |
| 887 | LOCAL_LDLIBS += $(QEMU_SYSTEM_LDLIBS) |
Alexey Tarasov | 43fbac1 | 2009-06-15 14:28:15 +1100 | [diff] [blame] | 888 | |
Vladimir Chtchetkine | 71bb14f | 2010-07-07 15:57:00 -0700 | [diff] [blame] | 889 | LOCAL_SRC_FILES += $(VL_SOURCES) $(CORE_SOURCES) $(UI_SOURCES) $(UI_AND_CORE_SOURCES) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 890 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 891 | # add SDL-specific flags |
| 892 | # |
| 893 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 894 | LOCAL_LDLIBS += $(SDL_LDLIBS) |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 895 | LOCAL_STATIC_LIBRARIES += $(SDL_STATIC_LIBRARIES) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 896 | |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 897 | # add ELFF-specific flags |
| 898 | # |
| 899 | LOCAL_LDLIBS += $(ELFF_LDLIBS) |
| 900 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 901 | # on Windows, link the icon file as well into the executable |
| 902 | # unfortunately, our build system doesn't help us much, so we need |
| 903 | # to use some weird pathnames to make this work... |
| 904 | # |
| 905 | ifeq ($(HOST_OS),windows) |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 906 | |
| 907 | # Locate windres executable |
| 908 | WINDRES := windres |
| 909 | ifneq ($(USE_MINGW),) |
| 910 | # When building the Windows emulator under Linux, use the MinGW one |
| 911 | WINDRES := i586-mingw32msvc-windres |
| 912 | endif |
| 913 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 914 | INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 915 | ANDROID_ICON_OBJ := android_icon.o |
| 916 | ANDROID_ICON_PATH := $(LOCAL_PATH)/images |
| 917 | $(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 918 | $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 919 | |
| 920 | # seems to be the only way to add an object file that was not generated from |
| 921 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 922 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 923 | # us to put the object file in the source directory... |
| 924 | # |
| 925 | LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ) |
| 926 | endif |
| 927 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 928 | # qemu-options.h is generated from qemu-options.hx with the "hxtool" shell script |
| 929 | # |
| 930 | intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 931 | |
| 932 | QEMU_OPTIONS_H := $(intermediates)/qemu-options.h |
| 933 | $(QEMU_OPTIONS_H): PRIVATE_PATH := $(LOCAL_PATH) |
| 934 | $(QEMU_OPTIONS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ |
| 935 | $(QEMU_OPTIONS_H): $(LOCAL_PATH)/qemu-options.hx $(LOCAL_PATH)/hxtool |
| 936 | $(transform-generated-source) |
| 937 | |
| 938 | $(intermediates)/vl-android.o: $(QEMU_OPTIONS_H) |
| 939 | |
| 940 | LOCAL_GENERATED_SOURCES += $(QEMU_OPTIONS_H) |
| 941 | |
| 942 | # qemu-monitor.h is generated from qemu-monitor.hx with the "hxtool" shell script |
| 943 | # |
| 944 | intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 945 | |
| 946 | QEMU_MONITOR_H := $(intermediates)/qemu-monitor.h |
| 947 | $(QEMU_MONITOR_H): PRIVATE_PATH := $(LOCAL_PATH) |
| 948 | $(QEMU_MONITOR_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ |
| 949 | $(QEMU_MONITOR_H): $(LOCAL_PATH)/qemu-monitor.hx $(LOCAL_PATH)/hxtool |
| 950 | $(transform-generated-source) |
| 951 | |
| 952 | $(intermediates)/vl-android.o: $(QEMU_MONITOR_H) |
| 953 | |
| 954 | LOCAL_GENERATED_SOURCES += $(QEMU_MONITOR_H) |
| 955 | |
| 956 | |
| 957 | # gdbstub-xml.c contains C-compilable arrays corresponding to the content |
| 958 | # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script. |
| 959 | # |
| 960 | ifeq ($(QEMU_TARGET_XML_SOURCES),) |
| 961 | QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3 |
| 962 | QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml) |
| 963 | endif |
| 964 | |
| 965 | QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c |
| 966 | $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH) |
| 967 | $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES) |
| 968 | $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES) |
| 969 | $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh |
| 970 | $(hide) rm -f $@ |
| 971 | $(transform-generated-source) |
| 972 | |
| 973 | $(intermediates)/vl-android.o: $(QEMU_GDBSTUB_XML_C) |
| 974 | |
| 975 | LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C) |
| 976 | |
David 'Digit' Turner | 065242d | 2009-10-07 13:43:33 -0700 | [diff] [blame] | 977 | # hw-config-defs.h is generated from android/avd/hardware-properties.ini |
| 978 | # |
David 'Digit' Turner | 2ec4559 | 2009-10-07 14:48:19 -0700 | [diff] [blame] | 979 | QEMU_HARDWARE_PROPERTIES_INI := $(LOCAL_PATH)/android/avd/hardware-properties.ini |
David 'Digit' Turner | 065242d | 2009-10-07 13:43:33 -0700 | [diff] [blame] | 980 | QEMU_HW_CONFIG_DEFS_H := $(LOCAL_PATH)/android/avd/hw-config-defs.h |
| 981 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_PATH := $(LOCAL_PATH) |
David 'Digit' Turner | 2ec4559 | 2009-10-07 14:48:19 -0700 | [diff] [blame] | 982 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_SOURCES := $(QEMU_HARDWARE_PROPERTIES_INI) |
| 983 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/android/tools/gen-hw-config.py $(QEMU_HARDWARE_PROPERTIES_INI) $@ |
| 984 | $(QEMU_HW_CONFIG_DEFS_H): $(QEMU_HARDWARE_PROPERTIES_INI) $(LOCAL_PATH)/android/tools/gen-hw-config.py |
David 'Digit' Turner | 065242d | 2009-10-07 13:43:33 -0700 | [diff] [blame] | 985 | $(hide) rm -f $@ |
| 986 | $(transform-generated-source) |
| 987 | |
| 988 | $(LOCAL_PATH)/android/avd/hw-config.h: $(QEMU_HW_CONFIG_DEFS_H) |
| 989 | |
| 990 | LOCAL_GENERATED_SOURCES += $(QEMU_HW_CONFIG_DEFS_H) |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 991 | |
| 992 | # this is already done by the Android build system, but is done for the |
| 993 | # benefit of the stand-alone one. |
| 994 | # |
| 995 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 996 | LOCAL_CFLAGS += -I$(intermediates) |
| 997 | endif |
| 998 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 999 | LOCAL_LDLIBS += $(QEMU_AUDIO_LIB) |
| 1000 | |
David 'Digit' Turner | ab873b7 | 2010-03-08 18:33:50 -0800 | [diff] [blame] | 1001 | # Generate a completely static executable if needed. |
| 1002 | # Note that this means no sound and graphics on Linux. |
| 1003 | # |
| 1004 | ifeq ($(CONFIG_STATIC_EXECUTABLE),true) |
| 1005 | LOCAL_SRC_FILES += dynlink-static.c |
| 1006 | LOCAL_LDLIBS += -static |
| 1007 | endif |
| 1008 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 1009 | LOCAL_MODULE := emulator |
| 1010 | |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 1011 | # See comment about SDLMAIN_SOURCES in the 'emulator-uilib' module declarations. |
David 'Digit' Turner | ca85ee2 | 2010-06-10 15:14:55 -0700 | [diff] [blame] | 1012 | LOCAL_SRC_FILES += $(SDLMAIN_SOURCES) |
| 1013 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 1014 | include $(BUILD_HOST_EXECUTABLE) |
| 1015 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1016 | ############################################################################## |
| 1017 | # Build standalone emulator core. |
| 1018 | # |
| 1019 | include $(CLEAR_VARS) |
| 1020 | |
Vladimir Chtchetkine | 3f16680 | 2010-08-26 08:25:06 -0700 | [diff] [blame] | 1021 | LOCAL_GENERATED_SOURCES := |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1022 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 1023 | LOCAL_CC := $(MY_CC) |
| 1024 | LOCAL_MODULE := qemu-android |
| 1025 | LOCAL_STATIC_LIBRARIES := emulator-memcheck emulator-hw emulator-arm emulator-tcg |
| 1026 | LOCAL_STATIC_LIBRARIES += emulator-elff |
| 1027 | LOCAL_STATIC_LIBRARIES += emulator-core |
| 1028 | LOCAL_LDLIBS := $(MY_LDLIBS) |
| 1029 | |
| 1030 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS) |
| 1031 | LOCAL_CFLAGS += $(UI_AND_CORE_CFLAGS) -DCONFIG_STANDALONE_CORE |
| 1032 | |
| 1033 | # include sound support source files. we first try to see if we have a prebuilt audio |
| 1034 | # library. if not, we build things the "hard" way. |
| 1035 | # |
| 1036 | # note that to generate the prebuilt audio library, you should do the following: |
| 1037 | # |
| 1038 | # cd tools/qemu |
| 1039 | # ./android-rebuild.sh |
| 1040 | # distrib/update-audio.sh |
| 1041 | # |
| 1042 | ifeq ($(QEMU_AUDIO_LIB),) |
| 1043 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 1044 | endif # !QEMU_AUDIO_LIB |
| 1045 | |
| 1046 | LOCAL_CFLAGS += $(AUDIO_CFLAGS) |
| 1047 | LOCAL_LDLIBS += $(AUDIO_LDLIBS) |
| 1048 | |
| 1049 | # the linux-user sources, I doubt we really need these |
| 1050 | # |
| 1051 | #LINUX_SOURCES := main.c elfload.c mmap.c signal.c path.c syscall.c |
| 1052 | #LOCAL_SRC_FILES += $(LINUX_SOURCES:%=linux-user/%) |
| 1053 | |
| 1054 | # include other sources |
| 1055 | # |
David 'Digit' Turner | e3fdd07 | 2011-02-02 14:43:23 +0100 | [diff] [blame] | 1056 | VL_SOURCES := android/framebuffer.c \ |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1057 | user-events-qemu.c \ |
David 'Digit' Turner | 7a17b60 | 2010-11-17 17:58:29 +0100 | [diff] [blame] | 1058 | android/looper-qemu.c \ |
| 1059 | android/looper-generic.c \ |
Vladimir Chtchetkine | 72d83df | 2010-12-14 09:24:02 -0800 | [diff] [blame] | 1060 | android/display-core.c \ |
Vladimir Chtchetkine | 8527680 | 2011-01-31 15:18:45 -0800 | [diff] [blame] | 1061 | android/protocol/attach-ui-proxy.c \ |
Vladimir Chtchetkine | 94a2fba | 2011-01-31 10:49:06 -0800 | [diff] [blame] | 1062 | android/protocol/fb-updates-proxy.c \ |
Vladimir Chtchetkine | 250b2e0 | 2011-01-28 10:56:16 -0800 | [diff] [blame] | 1063 | android/protocol/user-events-impl.c \ |
Vladimir Chtchetkine | 777eb68 | 2011-01-26 11:19:19 -0800 | [diff] [blame] | 1064 | android/protocol/ui-commands-proxy.c \ |
| 1065 | android/protocol/core-commands-impl.c \ |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1066 | |
| 1067 | # Add common system libraries |
| 1068 | # |
| 1069 | LOCAL_LDLIBS += $(QEMU_SYSTEM_LDLIBS) |
| 1070 | |
| 1071 | LOCAL_SRC_FILES += $(VL_SOURCES) $(CORE_SOURCES) $(UI_AND_CORE_SOURCES) |
| 1072 | |
| 1073 | # add ELFF-specific flags |
| 1074 | # |
| 1075 | LOCAL_LDLIBS += $(ELFF_LDLIBS) |
| 1076 | |
| 1077 | # on Windows, link the icon file as well into the executable |
| 1078 | # unfortunately, our build system doesn't help us much, so we need |
| 1079 | # to use some weird pathnames to make this work... |
| 1080 | # |
| 1081 | ifeq ($(HOST_OS),windows) |
| 1082 | |
| 1083 | # Locate windres executable |
| 1084 | WINDRES := windres |
| 1085 | ifneq ($(USE_MINGW),) |
| 1086 | # When building the Windows emulator under Linux, use the MinGW one |
| 1087 | WINDRES := i586-mingw32msvc-windres |
| 1088 | endif |
| 1089 | |
| 1090 | INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 1091 | ANDROID_ICON_OBJ := android_icon.o |
| 1092 | ANDROID_ICON_PATH := $(LOCAL_PATH)/images |
| 1093 | $(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc |
| 1094 | $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@ |
| 1095 | |
| 1096 | # seems to be the only way to add an object file that was not generated from |
| 1097 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 1098 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 1099 | # us to put the object file in the source directory... |
| 1100 | # |
| 1101 | LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ) |
| 1102 | endif |
| 1103 | |
Vladimir Chtchetkine | 3f16680 | 2010-08-26 08:25:06 -0700 | [diff] [blame] | 1104 | # qemu-options.h is generated from qemu-options.hx with the "hxtool" shell script |
| 1105 | # |
| 1106 | intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 1107 | |
| 1108 | QEMU_OPTIONS_H := $(intermediates)/qemu-options.h |
| 1109 | $(QEMU_OPTIONS_H): PRIVATE_PATH := $(LOCAL_PATH) |
| 1110 | $(QEMU_OPTIONS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ |
| 1111 | $(QEMU_OPTIONS_H): $(LOCAL_PATH)/qemu-options.hx $(LOCAL_PATH)/hxtool |
| 1112 | $(transform-generated-source) |
| 1113 | |
| 1114 | $(intermediates)/vl-android.o: $(QEMU_OPTIONS_H) |
| 1115 | |
| 1116 | LOCAL_GENERATED_SOURCES += $(QEMU_OPTIONS_H) |
| 1117 | |
| 1118 | # qemu-monitor.h is generated from qemu-monitor.hx with the "hxtool" shell script |
| 1119 | # |
| 1120 | intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 1121 | |
| 1122 | QEMU_MONITOR_H := $(intermediates)/qemu-monitor.h |
| 1123 | $(QEMU_MONITOR_H): PRIVATE_PATH := $(LOCAL_PATH) |
| 1124 | $(QEMU_MONITOR_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ |
| 1125 | $(QEMU_MONITOR_H): $(LOCAL_PATH)/qemu-monitor.hx $(LOCAL_PATH)/hxtool |
| 1126 | $(transform-generated-source) |
| 1127 | |
| 1128 | $(intermediates)/vl-android.o: $(QEMU_MONITOR_H) |
| 1129 | |
| 1130 | LOCAL_GENERATED_SOURCES += $(QEMU_MONITOR_H) |
| 1131 | |
| 1132 | |
| 1133 | # gdbstub-xml.c contains C-compilable arrays corresponding to the content |
| 1134 | # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script. |
| 1135 | # |
| 1136 | ifeq ($(QEMU_TARGET_XML_SOURCES),) |
| 1137 | QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3 |
| 1138 | QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml) |
| 1139 | endif |
| 1140 | |
| 1141 | QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c |
| 1142 | $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH) |
| 1143 | $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES) |
| 1144 | $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES) |
| 1145 | $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh |
| 1146 | $(hide) rm -f $@ |
| 1147 | $(transform-generated-source) |
| 1148 | |
| 1149 | $(intermediates)/vl-android.o: $(QEMU_GDBSTUB_XML_C) |
| 1150 | |
| 1151 | LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C) |
| 1152 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1153 | # this is already done by the Android build system, but is done for the |
| 1154 | # benefit of the stand-alone one. |
| 1155 | # |
| 1156 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 1157 | LOCAL_CFLAGS += -I$(intermediates) |
| 1158 | endif |
| 1159 | |
| 1160 | # other flags |
| 1161 | ifneq ($(HOST_OS),windows) |
| 1162 | LOCAL_LDLIBS += -ldl |
| 1163 | endif |
| 1164 | |
| 1165 | LOCAL_LDLIBS += $(QEMU_AUDIO_LIB) |
| 1166 | |
David 'Digit' Turner | 415a4b1 | 2010-07-28 12:20:14 -0700 | [diff] [blame] | 1167 | ifeq ($(HOST_OS),darwin) |
| 1168 | FRAMEWORKS := OpenGL Cocoa QuickTime ApplicationServices Carbon IOKit |
| 1169 | LOCAL_LDLIBS += $(FRAMEWORKS:%=-Wl,-framework,%) |
| 1170 | endif |
| 1171 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1172 | # Generate a completely static executable if needed. |
| 1173 | # Note that this means no sound and graphics on Linux. |
| 1174 | # |
| 1175 | ifeq ($(CONFIG_STATIC_EXECUTABLE),true) |
| 1176 | LOCAL_SRC_FILES += dynlink-static.c |
| 1177 | LOCAL_LDLIBS += -static |
| 1178 | endif |
| 1179 | |
| 1180 | LOCAL_MODULE := qemu-android |
David 'Digit' Turner | d95fd13 | 2010-09-20 12:19:11 +0200 | [diff] [blame] | 1181 | LOCAL_MODULE_TAGS := debug |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 1182 | |
| 1183 | include $(BUILD_HOST_EXECUTABLE) |
| 1184 | |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 1185 | ############################################################################## |
| 1186 | # now build the emulator UI |
| 1187 | # |
| 1188 | include $(CLEAR_VARS) |
| 1189 | |
| 1190 | LOCAL_GENERATED_SOURCES := |
| 1191 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 1192 | LOCAL_CC := $(MY_CC) |
| 1193 | LOCAL_MODULE := emulator-ui |
| 1194 | LOCAL_STATIC_LIBRARIES := emulator-uilib |
| 1195 | LOCAL_LDLIBS := $(MY_LDLIBS) |
| 1196 | |
Jean-Baptiste Queru | 79949d6 | 2010-10-22 20:57:47 -0700 | [diff] [blame] | 1197 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_UI_CFLAGS) $(EMULATOR_CORE_CFLAGS) |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 1198 | |
| 1199 | # add the build ID to the default macro definitions |
| 1200 | LOCAL_CFLAGS += $(UI_AND_CORE_CFLAGS) -DCONFIG_STANDALONE_UI |
| 1201 | |
| 1202 | ifeq ($(HOST_ARCH),x86) |
| 1203 | # enable MMX code for our skin scaler |
| 1204 | LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx |
| 1205 | endif |
| 1206 | |
| 1207 | # include other sources |
| 1208 | # |
David 'Digit' Turner | e3fdd07 | 2011-02-02 14:43:23 +0100 | [diff] [blame] | 1209 | VL_SOURCES := android/framebuffer.c \ |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 1210 | android/cmdline-option.c \ |
| 1211 | android/config.c \ |
David 'Digit' Turner | 7a17b60 | 2010-11-17 17:58:29 +0100 | [diff] [blame] | 1212 | android/looper-generic.c \ |
Ot ten Thije | ae835ac | 2010-10-18 13:37:37 +0100 | [diff] [blame] | 1213 | android/snapshot.c \ |
David 'Digit' Turner | f845627 | 2011-02-02 12:34:14 +0100 | [diff] [blame] | 1214 | android/main-common.c \ |
Vladimir Chtchetkine | d2c51cf | 2010-11-24 08:49:08 -0800 | [diff] [blame] | 1215 | android/main-ui.c \ |
Vladimir Chtchetkine | 008c97e | 2010-10-08 08:22:06 -0700 | [diff] [blame] | 1216 | vl-android-ui.c \ |
David 'Digit' Turner | 7a17b60 | 2010-11-17 17:58:29 +0100 | [diff] [blame] | 1217 | iolooper-select.c \ |
David 'Digit' Turner | e993126 | 2011-02-02 14:05:23 +0100 | [diff] [blame] | 1218 | android/protocol/core-connection.c \ |
Vladimir Chtchetkine | 8527680 | 2011-01-31 15:18:45 -0800 | [diff] [blame] | 1219 | android/protocol/attach-ui-impl.c \ |
Vladimir Chtchetkine | 94a2fba | 2011-01-31 10:49:06 -0800 | [diff] [blame] | 1220 | android/protocol/fb-updates-impl.c \ |
Vladimir Chtchetkine | 777eb68 | 2011-01-26 11:19:19 -0800 | [diff] [blame] | 1221 | android/protocol/ui-commands-impl.c \ |
| 1222 | android/protocol/core-commands-proxy.c \ |
Vladimir Chtchetkine | 250b2e0 | 2011-01-28 10:56:16 -0800 | [diff] [blame] | 1223 | android/protocol/user-events-proxy.c \ |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 1224 | |
| 1225 | # Add common system libraries |
| 1226 | # |
| 1227 | LOCAL_LDLIBS += $(QEMU_SYSTEM_LDLIBS) |
| 1228 | |
| 1229 | LOCAL_SRC_FILES += $(VL_SOURCES) $(UI_SOURCES) $(UI_AND_CORE_SOURCES) |
| 1230 | |
| 1231 | # add SDL-specific flags |
| 1232 | # |
| 1233 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 1234 | LOCAL_LDLIBS += $(SDL_LDLIBS) |
| 1235 | LOCAL_STATIC_LIBRARIES += $(SDL_STATIC_LIBRARIES) |
| 1236 | |
| 1237 | # on Windows, link the icon file as well into the executable |
| 1238 | # unfortunately, our build system doesn't help us much, so we need |
| 1239 | # to use some weird pathnames to make this work... |
| 1240 | # |
| 1241 | ifeq ($(HOST_OS),windows) |
| 1242 | |
| 1243 | # Locate windres executable |
| 1244 | WINDRES := windres |
| 1245 | ifneq ($(USE_MINGW),) |
| 1246 | # When building the Windows emulator under Linux, use the MinGW one |
| 1247 | WINDRES := i586-mingw32msvc-windres |
| 1248 | endif |
| 1249 | |
| 1250 | INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 1251 | ANDROID_ICON_OBJ := android_icon.o |
| 1252 | ANDROID_ICON_PATH := $(LOCAL_PATH)/images |
| 1253 | $(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc |
| 1254 | $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@ |
| 1255 | |
| 1256 | # seems to be the only way to add an object file that was not generated from |
| 1257 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 1258 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 1259 | # us to put the object file in the source directory... |
| 1260 | # |
| 1261 | LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ) |
| 1262 | endif |
| 1263 | |
| 1264 | # this is already done by the Android build system, but is done for the |
| 1265 | # benefit of the stand-alone one. |
| 1266 | # |
| 1267 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 1268 | LOCAL_CFLAGS += -I$(intermediates) |
| 1269 | endif |
| 1270 | |
| 1271 | # Generate a completely static executable if needed. |
| 1272 | # Note that this means no sound and graphics on Linux. |
| 1273 | # |
| 1274 | ifeq ($(CONFIG_STATIC_EXECUTABLE),true) |
| 1275 | LOCAL_SRC_FILES += dynlink-static.c |
| 1276 | LOCAL_LDLIBS += -static |
| 1277 | endif |
| 1278 | |
| 1279 | # See comment about SDLMAIN_SOURCES in the 'emulator-uilib' module declarations. |
| 1280 | LOCAL_SRC_FILES += $(SDLMAIN_SOURCES) |
| 1281 | |
| 1282 | include $(BUILD_HOST_EXECUTABLE) |
| 1283 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 1284 | endif # TARGET_ARCH == arm |