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