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 | |
| 4 | # determine the location of platform-specific directories |
| 5 | # |
| 6 | CONFIG_DIRS := \ |
| 7 | $(LOCAL_PATH)/android/config \ |
| 8 | $(LOCAL_PATH)/android/config/$(HOST_PREBUILT_TAG) |
| 9 | |
| 10 | CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%) |
| 11 | |
Kenny Root | 095cd0f | 2009-09-19 18:32:44 -0500 | [diff] [blame] | 12 | MY_CC := $(HOST_CC) |
| 13 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 14 | MY_OPTIM := -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer |
| 15 | ifeq ($(BUILD_DEBUG_EMULATOR),true) |
| 16 | MY_OPTIM := -O0 -g |
| 17 | endif |
| 18 | |
David 'Digit' Turner | 9a0f1fb | 2010-02-25 14:22:29 -0800 | [diff] [blame] | 19 | MY_CFLAGS := $(CONFIG_INCLUDES) $(MY_OPTIM) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 20 | |
David 'Digit' Turner | 466f548 | 2009-07-30 15:50:19 +0200 | [diff] [blame] | 21 | # Overwrite configuration for debug builds. |
| 22 | # |
| 23 | ifeq ($(BUILD_DEBUG_EMULATOR),true) |
| 24 | MY_CFLAGS := $(CONFIG_INCLUDES) -O0 -g \ |
| 25 | -fno-PIC -falign-functions=0 |
| 26 | endif |
| 27 | |
David 'Digit' Turner | 9a0f1fb | 2010-02-25 14:22:29 -0800 | [diff] [blame] | 28 | MY_CFLAGS += -DCONFIG_MEMCHECK |
| 29 | |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 30 | MY_LDLIBS := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 31 | |
| 32 | # this is needed to build the emulator on 64-bit Linux systems |
| 33 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
| 34 | MY_CFLAGS += -Wa,--32 |
| 35 | endif |
| 36 | |
| 37 | ifeq ($(HOST_OS),freebsd) |
| 38 | MY_CFLAGS += -Wa,--32 -I /usr/local/include |
| 39 | endif |
| 40 | |
| 41 | ifeq ($(HOST_OS),windows) |
| 42 | MY_CFLAGS += -D_WIN32 -mno-cygwin |
| 43 | # we need Win32 features that are available since Windows 2000 Professional/Server (NT 5.0) |
| 44 | MY_CFLAGS += -DWINVER=0x501 |
| 45 | endif |
| 46 | |
| 47 | ifeq ($(HOST_ARCH),ppc) |
| 48 | MY_CFLAGS += -D__powerpc__ |
| 49 | endif |
| 50 | |
| 51 | ifeq ($(HOST_OS),darwin) |
David 'Digit' Turner | 2c538c8 | 2010-05-10 16:48:20 -0700 | [diff] [blame] | 52 | MY_CFLAGS += -mdynamic-no-pic -fno-exceptions |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 53 | |
| 54 | # When building on Leopard or above, we need to use the 10.4 SDK |
| 55 | # or the generated binary will not run on Tiger. |
| 56 | DARWIN_VERSION := $(strip $(shell sw_vers -productVersion)) |
| 57 | ifneq ($(filter 10.1 10.2 10.3 10.1.% 10.2.% 10.3.%,$(DARWIN_VERSION)),) |
| 58 | $(error Building the Android emulator requires OS X 10.4 or above) |
| 59 | endif |
| 60 | ifeq ($(filter 10.4 10.4.%,$(DARWIN_VERSION)),) |
| 61 | # We are on Leopard or above |
| 62 | TIGER_SDK := /Developer/SDKs/MacOSX10.4u.sdk |
| 63 | ifeq ($(strip $(wildcard $(TIGER_SDK))),) |
| 64 | $(info Please install the 10.4 SDK on this machine at $(TIGER_SDK)) |
| 65 | $(error Aborting the build.) |
| 66 | endif |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 67 | MY_CFLAGS += -isysroot $(TIGER_SDK) -mmacosx-version-min=10.4 -DMACOSX_DEPLOYMENT_TARGET=10.4 |
| 68 | MY_LDLIBS += -isysroot $(TIGER_SDK) -Wl,-syslibroot,$(TIGER_SDK) -mmacosx-version-min=10.4 |
Kenny Root | 095cd0f | 2009-09-19 18:32:44 -0500 | [diff] [blame] | 69 | |
| 70 | # Beginning with Snow Leopard, the default compiler is GCC 4.2 |
| 71 | # which is incompatible with the 10.4 SDK, so we must |
| 72 | # specify the use of GCC 4.0. |
| 73 | ifeq ($(filter 10.5 10.5.%,$(DARWIN_VERSION)),) |
| 74 | # We are on Snow Leopard or above |
| 75 | MY_CC := gcc-4.0 |
| 76 | endif |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 77 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 78 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 79 | |
| 80 | # BUILD_STANDALONE_EMULATOR is only defined when building with |
| 81 | # the android-rebuild.sh script. The script will also provide |
| 82 | # adequate values for HOST_CC |
| 83 | # |
| 84 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 85 | |
| 86 | ifneq ($(USE_CCACHE),) |
| 87 | MY_CC := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache $(MY_CC) |
| 88 | endif |
| 89 | endif |
| 90 | |
| 91 | |
| 92 | ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true) |
| 93 | ifneq ($(HOST_ARCH),x86_64) |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 94 | MY_CFLAGS += -m32 |
| 95 | MY_LDLIBS += -m32 |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 96 | endif |
| 97 | endif |
| 98 | |
| 99 | include $(CLEAR_VARS) |
| 100 | |
| 101 | ########################################################### |
| 102 | # Zlib configuration |
| 103 | # |
| 104 | ZLIB_DIR := distrib/zlib-1.2.3 |
| 105 | include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make |
| 106 | |
| 107 | ########################################################### |
| 108 | # Libpng configuration |
| 109 | # |
| 110 | LIBPNG_DIR := distrib/libpng-1.2.19 |
| 111 | include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make |
| 112 | |
| 113 | ############################################################################### |
| 114 | # build the TCG code generator |
| 115 | # |
| 116 | include $(CLEAR_VARS) |
| 117 | |
| 118 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 119 | LOCAL_CC := $(MY_CC) |
| 120 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 121 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 122 | LOCAL_MODULE := emulator-tcg |
| 123 | |
| 124 | TCG_TARGET := $(HOST_ARCH) |
| 125 | ifeq ($(TCG_TARGET),x86) |
| 126 | TCG_TARGET := i386 |
| 127 | endif |
| 128 | |
| 129 | TCG_CFLAGS := -I$(LOCAL_PATH)/tcg -I$(LOCAL_PATH)/tcg/$(TCG_TARGET) |
| 130 | |
| 131 | LOCAL_CFLAGS += $(TCG_CFLAGS) \ |
| 132 | -I$(LOCAL_PATH)/target-arm \ |
| 133 | -I$(LOCAL_PATH)/fpu \ |
| 134 | |
| 135 | LOCAL_SRC_FILES := \ |
| 136 | tcg/tcg.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 137 | |
| 138 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 139 | |
| 140 | ############################################################################## |
| 141 | # build the HW emulation support |
| 142 | # |
| 143 | include $(CLEAR_VARS) |
| 144 | |
| 145 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 146 | LOCAL_CC := $(MY_CC) |
| 147 | LOCAL_MODULE := emulator-hw |
| 148 | |
| 149 | HW_CFLAGS := -I$(LOCAL_PATH)/hw |
| 150 | |
| 151 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 152 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(HW_CFLAGS) |
| 153 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 154 | |
| 155 | HW_SOURCES := \ |
| 156 | android_arm.c \ |
| 157 | arm_pic.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 158 | bt.c \ |
| 159 | bt-hci.c \ |
| 160 | bt-hid.c \ |
| 161 | bt-l2cap.c \ |
| 162 | bt-sdp.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 163 | cdrom.c \ |
| 164 | dma.c \ |
| 165 | irq.c \ |
| 166 | goldfish_audio.c \ |
| 167 | goldfish_battery.c \ |
| 168 | goldfish_device.c \ |
| 169 | goldfish_events_device.c \ |
| 170 | goldfish_fb.c \ |
| 171 | goldfish_interrupt.c \ |
| 172 | goldfish_memlog.c \ |
| 173 | goldfish_mmc.c \ |
| 174 | goldfish_nand.c \ |
| 175 | goldfish_switch.c \ |
| 176 | goldfish_timer.c \ |
| 177 | goldfish_trace.c \ |
| 178 | goldfish_tty.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 179 | msmouse.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 180 | pci.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 181 | qdev.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 182 | scsi-disk.c \ |
| 183 | smc91c111.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 184 | sysbus.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 185 | usb-hid.c \ |
| 186 | usb-hub.c \ |
| 187 | usb-msd.c \ |
| 188 | usb-ohci.c \ |
| 189 | usb.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 190 | watchdog.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 191 | |
| 192 | LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%) |
| 193 | |
| 194 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 195 | |
| 196 | ############################################################################## |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 197 | # build the ELF/DWARF stuff |
| 198 | # This library is used by emulator's memory checker to extract debug information |
| 199 | # from the symbol files when reporting memory allocation violations. In |
| 200 | # particular, this library is used to extract routine name and source file |
| 201 | # location for the code address where violation has been detected. |
| 202 | # |
| 203 | include $(CLEAR_VARS) |
| 204 | |
| 205 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 206 | LOCAL_CC := $(MY_CC) |
| 207 | LOCAL_MODULE := emulator-elff |
| 208 | LOCAL_CPP_EXTENSION := .cc |
| 209 | |
| 210 | ELFF_CFLAGS := -I$(LOCAL_PATH)/elff |
| 211 | |
| 212 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 213 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(ELFF_CFLAGS) |
| 214 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 215 | |
| 216 | ELFF_SOURCES := \ |
| 217 | dwarf_cu.cc \ |
| 218 | dwarf_die.cc \ |
| 219 | dwarf_utils.cc \ |
| 220 | elf_alloc.cc \ |
| 221 | elf_file.cc \ |
| 222 | elf_mapped_section.cc \ |
| 223 | elff_api.cc \ |
| 224 | |
| 225 | LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%) |
| 226 | ELFF_LDLIBS := -lstdc++ |
| 227 | |
| 228 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 229 | |
| 230 | ############################################################################## |
| 231 | # build the memory access checking support |
| 232 | # Memory access checker uses information collected by instrumented code in |
| 233 | # libc.so in order to keep track of memory blocks allocated from heap. Memory |
| 234 | # checker then uses this information to make sure that every access to allocated |
| 235 | # memory is within allocated block. This information also allows detecting |
| 236 | # memory leaks and attempts to free/realloc invalid pointers. |
| 237 | # |
| 238 | include $(CLEAR_VARS) |
| 239 | |
| 240 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 241 | LOCAL_CC := $(MY_CC) |
| 242 | LOCAL_MODULE := emulator-memcheck |
| 243 | |
| 244 | MCHK_CFLAGS := -I$(LOCAL_PATH)/memcheck -I$(LOCAL_PATH)/elff |
| 245 | |
| 246 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 247 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(MCHK_CFLAGS) |
| 248 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 249 | |
| 250 | MCHK_SOURCES := \ |
| 251 | memcheck.c \ |
| 252 | memcheck_proc_management.c \ |
| 253 | memcheck_malloc_map.c \ |
| 254 | memcheck_mmrange_map.c \ |
| 255 | memcheck_util.c \ |
| 256 | |
| 257 | LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%) |
| 258 | |
| 259 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 260 | |
| 261 | ############################################################################## |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 262 | # build the ARM-specific emulation engine sources |
| 263 | # |
| 264 | include $(CLEAR_VARS) |
| 265 | |
| 266 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 267 | LOCAL_CC := $(MY_CC) |
| 268 | LOCAL_MODULE := emulator-arm |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 269 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 270 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 271 | LOCAL_STATIC_LIBRARIES := emulator-hw |
| 272 | |
| 273 | LOCAL_CFLAGS := -fno-PIC -fomit-frame-pointer -Wno-sign-compare |
| 274 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 275 | |
| 276 | LOCAL_CFLAGS += -I$(LOCAL_PATH) \ |
| 277 | -I$(LOCAL_PATH)/target-arm \ |
| 278 | -I$(LOCAL_PATH)/fpu \ |
| 279 | $(TCG_CFLAGS) \ |
| 280 | $(HW_CFLAGS) \ |
| 281 | |
| 282 | ifeq ($(HOST_ARCH),ppc) |
| 283 | LOCAL_CFLAGS += -D__powerpc__ |
| 284 | endif |
| 285 | |
| 286 | LOCAL_SRC_FILES += exec.c cpu-exec.c \ |
| 287 | target-arm/op_helper.c \ |
| 288 | target-arm/iwmmxt_helper.c \ |
| 289 | target-arm/neon_helper.c \ |
| 290 | target-arm/helper.c \ |
| 291 | target-arm/translate.c \ |
| 292 | target-arm/machine.c \ |
| 293 | translate-all.c \ |
| 294 | hw/armv7m.c \ |
| 295 | hw/armv7m_nvic.c \ |
| 296 | arm-semi.c \ |
| 297 | trace.c \ |
| 298 | varint.c \ |
| 299 | dcache.c \ |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 300 | softmmu_outside_jit.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 301 | |
| 302 | LOCAL_SRC_FILES += fpu/softfloat.c |
| 303 | |
| 304 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 305 | |
| 306 | ############################################################################## |
| 307 | # SDL-related definitions |
| 308 | # |
| 309 | |
| 310 | SDL_CONFIG ?= prebuilt/$(HOST_PREBUILT_TAG)/sdl/bin/sdl-config |
| 311 | SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) |
| 312 | |
| 313 | # We need to filter out the _GNU_SOURCE variable because it breaks recent |
| 314 | # releases of Cygwin when using the -mno-cygwin option. Moreover, we don't |
| 315 | # need this macro at all to build the Android emulator. |
| 316 | SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS)) |
| 317 | SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs)) |
| 318 | |
| 319 | |
| 320 | ############################################################################## |
| 321 | # determine audio sources, build the prebuilt audio-library if needed |
| 322 | # |
| 323 | |
| 324 | # determine AUDIO sources based on current configuration |
| 325 | # |
Vladimir Chtchetkine | eeac013 | 2010-05-03 10:46:28 -0700 | [diff] [blame] | 326 | 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] | 327 | AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO |
| 328 | AUDIO_LDLIBS := |
| 329 | |
| 330 | ifeq ($(HOST_OS),darwin) |
| 331 | CONFIG_COREAUDIO ?= yes |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 332 | AUDIO_CFLAGS += -DHOST_BSD=1 |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 333 | endif |
| 334 | |
| 335 | ifeq ($(HOST_OS),windows) |
| 336 | CONFIG_WINAUDIO ?= yes |
| 337 | endif |
| 338 | |
| 339 | ifeq ($(HOST_OS),linux) |
| 340 | CONFIG_OSS ?= yes |
| 341 | CONFIG_ALSA ?= yes |
| 342 | CONFIG_ESD ?= yes |
| 343 | endif |
| 344 | |
| 345 | ifeq ($(HOST_OS),freebsd) |
| 346 | CONFIG_OSS ?= yes |
| 347 | endif |
| 348 | |
| 349 | ifeq ($(CONFIG_COREAUDIO),yes) |
| 350 | AUDIO_SOURCES += coreaudio.c |
| 351 | AUDIO_CFLAGS += -DCONFIG_COREAUDIO |
| 352 | AUDIO_LDLIBS += -Wl,-framework,CoreAudio |
| 353 | endif |
| 354 | |
| 355 | ifeq ($(CONFIG_WINAUDIO),yes) |
| 356 | AUDIO_SOURCES += winaudio.c |
| 357 | AUDIO_CFLAGS += -DCONFIG_WINAUDIO |
| 358 | endif |
| 359 | |
| 360 | ifeq ($(CONFIG_ALSA),yes) |
| 361 | AUDIO_SOURCES += alsaaudio.c audio_pt_int.c |
| 362 | AUDIO_CFLAGS += -DCONFIG_ALSA |
| 363 | endif |
| 364 | |
| 365 | ifeq ($(CONFIG_ESD),yes) |
| 366 | AUDIO_SOURCES += esdaudio.c |
| 367 | AUDIO_CFLAGS += -DCONFIG_ESD |
| 368 | endif |
| 369 | |
| 370 | ifeq ($(CONFIG_OSS),yes) |
| 371 | AUDIO_SOURCES += ossaudio.c |
| 372 | AUDIO_CFLAGS += -DCONFIG_OSS |
| 373 | endif |
| 374 | |
| 375 | AUDIO_SOURCES := $(AUDIO_SOURCES:%=audio/%) |
| 376 | |
| 377 | # determine whether we're going to use the prebuilt |
| 378 | # audio library (this is useful on Linux to avoid requiring |
| 379 | # all sound-related development packages to be installed on |
| 380 | # the build and developer machines). |
| 381 | # |
| 382 | # note that you can define BUILD_QEMU_AUDIO_LIB to true |
| 383 | # in your environment to force recompilation. |
| 384 | # |
| 385 | QEMU_AUDIO_LIB := |
| 386 | |
| 387 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 388 | QEMU_AUDIO_LIB := $(wildcard \ |
| 389 | prebuilt/$(HOST_PREBUILT_TAG)/emulator/libqemu-audio.a) |
| 390 | endif |
| 391 | |
| 392 | ifeq ($(BUILD_QEMU_AUDIO_LIB),true) |
| 393 | include $(CLEAR_VARS) |
| 394 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 395 | LOCAL_CC := $(MY_CC) |
| 396 | LOCAL_MODULE := libqemu-audio |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 397 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 398 | |
| 399 | LOCAL_CFLAGS := -Wno-sign-compare \ |
| 400 | -fno-strict-aliasing -W -Wall -Wno-unused-parameter \ |
| 401 | -I$(LOCAL_PATH) \ |
| 402 | -I$(LOCAL_PATH)/target-arm \ |
| 403 | -I$(LOCAL_PATH)/fpu \ |
| 404 | |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 405 | # this is very important, otherwise the generated binaries may |
| 406 | # not link properly on our build servers |
| 407 | ifeq ($(HOST_OS),linux) |
| 408 | LOCAL_CFLAGS += -fno-stack-protector |
| 409 | endif |
| 410 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 411 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(AUDIO_CFLAGS) |
| 412 | |
| 413 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 414 | |
| 415 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 416 | |
| 417 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 418 | QEMU_AUDIO_LIB := $(LOCAL_BUILT_MODULE) |
| 419 | |
| 420 | endif # !QEMU_AUDIO_LIB |
| 421 | |
| 422 | ############################################################################## |
| 423 | # now build the emulator itself |
| 424 | # |
| 425 | include $(CLEAR_VARS) |
| 426 | |
| 427 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 428 | LOCAL_CC := $(MY_CC) |
| 429 | LOCAL_MODULE := emulator |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 430 | LOCAL_STATIC_LIBRARIES := emulator-memcheck emulator-hw emulator-arm emulator-tcg |
| 431 | LOCAL_STATIC_LIBRARIES += emulator-elff |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 432 | LOCAL_LDLIBS := $(MY_LDLIBS) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 433 | |
| 434 | # don't remove the -fno-strict-aliasing, or you'll break things |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 435 | # (e.g. slirp-android/network support) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 436 | # |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 437 | LOCAL_CFLAGS := -fno-PIC -Wno-sign-compare \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 438 | -fno-strict-aliasing -g -W -Wall -Wno-unused-parameter |
| 439 | |
| 440 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 441 | |
| 442 | # add the build ID to the default macro definitions |
| 443 | LOCAL_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))" |
| 444 | |
David 'Digit' Turner | a383d02 | 2009-12-03 13:50:00 -0800 | [diff] [blame] | 445 | # For non-standalone builds, extract the major version number from the Android SDK |
| 446 | # tools revision number. |
| 447 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 448 | ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties) |
| 449 | endif |
| 450 | |
| 451 | ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION)) |
| 452 | ifdef ANDROID_SDK_TOOLS_REVISION |
| 453 | LOCAL_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION) |
| 454 | endif |
| 455 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 456 | # include the Zlib sources |
| 457 | # |
| 458 | LOCAL_SRC_FILES += $(ZLIB_SOURCES) |
| 459 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 460 | |
| 461 | # include the Libpng sources |
| 462 | # |
| 463 | LOCAL_SRC_FILES += $(LIBPNG_SOURCES) |
| 464 | LOCAL_CFLAGS += $(LIBPNG_CFLAGS) -I$(LOCAL_PATH)/$(LIBPNG_DIR) |
| 465 | |
| 466 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/ \ |
| 467 | -I$(LOCAL_PATH)/target-arm \ |
| 468 | -I$(LOCAL_PATH)/fpu \ |
| 469 | $(TCG_CFLAGS) \ |
| 470 | $(HW_CFLAGS) \ |
| 471 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 472 | # Needed by the upstream code |
| 473 | LOCAL_CFLAGS += -DNEED_CPU_H |
| 474 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 475 | # include telephony stuff |
| 476 | # |
| 477 | TELEPHONY_SOURCES := android_modem.c modem_driver.c gsm.c sim_card.c sysdeps_qemu.c sms.c remote_call.c |
| 478 | LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%) |
| 479 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/telephony |
| 480 | |
| 481 | # include sound support source files. we first try to see if we have a prebuilt audio |
| 482 | # library. if not, we build things the "hard" way. |
| 483 | # |
| 484 | # note that to generate the prebuilt audio library, you should do the following: |
| 485 | # |
| 486 | # cd tools/qemu |
| 487 | # ./android-rebuild.sh |
| 488 | # distrib/update-audio.sh |
| 489 | # |
| 490 | ifeq ($(QEMU_AUDIO_LIB),) |
| 491 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 492 | endif # !QEMU_AUDIO_LIB |
| 493 | |
| 494 | LOCAL_CFLAGS += $(AUDIO_CFLAGS) |
| 495 | LOCAL_LDLIBS += $(AUDIO_LDLIBS) |
| 496 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 497 | # include slirp-android code, i.e. the user-level networking stuff |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 498 | # |
| 499 | SLIRP_SOURCES := bootp.c cksum.c debug.c if.c ip_icmp.c ip_input.c ip_output.c \ |
| 500 | mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c tcp_output.c \ |
| 501 | tcp_subr.c tcp_timer.c tftp.c udp.c |
| 502 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 503 | LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%) |
| 504 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/slirp-android |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 505 | |
| 506 | # socket proxy support |
| 507 | # |
| 508 | PROXY_SOURCES := \ |
| 509 | proxy_common.c \ |
| 510 | proxy_http.c \ |
| 511 | proxy_http_connector.c \ |
| 512 | proxy_http_rewriter.c \ |
| 513 | |
| 514 | LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%) |
| 515 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/proxy |
| 516 | |
| 517 | # the linux-user sources, I doubt we really need these |
| 518 | # |
| 519 | #LINUX_SOURCES := main.c elfload.c mmap.c signal.c path.c syscall.c |
| 520 | #LOCAL_SRC_FILES += $(LINUX_SOURCES:%=linux-user/%) |
| 521 | |
| 522 | # the skin support sources |
| 523 | # |
| 524 | SKIN_SOURCES := rect.c \ |
| 525 | region.c \ |
| 526 | image.c \ |
| 527 | trackball.c \ |
| 528 | keyboard.c \ |
| 529 | keyset.c \ |
| 530 | file.c \ |
| 531 | window.c \ |
| 532 | scaler.c \ |
| 533 | composer.c \ |
| 534 | surface.c \ |
| 535 | |
| 536 | LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%) |
| 537 | #LOCAL_CFLAGS += -I$(LOCAL_PATH)/skin |
| 538 | |
| 539 | ifeq ($(HOST_ARCH),x86) |
| 540 | # enable MMX code for our skin scaler |
| 541 | LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx |
| 542 | endif |
| 543 | |
| 544 | # include other sources |
| 545 | # |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 546 | VL_SOURCES := vl-android.c osdep.c cutils.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 547 | block.c readline.c monitor.c console.c loader.c sockets.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 548 | aes.c d3des.c \ |
| 549 | block/qcow.c \ |
| 550 | block/qcow2.c \ |
| 551 | block/qcow2-refcount.c \ |
| 552 | block/qcow2-snapshot.c \ |
| 553 | block/qcow2-cluster.c \ |
| 554 | block/cloop.c \ |
| 555 | block/dmg.c \ |
| 556 | block/vvfat.c \ |
| 557 | buffered_file.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 558 | cbuffer.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 559 | gdbstub.c \ |
| 560 | vnc-android.c disas.c arm-dis.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 561 | shaper.c charpipe.c loadpng.c \ |
| 562 | framebuffer.c \ |
| 563 | tcpdump.c \ |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 564 | qemu-char-android.c \ |
| 565 | qemu-malloc.c \ |
| 566 | qemu-option.c \ |
| 567 | savevm.c \ |
| 568 | net-android.c \ |
| 569 | acl.c \ |
| 570 | aio-android.c \ |
| 571 | dma-helpers.c \ |
| 572 | qemu-sockets-android.c \ |
| 573 | keymaps.c \ |
| 574 | bt-host.c \ |
| 575 | bt-vhci.c \ |
| 576 | module.c \ |
David Turner | 9c0c515 | 2009-06-02 12:30:47 -0700 | [diff] [blame] | 577 | android/boot-properties.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 578 | android/charmap.c \ |
| 579 | android/cmdline-option.c \ |
| 580 | android/config.c \ |
| 581 | android/console.c \ |
| 582 | android/gps.c \ |
| 583 | android/help.c \ |
| 584 | android/hw-control.c \ |
| 585 | android/hw-events.c \ |
| 586 | android/hw-kmsg.c \ |
David 'Digit' Turner | c5b1270 | 2009-06-19 00:36:12 +0200 | [diff] [blame] | 587 | android/hw-lcd.c \ |
The Android Open Source Project | 9877e2e | 2009-03-18 17:39:44 -0700 | [diff] [blame] | 588 | android/hw-qemud.c \ |
| 589 | android/hw-sensors.c \ |
David 'Digit' Turner | 87250c2 | 2009-09-17 16:45:03 -0700 | [diff] [blame] | 590 | android/keycode.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 591 | android/main.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 592 | android/resource.c \ |
| 593 | android/user-config.c \ |
| 594 | android/utils/bufprint.c \ |
| 595 | android/utils/debug.c \ |
| 596 | android/utils/dirscanner.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 597 | android/utils/ini.c \ |
| 598 | android/utils/filelock.c \ |
| 599 | android/utils/misc.c \ |
| 600 | android/utils/path.c \ |
| 601 | android/utils/reflist.c \ |
| 602 | android/utils/stralloc.c \ |
| 603 | android/utils/system.c \ |
| 604 | android/utils/tempfile.c \ |
| 605 | android/utils/timezone.c \ |
Vladimir Chtchetkine | 8339d18 | 2010-03-25 10:57:29 -0700 | [diff] [blame] | 606 | android/utils/mapfile.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 607 | android/avd/hw-config.c \ |
| 608 | android/avd/info.c \ |
| 609 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 610 | VL_SOURCES += hw/arm_boot.c \ |
| 611 | hw/android_arm.c \ |
| 612 | |
| 613 | ifeq ($(HOST_OS),windows) |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 614 | VL_SOURCES += block/raw-win32.c \ |
| 615 | migration-dummy-android.c \ |
| 616 | iolooper-select.c |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 617 | else |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 618 | VL_SOURCES += block/raw-posix.c \ |
| 619 | migration.c \ |
| 620 | migration-exec.c \ |
| 621 | migration-tcp-android.c \ |
| 622 | iolooper-select.c |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 623 | endif |
| 624 | |
| 625 | ifeq ($(HOST_OS),linux) |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 626 | VL_SOURCES += usb-linux.c \ |
| 627 | qemu-thread.c |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 628 | else |
| 629 | VL_SOURCES += usb-dummy-android.c |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 630 | endif |
| 631 | |
| 632 | ifeq ($(HOST_ARCH),x86) |
| 633 | VL_SOURCES += i386-dis.c |
| 634 | endif |
| 635 | ifeq ($(HOST_ARCH),x86_64) |
| 636 | VL_SOURCES += i386-dis.c |
| 637 | endif |
| 638 | ifeq ($(HOST_ARCH),ppc) |
| 639 | VL_SOURCES += ppc-dis.c |
| 640 | endif |
| 641 | |
| 642 | ifeq ($(HOST_OS),windows) |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 643 | VL_SOURCES += tap-win32.c |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 644 | LOCAL_LDLIBS += -mno-cygwin -mwindows -mconsole |
| 645 | endif |
| 646 | |
Alexey Tarasov | 43fbac1 | 2009-06-15 14:28:15 +1100 | [diff] [blame] | 647 | ifeq ($(HOST_OS),freebsd) |
| 648 | LOCAL_LDLIBS += -L/usr/local/lib -lpthread -lX11 -lutil |
| 649 | endif |
| 650 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 651 | LOCAL_SRC_FILES += $(VL_SOURCES) |
| 652 | |
| 653 | ifeq ($(HOST_OS),linux) |
| 654 | LOCAL_LDLIBS += -lutil -lrt |
| 655 | endif |
| 656 | |
| 657 | # add SDL-specific flags |
| 658 | # |
| 659 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 660 | LOCAL_LDLIBS += $(SDL_LDLIBS) |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 661 | # Circular dependencies between libSDL and libSDLmain; |
| 662 | # We repeat the libraries in the final link to work around it. |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 663 | LOCAL_STATIC_LIBRARIES += libSDL libSDLmain |
| 664 | LOCAL_STATIC_LIBRARIES += libSDL libSDLmain |
| 665 | |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 666 | # add ELFF-specific flags |
| 667 | # |
| 668 | LOCAL_LDLIBS += $(ELFF_LDLIBS) |
| 669 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 670 | # on Windows, link the icon file as well into the executable |
| 671 | # unfortunately, our build system doesn't help us much, so we need |
| 672 | # to use some weird pathnames to make this work... |
| 673 | # |
| 674 | ifeq ($(HOST_OS),windows) |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 675 | |
| 676 | # Locate windres executable |
| 677 | WINDRES := windres |
| 678 | ifneq ($(USE_MINGW),) |
| 679 | # When building the Windows emulator under Linux, use the MinGW one |
| 680 | WINDRES := i586-mingw32msvc-windres |
| 681 | endif |
| 682 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 683 | INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 684 | ANDROID_ICON_OBJ := android_icon.o |
| 685 | ANDROID_ICON_PATH := $(LOCAL_PATH)/images |
| 686 | $(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 687 | $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 688 | |
| 689 | # seems to be the only way to add an object file that was not generated from |
| 690 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 691 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 692 | # us to put the object file in the source directory... |
| 693 | # |
| 694 | LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ) |
| 695 | endif |
| 696 | |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 697 | # qemu-options.h is generated from qemu-options.hx with the "hxtool" shell script |
| 698 | # |
| 699 | intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 700 | |
| 701 | QEMU_OPTIONS_H := $(intermediates)/qemu-options.h |
| 702 | $(QEMU_OPTIONS_H): PRIVATE_PATH := $(LOCAL_PATH) |
| 703 | $(QEMU_OPTIONS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ |
| 704 | $(QEMU_OPTIONS_H): $(LOCAL_PATH)/qemu-options.hx $(LOCAL_PATH)/hxtool |
| 705 | $(transform-generated-source) |
| 706 | |
| 707 | $(intermediates)/vl-android.o: $(QEMU_OPTIONS_H) |
| 708 | |
| 709 | LOCAL_GENERATED_SOURCES += $(QEMU_OPTIONS_H) |
| 710 | |
| 711 | # qemu-monitor.h is generated from qemu-monitor.hx with the "hxtool" shell script |
| 712 | # |
| 713 | intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 714 | |
| 715 | QEMU_MONITOR_H := $(intermediates)/qemu-monitor.h |
| 716 | $(QEMU_MONITOR_H): PRIVATE_PATH := $(LOCAL_PATH) |
| 717 | $(QEMU_MONITOR_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ |
| 718 | $(QEMU_MONITOR_H): $(LOCAL_PATH)/qemu-monitor.hx $(LOCAL_PATH)/hxtool |
| 719 | $(transform-generated-source) |
| 720 | |
| 721 | $(intermediates)/vl-android.o: $(QEMU_MONITOR_H) |
| 722 | |
| 723 | LOCAL_GENERATED_SOURCES += $(QEMU_MONITOR_H) |
| 724 | |
| 725 | |
| 726 | # gdbstub-xml.c contains C-compilable arrays corresponding to the content |
| 727 | # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script. |
| 728 | # |
| 729 | ifeq ($(QEMU_TARGET_XML_SOURCES),) |
| 730 | QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3 |
| 731 | QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml) |
| 732 | endif |
| 733 | |
| 734 | QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c |
| 735 | $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH) |
| 736 | $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES) |
| 737 | $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES) |
| 738 | $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh |
| 739 | $(hide) rm -f $@ |
| 740 | $(transform-generated-source) |
| 741 | |
| 742 | $(intermediates)/vl-android.o: $(QEMU_GDBSTUB_XML_C) |
| 743 | |
| 744 | LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C) |
| 745 | |
David 'Digit' Turner | 065242d | 2009-10-07 13:43:33 -0700 | [diff] [blame] | 746 | # hw-config-defs.h is generated from android/avd/hardware-properties.ini |
| 747 | # |
David 'Digit' Turner | 2ec4559 | 2009-10-07 14:48:19 -0700 | [diff] [blame] | 748 | QEMU_HARDWARE_PROPERTIES_INI := $(LOCAL_PATH)/android/avd/hardware-properties.ini |
David 'Digit' Turner | 065242d | 2009-10-07 13:43:33 -0700 | [diff] [blame] | 749 | QEMU_HW_CONFIG_DEFS_H := $(LOCAL_PATH)/android/avd/hw-config-defs.h |
| 750 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_PATH := $(LOCAL_PATH) |
David 'Digit' Turner | 2ec4559 | 2009-10-07 14:48:19 -0700 | [diff] [blame] | 751 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_SOURCES := $(QEMU_HARDWARE_PROPERTIES_INI) |
| 752 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/android/tools/gen-hw-config.py $(QEMU_HARDWARE_PROPERTIES_INI) $@ |
| 753 | $(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] | 754 | $(hide) rm -f $@ |
| 755 | $(transform-generated-source) |
| 756 | |
| 757 | $(LOCAL_PATH)/android/avd/hw-config.h: $(QEMU_HW_CONFIG_DEFS_H) |
| 758 | |
| 759 | LOCAL_GENERATED_SOURCES += $(QEMU_HW_CONFIG_DEFS_H) |
David 'Digit' Turner | 5d8f37a | 2009-09-14 14:32:27 -0700 | [diff] [blame] | 760 | |
| 761 | # this is already done by the Android build system, but is done for the |
| 762 | # benefit of the stand-alone one. |
| 763 | # |
| 764 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 765 | LOCAL_CFLAGS += -I$(intermediates) |
| 766 | endif |
| 767 | |
| 768 | |
| 769 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 770 | # other flags |
| 771 | LOCAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 772 | LOCAL_LDLIBS += -lm |
Vladimir Chtchetkine | 5389aa1 | 2010-02-16 10:38:35 -0800 | [diff] [blame] | 773 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 774 | ifeq ($(HOST_OS),windows) |
| 775 | LOCAL_LDLIBS += -lwinmm -lws2_32 -liphlpapi |
Raphael | aea1b87 | 2010-04-14 12:16:28 -0700 | [diff] [blame] | 776 | else |
| 777 | LOCAL_LDLIBS += -lpthread |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 778 | endif |
| 779 | |
| 780 | LOCAL_LDLIBS += $(QEMU_AUDIO_LIB) |
| 781 | |
David 'Digit' Turner | ab873b7 | 2010-03-08 18:33:50 -0800 | [diff] [blame] | 782 | # Generate a completely static executable if needed. |
| 783 | # Note that this means no sound and graphics on Linux. |
| 784 | # |
| 785 | ifeq ($(CONFIG_STATIC_EXECUTABLE),true) |
| 786 | LOCAL_SRC_FILES += dynlink-static.c |
| 787 | LOCAL_LDLIBS += -static |
| 788 | endif |
| 789 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 790 | LOCAL_MODULE := emulator |
| 791 | |
| 792 | include $(BUILD_HOST_EXECUTABLE) |
| 793 | |
| 794 | endif # TARGET_ARCH == arm |