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