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 | |
| 12 | MY_CFLAGS := $(CONFIG_INCLUDES) -O2 -g \ |
| 13 | -fno-PIC \ |
| 14 | -falign-functions=0 \ |
| 15 | -fomit-frame-pointer \ |
| 16 | |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 17 | MY_LDFLAGS := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 18 | |
| 19 | # this is needed to build the emulator on 64-bit Linux systems |
| 20 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
| 21 | MY_CFLAGS += -Wa,--32 |
| 22 | endif |
| 23 | |
| 24 | ifeq ($(HOST_OS),freebsd) |
| 25 | MY_CFLAGS += -Wa,--32 -I /usr/local/include |
| 26 | endif |
| 27 | |
| 28 | ifeq ($(HOST_OS),windows) |
| 29 | MY_CFLAGS += -D_WIN32 -mno-cygwin |
| 30 | # we need Win32 features that are available since Windows 2000 Professional/Server (NT 5.0) |
| 31 | MY_CFLAGS += -DWINVER=0x501 |
| 32 | endif |
| 33 | |
| 34 | ifeq ($(HOST_ARCH),ppc) |
| 35 | MY_CFLAGS += -D__powerpc__ |
| 36 | endif |
| 37 | |
| 38 | ifeq ($(HOST_OS),darwin) |
| 39 | MY_CFLAGS += -mdynamic-no-pic |
David Turner | bba461c | 2009-06-03 10:48:15 -0700 | [diff] [blame] | 40 | |
| 41 | # When building on Leopard or above, we need to use the 10.4 SDK |
| 42 | # or the generated binary will not run on Tiger. |
| 43 | DARWIN_VERSION := $(strip $(shell sw_vers -productVersion)) |
| 44 | ifneq ($(filter 10.1 10.2 10.3 10.1.% 10.2.% 10.3.%,$(DARWIN_VERSION)),) |
| 45 | $(error Building the Android emulator requires OS X 10.4 or above) |
| 46 | endif |
| 47 | ifeq ($(filter 10.4 10.4.%,$(DARWIN_VERSION)),) |
| 48 | # We are on Leopard or above |
| 49 | TIGER_SDK := /Developer/SDKs/MacOSX10.4u.sdk |
| 50 | ifeq ($(strip $(wildcard $(TIGER_SDK))),) |
| 51 | $(info Please install the 10.4 SDK on this machine at $(TIGER_SDK)) |
| 52 | $(error Aborting the build.) |
| 53 | endif |
| 54 | MY_CFLAGS += -isysroot $(TIGER_SDK) -mmacosx-version-min=10.4 |
| 55 | MY_LDFLAGS += -isysroot $(TIGER_SDK) -Wl,-syslibroot,$(TIGER_SDK) -mmacosx-version-min=10.4 |
| 56 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 57 | endif |
| 58 | MY_CC := $(HOST_CC) |
| 59 | |
| 60 | # BUILD_STANDALONE_EMULATOR is only defined when building with |
| 61 | # the android-rebuild.sh script. The script will also provide |
| 62 | # adequate values for HOST_CC |
| 63 | # |
| 64 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 65 | |
| 66 | ifneq ($(USE_CCACHE),) |
| 67 | MY_CC := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache $(MY_CC) |
| 68 | endif |
| 69 | endif |
| 70 | |
| 71 | |
| 72 | ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true) |
| 73 | ifneq ($(HOST_ARCH),x86_64) |
| 74 | MY_CFLAGS += -m32 |
| 75 | MY_LDFLAGS += -m32 |
| 76 | endif |
| 77 | endif |
| 78 | |
| 79 | include $(CLEAR_VARS) |
| 80 | |
| 81 | ########################################################### |
| 82 | # Zlib configuration |
| 83 | # |
| 84 | ZLIB_DIR := distrib/zlib-1.2.3 |
| 85 | include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make |
| 86 | |
| 87 | ########################################################### |
| 88 | # Libpng configuration |
| 89 | # |
| 90 | LIBPNG_DIR := distrib/libpng-1.2.19 |
| 91 | include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make |
| 92 | |
| 93 | ############################################################################### |
| 94 | # build the TCG code generator |
| 95 | # |
| 96 | include $(CLEAR_VARS) |
| 97 | |
| 98 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 99 | LOCAL_CC := $(MY_CC) |
| 100 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 101 | LOCAL_LDFLAGS := $(MY_LDFLAGS) |
| 102 | LOCAL_MODULE := emulator-tcg |
| 103 | |
| 104 | TCG_TARGET := $(HOST_ARCH) |
| 105 | ifeq ($(TCG_TARGET),x86) |
| 106 | TCG_TARGET := i386 |
| 107 | endif |
| 108 | |
| 109 | TCG_CFLAGS := -I$(LOCAL_PATH)/tcg -I$(LOCAL_PATH)/tcg/$(TCG_TARGET) |
| 110 | |
| 111 | LOCAL_CFLAGS += $(TCG_CFLAGS) \ |
| 112 | -I$(LOCAL_PATH)/target-arm \ |
| 113 | -I$(LOCAL_PATH)/fpu \ |
| 114 | |
| 115 | LOCAL_SRC_FILES := \ |
| 116 | tcg/tcg.c \ |
| 117 | tcg/tcg-dyngen.c \ |
| 118 | tcg/tcg-runtime.c \ |
| 119 | |
| 120 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 121 | |
| 122 | ############################################################################## |
| 123 | # build the HW emulation support |
| 124 | # |
| 125 | include $(CLEAR_VARS) |
| 126 | |
| 127 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 128 | LOCAL_CC := $(MY_CC) |
| 129 | LOCAL_MODULE := emulator-hw |
| 130 | |
| 131 | HW_CFLAGS := -I$(LOCAL_PATH)/hw |
| 132 | |
| 133 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 134 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(HW_CFLAGS) |
| 135 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 136 | |
| 137 | HW_SOURCES := \ |
| 138 | android_arm.c \ |
| 139 | arm_pic.c \ |
| 140 | cdrom.c \ |
| 141 | dma.c \ |
| 142 | irq.c \ |
| 143 | goldfish_audio.c \ |
| 144 | goldfish_battery.c \ |
| 145 | goldfish_device.c \ |
| 146 | goldfish_events_device.c \ |
| 147 | goldfish_fb.c \ |
| 148 | goldfish_interrupt.c \ |
| 149 | goldfish_memlog.c \ |
| 150 | goldfish_mmc.c \ |
| 151 | goldfish_nand.c \ |
| 152 | goldfish_switch.c \ |
| 153 | goldfish_timer.c \ |
| 154 | goldfish_trace.c \ |
| 155 | goldfish_tty.c \ |
| 156 | pci.c \ |
| 157 | scsi-disk.c \ |
| 158 | smc91c111.c \ |
| 159 | usb-hid.c \ |
| 160 | usb-hub.c \ |
| 161 | usb-msd.c \ |
| 162 | usb-ohci.c \ |
| 163 | usb.c \ |
| 164 | |
| 165 | LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%) |
| 166 | |
| 167 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 168 | |
| 169 | ############################################################################## |
| 170 | # build the ARM-specific emulation engine sources |
| 171 | # |
| 172 | include $(CLEAR_VARS) |
| 173 | |
| 174 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 175 | LOCAL_CC := $(MY_CC) |
| 176 | LOCAL_MODULE := emulator-arm |
| 177 | LOCAL_LDFLAGS := $(MY_LDFLAGS) |
| 178 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 179 | LOCAL_STATIC_LIBRARIES := emulator-hw |
| 180 | |
| 181 | LOCAL_CFLAGS := -fno-PIC -fomit-frame-pointer -Wno-sign-compare |
| 182 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 183 | |
| 184 | LOCAL_CFLAGS += -I$(LOCAL_PATH) \ |
| 185 | -I$(LOCAL_PATH)/target-arm \ |
| 186 | -I$(LOCAL_PATH)/fpu \ |
| 187 | $(TCG_CFLAGS) \ |
| 188 | $(HW_CFLAGS) \ |
| 189 | |
| 190 | ifeq ($(HOST_ARCH),ppc) |
| 191 | LOCAL_CFLAGS += -D__powerpc__ |
| 192 | endif |
| 193 | |
| 194 | LOCAL_SRC_FILES += exec.c cpu-exec.c \ |
| 195 | target-arm/op_helper.c \ |
| 196 | target-arm/iwmmxt_helper.c \ |
| 197 | target-arm/neon_helper.c \ |
| 198 | target-arm/helper.c \ |
| 199 | target-arm/translate.c \ |
| 200 | target-arm/machine.c \ |
| 201 | translate-all.c \ |
| 202 | hw/armv7m.c \ |
| 203 | hw/armv7m_nvic.c \ |
| 204 | arm-semi.c \ |
| 205 | trace.c \ |
| 206 | varint.c \ |
| 207 | dcache.c \ |
| 208 | |
| 209 | LOCAL_SRC_FILES += fpu/softfloat.c |
| 210 | |
| 211 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 212 | |
| 213 | ############################################################################## |
| 214 | # SDL-related definitions |
| 215 | # |
| 216 | |
| 217 | SDL_CONFIG ?= prebuilt/$(HOST_PREBUILT_TAG)/sdl/bin/sdl-config |
| 218 | SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) |
| 219 | |
| 220 | # We need to filter out the _GNU_SOURCE variable because it breaks recent |
| 221 | # releases of Cygwin when using the -mno-cygwin option. Moreover, we don't |
| 222 | # need this macro at all to build the Android emulator. |
| 223 | SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS)) |
| 224 | SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs)) |
| 225 | |
| 226 | |
| 227 | ############################################################################## |
| 228 | # determine audio sources, build the prebuilt audio-library if needed |
| 229 | # |
| 230 | |
| 231 | # determine AUDIO sources based on current configuration |
| 232 | # |
| 233 | AUDIO_SOURCES := audio.c noaudio.c wavaudio.c sdlaudio.c wavcapture.c mixeng.c |
| 234 | AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO |
| 235 | AUDIO_LDLIBS := |
| 236 | |
| 237 | ifeq ($(HOST_OS),darwin) |
| 238 | CONFIG_COREAUDIO ?= yes |
| 239 | endif |
| 240 | |
| 241 | ifeq ($(HOST_OS),windows) |
| 242 | CONFIG_WINAUDIO ?= yes |
| 243 | endif |
| 244 | |
| 245 | ifeq ($(HOST_OS),linux) |
| 246 | CONFIG_OSS ?= yes |
| 247 | CONFIG_ALSA ?= yes |
| 248 | CONFIG_ESD ?= yes |
| 249 | endif |
| 250 | |
| 251 | ifeq ($(HOST_OS),freebsd) |
| 252 | CONFIG_OSS ?= yes |
| 253 | endif |
| 254 | |
| 255 | ifeq ($(CONFIG_COREAUDIO),yes) |
| 256 | AUDIO_SOURCES += coreaudio.c |
| 257 | AUDIO_CFLAGS += -DCONFIG_COREAUDIO |
| 258 | AUDIO_LDLIBS += -Wl,-framework,CoreAudio |
| 259 | endif |
| 260 | |
| 261 | ifeq ($(CONFIG_WINAUDIO),yes) |
| 262 | AUDIO_SOURCES += winaudio.c |
| 263 | AUDIO_CFLAGS += -DCONFIG_WINAUDIO |
| 264 | endif |
| 265 | |
| 266 | ifeq ($(CONFIG_ALSA),yes) |
| 267 | AUDIO_SOURCES += alsaaudio.c audio_pt_int.c |
| 268 | AUDIO_CFLAGS += -DCONFIG_ALSA |
| 269 | endif |
| 270 | |
| 271 | ifeq ($(CONFIG_ESD),yes) |
| 272 | AUDIO_SOURCES += esdaudio.c |
| 273 | AUDIO_CFLAGS += -DCONFIG_ESD |
| 274 | endif |
| 275 | |
| 276 | ifeq ($(CONFIG_OSS),yes) |
| 277 | AUDIO_SOURCES += ossaudio.c |
| 278 | AUDIO_CFLAGS += -DCONFIG_OSS |
| 279 | endif |
| 280 | |
| 281 | AUDIO_SOURCES := $(AUDIO_SOURCES:%=audio/%) |
| 282 | |
| 283 | # determine whether we're going to use the prebuilt |
| 284 | # audio library (this is useful on Linux to avoid requiring |
| 285 | # all sound-related development packages to be installed on |
| 286 | # the build and developer machines). |
| 287 | # |
| 288 | # note that you can define BUILD_QEMU_AUDIO_LIB to true |
| 289 | # in your environment to force recompilation. |
| 290 | # |
| 291 | QEMU_AUDIO_LIB := |
| 292 | |
| 293 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 294 | QEMU_AUDIO_LIB := $(wildcard \ |
| 295 | prebuilt/$(HOST_PREBUILT_TAG)/emulator/libqemu-audio.a) |
| 296 | endif |
| 297 | |
| 298 | ifeq ($(BUILD_QEMU_AUDIO_LIB),true) |
| 299 | include $(CLEAR_VARS) |
| 300 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 301 | LOCAL_CC := $(MY_CC) |
| 302 | LOCAL_MODULE := libqemu-audio |
| 303 | LOCAL_LDFLAGS := $(MY_LDFLAGS) |
| 304 | |
| 305 | LOCAL_CFLAGS := -Wno-sign-compare \ |
| 306 | -fno-strict-aliasing -W -Wall -Wno-unused-parameter \ |
| 307 | -I$(LOCAL_PATH) \ |
| 308 | -I$(LOCAL_PATH)/target-arm \ |
| 309 | -I$(LOCAL_PATH)/fpu \ |
| 310 | |
David 'Digit' Turner | 46be487 | 2009-06-04 16:07:01 +0200 | [diff] [blame] | 311 | # this is very important, otherwise the generated binaries may |
| 312 | # not link properly on our build servers |
| 313 | ifeq ($(HOST_OS),linux) |
| 314 | LOCAL_CFLAGS += -fno-stack-protector |
| 315 | endif |
| 316 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 317 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(AUDIO_CFLAGS) |
| 318 | |
| 319 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 320 | |
| 321 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 322 | |
| 323 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 324 | QEMU_AUDIO_LIB := $(LOCAL_BUILT_MODULE) |
| 325 | |
| 326 | endif # !QEMU_AUDIO_LIB |
| 327 | |
| 328 | ############################################################################## |
| 329 | # now build the emulator itself |
| 330 | # |
| 331 | include $(CLEAR_VARS) |
| 332 | |
| 333 | LOCAL_NO_DEFAULT_COMPILER_FLAGS := true |
| 334 | LOCAL_CC := $(MY_CC) |
| 335 | LOCAL_MODULE := emulator |
| 336 | LOCAL_STATIC_LIBRARIES := emulator-hw emulator-arm emulator-tcg |
| 337 | LOCAL_LDFLAGS := $(MY_LDFLAGS) |
| 338 | |
| 339 | # don't remove the -fno-strict-aliasing, or you'll break things |
| 340 | # (e.g. slirp2/network support) |
| 341 | # |
| 342 | LOCAL_CFLAGS := -fno-PIC -fomit-frame-pointer -Wno-sign-compare \ |
| 343 | -fno-strict-aliasing -g -W -Wall -Wno-unused-parameter |
| 344 | |
| 345 | LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) |
| 346 | |
| 347 | # add the build ID to the default macro definitions |
| 348 | LOCAL_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))" |
| 349 | |
| 350 | # include the Zlib sources |
| 351 | # |
| 352 | LOCAL_SRC_FILES += $(ZLIB_SOURCES) |
| 353 | LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 354 | |
| 355 | # include the Libpng sources |
| 356 | # |
| 357 | LOCAL_SRC_FILES += $(LIBPNG_SOURCES) |
| 358 | LOCAL_CFLAGS += $(LIBPNG_CFLAGS) -I$(LOCAL_PATH)/$(LIBPNG_DIR) |
| 359 | |
| 360 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/ \ |
| 361 | -I$(LOCAL_PATH)/target-arm \ |
| 362 | -I$(LOCAL_PATH)/fpu \ |
| 363 | $(TCG_CFLAGS) \ |
| 364 | $(HW_CFLAGS) \ |
| 365 | |
| 366 | # include telephony stuff |
| 367 | # |
| 368 | TELEPHONY_SOURCES := android_modem.c modem_driver.c gsm.c sim_card.c sysdeps_qemu.c sms.c remote_call.c |
| 369 | LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%) |
| 370 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/telephony |
| 371 | |
| 372 | # include sound support source files. we first try to see if we have a prebuilt audio |
| 373 | # library. if not, we build things the "hard" way. |
| 374 | # |
| 375 | # note that to generate the prebuilt audio library, you should do the following: |
| 376 | # |
| 377 | # cd tools/qemu |
| 378 | # ./android-rebuild.sh |
| 379 | # distrib/update-audio.sh |
| 380 | # |
| 381 | ifeq ($(QEMU_AUDIO_LIB),) |
| 382 | LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 383 | endif # !QEMU_AUDIO_LIB |
| 384 | |
| 385 | LOCAL_CFLAGS += $(AUDIO_CFLAGS) |
| 386 | LOCAL_LDLIBS += $(AUDIO_LDLIBS) |
| 387 | |
| 388 | # include slirp2 code, i.e. the user-level networking stuff |
| 389 | # |
| 390 | SLIRP_SOURCES := bootp.c cksum.c debug.c if.c ip_icmp.c ip_input.c ip_output.c \ |
| 391 | mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c tcp_output.c \ |
| 392 | tcp_subr.c tcp_timer.c tftp.c udp.c |
| 393 | |
| 394 | LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp2/%) |
| 395 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/slirp2 |
| 396 | |
| 397 | # socket proxy support |
| 398 | # |
| 399 | PROXY_SOURCES := \ |
| 400 | proxy_common.c \ |
| 401 | proxy_http.c \ |
| 402 | proxy_http_connector.c \ |
| 403 | proxy_http_rewriter.c \ |
| 404 | |
| 405 | LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%) |
| 406 | LOCAL_CFLAGS += -I$(LOCAL_PATH)/proxy |
| 407 | |
| 408 | # the linux-user sources, I doubt we really need these |
| 409 | # |
| 410 | #LINUX_SOURCES := main.c elfload.c mmap.c signal.c path.c syscall.c |
| 411 | #LOCAL_SRC_FILES += $(LINUX_SOURCES:%=linux-user/%) |
| 412 | |
| 413 | # the skin support sources |
| 414 | # |
| 415 | SKIN_SOURCES := rect.c \ |
| 416 | region.c \ |
| 417 | image.c \ |
| 418 | trackball.c \ |
| 419 | keyboard.c \ |
| 420 | keyset.c \ |
| 421 | file.c \ |
| 422 | window.c \ |
| 423 | scaler.c \ |
| 424 | composer.c \ |
| 425 | surface.c \ |
| 426 | |
| 427 | LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%) |
| 428 | #LOCAL_CFLAGS += -I$(LOCAL_PATH)/skin |
| 429 | |
| 430 | ifeq ($(HOST_ARCH),x86) |
| 431 | # enable MMX code for our skin scaler |
| 432 | LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx |
| 433 | endif |
| 434 | |
| 435 | # include other sources |
| 436 | # |
| 437 | VL_SOURCES := vl.c osdep.c cutils.c \ |
| 438 | block.c readline.c monitor.c console.c loader.c sockets.c \ |
| 439 | block-qcow.c aes.c d3des.c block-cloop.c block-dmg.c block-vvfat.c \ |
| 440 | block-qcow2.c block-cow.c \ |
| 441 | cbuffer.c \ |
| 442 | gdbstub.c usb-linux.c \ |
| 443 | vnc.c disas.c arm-dis.c \ |
| 444 | shaper.c charpipe.c loadpng.c \ |
| 445 | framebuffer.c \ |
| 446 | tcpdump.c \ |
David Turner | 9c0c515 | 2009-06-02 12:30:47 -0700 | [diff] [blame] | 447 | android/boot-properties.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 448 | android/charmap.c \ |
| 449 | android/cmdline-option.c \ |
| 450 | android/config.c \ |
| 451 | android/console.c \ |
| 452 | android/gps.c \ |
| 453 | android/help.c \ |
| 454 | android/hw-control.c \ |
| 455 | android/hw-events.c \ |
| 456 | android/hw-kmsg.c \ |
David 'Digit' Turner | c5b1270 | 2009-06-19 00:36:12 +0200 | [diff] [blame] | 457 | android/hw-lcd.c \ |
The Android Open Source Project | 9877e2e | 2009-03-18 17:39:44 -0700 | [diff] [blame] | 458 | android/hw-qemud.c \ |
| 459 | android/hw-sensors.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 460 | android/main.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 461 | android/resource.c \ |
| 462 | android/user-config.c \ |
| 463 | android/utils/bufprint.c \ |
| 464 | android/utils/debug.c \ |
| 465 | android/utils/dirscanner.c \ |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 466 | android/utils/ini.c \ |
| 467 | android/utils/filelock.c \ |
| 468 | android/utils/misc.c \ |
| 469 | android/utils/path.c \ |
| 470 | android/utils/reflist.c \ |
| 471 | android/utils/stralloc.c \ |
| 472 | android/utils/system.c \ |
| 473 | android/utils/tempfile.c \ |
| 474 | android/utils/timezone.c \ |
| 475 | android/avd/hw-config.c \ |
| 476 | android/avd/info.c \ |
| 477 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 478 | VL_SOURCES += hw/arm_boot.c \ |
| 479 | hw/android_arm.c \ |
| 480 | |
| 481 | ifeq ($(HOST_OS),windows) |
| 482 | VL_SOURCES += block-raw-win32.c |
| 483 | else |
| 484 | VL_SOURCES += block-raw-posix.c |
| 485 | endif |
| 486 | |
| 487 | ifeq ($(HOST_OS),linux) |
| 488 | LOCAL_LDLIBS += -lX11 |
| 489 | endif |
| 490 | |
| 491 | ifeq ($(HOST_ARCH),x86) |
| 492 | VL_SOURCES += i386-dis.c |
| 493 | endif |
| 494 | ifeq ($(HOST_ARCH),x86_64) |
| 495 | VL_SOURCES += i386-dis.c |
| 496 | endif |
| 497 | ifeq ($(HOST_ARCH),ppc) |
| 498 | VL_SOURCES += ppc-dis.c |
| 499 | endif |
| 500 | |
| 501 | ifeq ($(HOST_OS),windows) |
| 502 | #VL_SOURCES += tap-win32.c |
| 503 | LOCAL_LDLIBS += -mno-cygwin -mwindows -mconsole |
| 504 | endif |
| 505 | |
| 506 | LOCAL_SRC_FILES += $(VL_SOURCES) |
| 507 | |
| 508 | ifeq ($(HOST_OS),linux) |
| 509 | LOCAL_LDLIBS += -lutil -lrt |
| 510 | endif |
| 511 | |
| 512 | # add SDL-specific flags |
| 513 | # |
| 514 | LOCAL_CFLAGS += $(SDL_CFLAGS) |
| 515 | LOCAL_LDLIBS += $(SDL_LDLIBS) |
| 516 | LOCAL_STATIC_LIBRARIES += libSDL libSDLmain |
| 517 | LOCAL_STATIC_LIBRARIES += libSDL libSDLmain |
| 518 | |
| 519 | # on Windows, link the icon file as well into the executable |
| 520 | # unfortunately, our build system doesn't help us much, so we need |
| 521 | # to use some weird pathnames to make this work... |
| 522 | # |
| 523 | ifeq ($(HOST_OS),windows) |
| 524 | INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) |
| 525 | ANDROID_ICON_OBJ := android_icon.o |
| 526 | ANDROID_ICON_PATH := $(LOCAL_PATH)/images |
| 527 | $(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc |
| 528 | windres $< -I $(ANDROID_ICON_PATH) -o $@ |
| 529 | |
| 530 | # seems to be the only way to add an object file that was not generated from |
| 531 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 532 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 533 | # us to put the object file in the source directory... |
| 534 | # |
| 535 | LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ) |
| 536 | endif |
| 537 | |
| 538 | # other flags |
| 539 | LOCAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
| 540 | LOCAL_LDLIBS += -lm -lpthread |
| 541 | |
| 542 | ifeq ($(HOST_OS),windows) |
| 543 | LOCAL_LDLIBS += -lwinmm -lws2_32 -liphlpapi |
| 544 | endif |
| 545 | |
| 546 | LOCAL_LDLIBS += $(QEMU_AUDIO_LIB) |
| 547 | |
| 548 | LOCAL_MODULE := emulator |
| 549 | |
| 550 | include $(BUILD_HOST_EXECUTABLE) |
| 551 | |
| 552 | endif # TARGET_ARCH == arm |