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