Andrew Hsieh | ef0a233 | 2012-08-23 17:39:26 +0800 | [diff] [blame] | 1 | ifneq ($(filter true% %true,$(BUILD_EMULATOR)$(BUILD_STANDALONE_EMULATOR)),) |
Joe Onorato | edb86c3 | 2012-07-25 14:28:40 -0700 | [diff] [blame] | 2 | |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 3 | ifneq (,$(filter $(TARGET_ARCH),arm x86 mips)) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 4 | LOCAL_PATH:= $(call my-dir) |
| 5 | |
Jun Nakajima | 334ab47 | 2011-02-02 23:49:59 -0800 | [diff] [blame] | 6 | # determine the target cpu |
| 7 | ifeq ($(TARGET_ARCH),arm) |
| 8 | EMULATOR_TARGET_CPU := target-arm |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 9 | endif |
| 10 | ifeq ($(TARGET_ARCH),x86) |
Jun Nakajima | 334ab47 | 2011-02-02 23:49:59 -0800 | [diff] [blame] | 11 | EMULATOR_TARGET_CPU := target-i386 |
| 12 | endif |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 13 | ifeq ($(TARGET_ARCH),mips) |
| 14 | EMULATOR_TARGET_CPU := target-mips |
| 15 | endif |
Jun Nakajima | 334ab47 | 2011-02-02 23:49:59 -0800 | [diff] [blame] | 16 | |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 17 | # determine the host tag to use |
| 18 | QEMU_HOST_TAG := $(HOST_PREBUILT_TAG) |
| 19 | ifneq ($(USE_MINGW),) |
| 20 | QEMU_HOST_TAG := windows |
| 21 | endif |
| 22 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 23 | # determine the location of platform-specific directories |
| 24 | # |
| 25 | CONFIG_DIRS := \ |
David 'Digit' Turner | 34d1651 | 2010-05-18 17:02:33 -0700 | [diff] [blame] | 26 | $(LOCAL_PATH)/android/config/$(QEMU_HOST_TAG) |
| 27 | |
| 28 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 29 | CONFIG_DIRS := $(LOCAL_PATH)/objs $(CONFIG_DIRS) |
| 30 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 31 | |
| 32 | CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%) |
| 33 | |
David 'Digit' Turner | 0a349b8 | 2011-03-02 12:49:26 +0100 | [diff] [blame] | 34 | MY_CC := $(HOST_CC) |
| 35 | MY_CXX := $(HOST_CXX) |
| 36 | MY_AR := $(HOST_AR) |
Kenny Root | 095cd0f | 2009-09-19 18:32:44 -0500 | [diff] [blame] | 37 | |
Lars Poeschel | 33da99a | 2012-08-22 09:42:42 +0200 | [diff] [blame] | 38 | MY_CFLAGS := $(CONFIG_INCLUDES) -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 39 | |
David 'Digit' Turner | 466f548 | 2009-07-30 15:50:19 +0200 | [diff] [blame] | 40 | # Overwrite configuration for debug builds. |
| 41 | # |
| 42 | ifeq ($(BUILD_DEBUG_EMULATOR),true) |
Iliyan Malchev | d00f7c4 | 2012-03-30 10:54:20 -0700 | [diff] [blame] | 43 | MY_CFLAGS := $(CONFIG_INCLUDES) |
| 44 | MY_CFLAGS += -O0 -g |
| 45 | MY_CFLAGS += -fno-PIC -falign-functions=0 |
David 'Digit' Turner | 466f548 | 2009-07-30 15:50:19 +0200 | [diff] [blame] | 46 | endif |
| 47 | |
David 'Digit' Turner | b95f892 | 2009-08-21 23:10:16 -0700 | [diff] [blame] | 48 | MY_LDLIBS := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 49 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 50 | ifeq ($(HOST_OS),freebsd) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 51 | MY_CFLAGS += -I /usr/local/include |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 52 | endif |
| 53 | |
| 54 | ifeq ($(HOST_OS),windows) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 55 | # we need Win32 features that are available since Windows 2000 Professional/Server (NT 5.0) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 56 | MY_CFLAGS += -DWINVER=0x501 |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 57 | MY_CFLAGS += -D_WIN32 |
Hadi Muliawan | 3d0cbda | 2013-07-22 11:50:57 -0700 | [diff] [blame] | 58 | # LARGEADDRESSAWARE gives more address space to 32-bit process |
| 59 | MY_LDLIBS += -Xlinker --large-address-aware |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 60 | ifneq ($(BUILD_HOST_64bit),) |
| 61 | # Microsoft 64-bit compiler define both _WIN32 and _WIN64 |
| 62 | MY_CFLAGS += -D_WIN64 |
| 63 | # amd64-mingw32msvc- toolchain still name it vfw32. May change it once amd64-mingw32msvc- |
| 64 | # is stabilized |
| 65 | MY_LDLIBS += -lvfw32 |
| 66 | else |
| 67 | MY_LDLIBS += -lvfw32 |
| 68 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 69 | endif |
| 70 | |
| 71 | ifeq ($(HOST_ARCH),ppc) |
| 72 | MY_CFLAGS += -D__powerpc__ |
| 73 | endif |
| 74 | |
| 75 | ifeq ($(HOST_OS),darwin) |
David 'Digit' Turner | 747f7d1 | 2011-01-06 22:24:26 +0100 | [diff] [blame] | 76 | MY_CFLAGS += -mdynamic-no-pic -D_DARWIN_C_SOURCE=1 |
Andrew Hsieh | a5d8f65 | 2012-11-09 21:18:22 -0800 | [diff] [blame] | 77 | ifneq ($(host_toolchain_header),) |
| 78 | MY_CFLAGS += -isystem $(host_toolchain_header) |
| 79 | endif |
SangWook Han | 08c1bde | 2012-07-26 08:06:58 +0900 | [diff] [blame] | 80 | MY_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version) |
| 81 | MY_LDLIBS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) |
Andrew Hsieh | c2f0b96 | 2012-08-09 18:21:33 +0800 | [diff] [blame] | 82 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 83 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 84 | |
Raphael Moll | 9e319a9 | 2012-11-28 13:48:25 -0800 | [diff] [blame] | 85 | # Some CFLAGS below use -Wno-missing-field-initializers but this is not |
| 86 | # supported on GCC 3.x which is still present under Cygwin. |
| 87 | # Find out by probing GCC for support of this flag. Note that the test |
| 88 | # itself only works on GCC 4.x anyway. |
| 89 | GCC_W_NO_MISSING_FIELD_INITIALIZERS := -Wno-missing-field-initializers |
| 90 | ifeq ($(HOST_OS),windows) |
Raphael Moll | 9e319a9 | 2012-11-28 13:48:25 -0800 | [diff] [blame] | 91 | ifeq (,$(shell gcc -Q --help=warnings 2>/dev/null | grep missing-field-initializers)) |
| 92 | $(info emulator: Ignoring unsupported GCC flag $(GCC_W_NO_MISSING_FIELD_INITIALIZERS)) |
| 93 | GCC_W_NO_MISSING_FIELD_INITIALIZERS := |
| 94 | endif |
Raphael Moll | 9e319a9 | 2012-11-28 13:48:25 -0800 | [diff] [blame] | 95 | endif |
| 96 | |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 97 | # BUILD_STANDALONE_EMULATOR is only defined when building with |
| 98 | # the android-rebuild.sh script. The script will also provide |
| 99 | # adequate values for HOST_CC |
| 100 | # |
| 101 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 102 | # On Linux, use our custom 32-bit host toolchain (unless BUILD_HOST_64bit=1) |
| 103 | # which contains the relevant headers and 32-bit libraries for audio (The host 64-bit |
| 104 | # Lucid doesn't provide these anymore, only their 64-bit versions). |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 105 | ifeq ($(HOST_OS),linux) |
Andrew Hsieh | d0f2ab6 | 2012-03-23 17:35:11 +0800 | [diff] [blame] | 106 | HOST_SDK_TOOLCHAIN_PREFIX := prebuilts/tools/gcc-sdk |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 107 | # Don't do anything if the toolchain is not there |
Andrew Hsieh | d0f2ab6 | 2012-03-23 17:35:11 +0800 | [diff] [blame] | 108 | ifneq (,$(strip $(wildcard $(HOST_SDK_TOOLCHAIN_PREFIX)/gcc))) |
| 109 | MY_CC := $(HOST_SDK_TOOLCHAIN_PREFIX)/gcc |
| 110 | MY_CXX := $(HOST_SDK_TOOLCHAIN_PREFIX)/g++ |
| 111 | MY_AR := $(HOST_SDK_TOOLCHAIN_PREFIX)/ar |
| 112 | endif # $(HOST_SDK_TOOLCHAIN_PREFIX)/gcc exists |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 113 | endif # HOST_OS == linux |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 114 | |
| 115 | ifneq ($(USE_CCACHE),) |
Ying Wang | 762d5de | 2012-01-09 11:53:58 -0800 | [diff] [blame] | 116 | ccache := prebuilts/misc/$(HOST_PREBUILT_TAG)/ccache/ccache |
David 'Digit' Turner | 4ed818f | 2011-03-12 13:05:15 +0100 | [diff] [blame] | 117 | ccache := $(strip $(wildcard $(ccache))) |
Ying Wang | 7bf9d7f | 2010-10-07 15:12:11 -0700 | [diff] [blame] | 118 | ifneq ($(ccache),$(firstword $(MY_CC))) |
| 119 | MY_CC := $(ccache) $(MY_CC) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 120 | MY_CXX := $(ccache) $(MY_CXX) |
Ying Wang | 7bf9d7f | 2010-10-07 15:12:11 -0700 | [diff] [blame] | 121 | endif |
| 122 | ccache := |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 123 | endif |
Jesse Hall | 183e927 | 2012-04-26 15:13:27 -0700 | [diff] [blame] | 124 | |
| 125 | QEMU_OPENGLES_INCLUDE := sdk/emulator/opengl/host/include |
| 126 | QEMU_OPENGLES_LIBS := $(HOST_OUT) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 127 | endif |
| 128 | |
| 129 | |
| 130 | ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 131 | ifneq ($(BUILD_HOST_64bit),) |
| 132 | MY_CFLAGS += -m64 |
| 133 | MY_LDLIBS += -m64 |
| 134 | else |
| 135 | ifneq ($(HOST_ARCH),x86_64) |
| 136 | MY_CFLAGS += -m32 |
| 137 | MY_LDLIBS += -m32 |
| 138 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 139 | endif |
Andrew Hsieh | 632a0e1 | 2012-04-28 00:48:53 +0800 | [diff] [blame] | 140 | |
| 141 | ifneq ($(BUILD_HOST_static),) |
| 142 | MY_LDLIBS += -static |
| 143 | endif |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 144 | endif |
| 145 | |
David 'Digit' Turner | 4e024bb | 2010-09-22 14:19:28 +0200 | [diff] [blame] | 146 | # Enable warning, except those related to missing field initializers |
| 147 | # (the QEMU coding style loves using these). |
| 148 | # |
Raphael Moll | 9e319a9 | 2012-11-28 13:48:25 -0800 | [diff] [blame] | 149 | MY_CFLAGS += -Wall $(GCC_W_NO_MISSING_FIELD_INITIALIZERS) |
David 'Digit' Turner | 4e024bb | 2010-09-22 14:19:28 +0200 | [diff] [blame] | 150 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 151 | # Needed to build fpu/softfloat-native.h properly |
| 152 | MY_CFLAGS += -D_GNU_SOURCE=1 |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 153 | |
David 'Digit' Turner | 6e9d1d4 | 2013-12-13 17:29:58 +0100 | [diff] [blame^] | 154 | MY_CFLAGS += -I$(LOCAL_PATH)/include |
| 155 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 156 | # A useful function that can be used to start the declaration of a host |
| 157 | # module. Avoids repeating the same stuff again and again. |
| 158 | # Usage: |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 159 | # |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 160 | # $(call start-emulator-library, <module-name>) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 161 | # |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 162 | # ... declarations |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 163 | # |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 164 | # $(call end-emulator-library) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 165 | # |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 166 | start-emulator-library = \ |
| 167 | $(eval include $(CLEAR_VARS)) \ |
| 168 | $(eval LOCAL_NO_DEFAULT_COMPILER_FLAGS := true) \ |
| 169 | $(eval LOCAL_CC := $(MY_CC)) \ |
David 'Digit' Turner | b580d26 | 2011-03-02 09:49:06 +0100 | [diff] [blame] | 170 | $(eval LOCAL_CXX := $(MY_CXX)) \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 171 | $(eval LOCAL_CFLAGS := $(MY_CFLAGS)) \ |
David 'Digit' Turner | b580d26 | 2011-03-02 09:49:06 +0100 | [diff] [blame] | 172 | $(eval LOCAL_AR := $(MY_AR)) \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 173 | $(eval LOCAL_LDLIBS := $(MY_LDLIBS)) \ |
David 'Digit' Turner | 317c9d5 | 2011-05-10 06:38:21 +0200 | [diff] [blame] | 174 | $(eval LOCAL_MODULE := $1) \ |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 175 | $(eval LOCAL_MODULE_CLASS := STATIC_LIBRARIES) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 176 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 177 | # Used with start-emulator-library |
| 178 | end-emulator-library = \ |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 179 | $(eval include $(BUILD_HOST_STATIC_LIBRARY)) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 180 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 181 | # A variant of start-emulator-library to start the definition of a host |
| 182 | # program instead. Use with end-emulator-program |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 183 | start-emulator-program = \ |
| 184 | $(call start-emulator-library,$1) \ |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 185 | $(eval LOCAL_MODULE_CLASS := EXECUTABLES) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 186 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 187 | # A varient of end-emulator-library for host programs instead |
| 188 | end-emulator-program = \ |
| 189 | $(eval LOCAL_LDLIBS += $(QEMU_SYSTEM_LDLIBS)) \ |
| 190 | $(eval include $(BUILD_HOST_EXECUTABLE)) |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 191 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 192 | |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 193 | # The common libraries |
| 194 | # |
| 195 | QEMU_SYSTEM_LDLIBS := -lm |
| 196 | ifeq ($(HOST_OS),windows) |
| 197 | QEMU_SYSTEM_LDLIBS += -mno-cygwin -mwindows -mconsole |
| 198 | endif |
| 199 | |
| 200 | ifeq ($(HOST_OS),freebsd) |
| 201 | QEMU_SYSTEM_LDLIBS += -L/usr/local/lib -lpthread -lX11 -lutil |
| 202 | endif |
| 203 | |
| 204 | ifeq ($(HOST_OS),linux) |
| 205 | QEMU_SYSTEM_LDLIBS += -lutil -lrt |
| 206 | endif |
| 207 | |
| 208 | ifeq ($(HOST_OS),windows) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 209 | # amd64-mingw32msvc- toolchain still name it ws2_32. May change it once amd64-mingw32msvc- |
| 210 | # is stabilized |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 211 | QEMU_SYSTEM_LDLIBS += -lwinmm -lws2_32 -liphlpapi |
| 212 | else |
| 213 | QEMU_SYSTEM_LDLIBS += -lpthread |
| 214 | endif |
| 215 | |
David 'Digit' Turner | 393c0f1 | 2010-07-28 12:20:56 -0700 | [diff] [blame] | 216 | ifeq ($(HOST_OS),darwin) |
Vladimir Chtchetkine | 955a997 | 2011-10-12 15:40:17 -0700 | [diff] [blame] | 217 | QEMU_SYSTEM_LDLIBS += -Wl,-framework,Cocoa,-framework,QTKit,-framework,CoreVideo |
Andrew Hsieh | c2f0b96 | 2012-08-09 18:21:33 +0800 | [diff] [blame] | 218 | |
| 219 | # SDK 10.6+ doesn't have __dyld_func_lookup anymore. Dynamic library lookup symbols |
| 220 | # are instead resolved at runtime |
| 221 | OSX_VERSION_MAJOR := $(shell echo $(mac_sdk_version) | cut -d . -f 2) |
| 222 | OSX_VERSION_MAJOR_GREATER_THAN_OR_EQUAL_TO_6 := $(shell [ $(OSX_VERSION_MAJOR) -ge 6 ] && echo true) |
| 223 | ifeq ($(OSX_VERSION_MAJOR_GREATER_THAN_OR_EQUAL_TO_6),true) |
Al Sutton | 49dd3f3 | 2012-01-04 15:19:05 -0800 | [diff] [blame] | 224 | QEMU_SYSTEM_LDLIBS += -undefined dynamic_lookup |
Al Sutton | c3c9c6f | 2011-12-21 13:16:22 -0800 | [diff] [blame] | 225 | endif |
David 'Digit' Turner | 393c0f1 | 2010-07-28 12:20:56 -0700 | [diff] [blame] | 226 | endif |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 227 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 228 | include $(LOCAL_PATH)/Makefile.common |
| 229 | |
Raphael Moll | cdbea23 | 2012-05-04 15:04:27 -0700 | [diff] [blame] | 230 | ifeq ($(HOST_OS),windows) |
| 231 | # on Windows, link the icon file as well into the executable |
| 232 | # unfortunately, our build system doesn't help us much, so we need |
| 233 | # to use some weird pathnames to make this work... |
| 234 | |
| 235 | # Locate windres executable |
| 236 | WINDRES := windres |
| 237 | ifneq ($(USE_MINGW),) |
| 238 | # When building the Windows emulator under Linux, use the MinGW one |
| 239 | WINDRES := i586-mingw32msvc-windres |
| 240 | endif |
| 241 | |
| 242 | # Usage: $(eval $(call insert-windows-icon)) |
| 243 | define insert-windows-icon |
| 244 | LOCAL_PREBUILT_OBJ_FILES += images/emulator_icon.o |
| 245 | endef |
| 246 | |
| 247 | # This seems to be the only way to add an object file that was not generated from |
| 248 | # a C/C++/Java source file to our build system. and very unfortunately, |
| 249 | # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces |
| 250 | # us to put the object file in the source directory. |
| 251 | $(LOCAL_PATH)/images/emulator_icon.o: $(LOCAL_PATH)/images/android_icon.rc |
| 252 | $(WINDRES) $< -I $(LOCAL_PATH)/images -o $@ |
| 253 | endif |
| 254 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 255 | # We want to build all variants of the emulator binaries. This makes |
| 256 | # it easier to catch target-specific regressions during emulator development. |
| 257 | EMULATOR_TARGET_ARCH := arm |
| 258 | include $(LOCAL_PATH)/Makefile.target |
| 259 | |
| 260 | EMULATOR_TARGET_ARCH := x86 |
| 261 | include $(LOCAL_PATH)/Makefile.target |
Vladimir Chtchetkine | ba1f57f | 2010-07-27 14:14:15 -0700 | [diff] [blame] | 262 | |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 263 | EMULATOR_TARGET_ARCH := mips |
| 264 | include $(LOCAL_PATH)/Makefile.target |
| 265 | |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 266 | ############################################################################## |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 267 | ############################################################################## |
| 268 | ### |
David 'Digit' Turner | 2d238fd | 2011-03-25 10:34:47 +0100 | [diff] [blame] | 269 | ### emulator: LAUNCHER FOR TARGET-SPECIFIC EMULATOR |
| 270 | ### |
| 271 | ### |
| 272 | $(call start-emulator-program, emulator) |
| 273 | |
| 274 | LOCAL_SRC_FILES := android/main-emulator.c |
| 275 | LOCAL_STATIC_LIBRARIES := emulator-common |
| 276 | |
Raphael Moll | cdbea23 | 2012-05-04 15:04:27 -0700 | [diff] [blame] | 277 | ifeq ($(HOST_OS),windows) |
| 278 | $(eval $(call insert-windows-icon)) |
| 279 | endif |
| 280 | |
David 'Digit' Turner | 2d238fd | 2011-03-25 10:34:47 +0100 | [diff] [blame] | 281 | $(call end-emulator-program) |
| 282 | |
| 283 | ############################################################################## |
| 284 | ############################################################################## |
| 285 | ### |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 286 | ### emulator-ui: UI FRONT-END PROGRAM |
| 287 | ### |
| 288 | ### |
| 289 | $(call start-emulator-program, emulator-ui) |
The Android Open Source Project | 8b23a6c | 2009-03-03 19:30:32 -0800 | [diff] [blame] | 290 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 291 | LOCAL_STATIC_LIBRARIES := \ |
| 292 | emulator-common \ |
| 293 | emulator-libui \ |
| 294 | emulator-common \ |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 295 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 296 | LOCAL_CFLAGS += -DCONFIG_STANDALONE_UI=1 |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 297 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 298 | LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS) $(EMULATOR_LIBUI_CFLAGS) |
| 299 | LOCAL_LDLIBS += $(EMULATOR_COMMON_LDLIBS) $(EMULATOR_LIBUI_LDLIBS) |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 300 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 301 | LOCAL_SRC_FILES := \ |
| 302 | android/cmdline-option.c \ |
| 303 | android/config.c \ |
| 304 | android/help.c \ |
| 305 | android/looper-generic.c \ |
| 306 | android/snapshot.c \ |
| 307 | android/main-common.c \ |
| 308 | android/main.c \ |
David 'Digit' Turner | cb88e79 | 2011-08-26 01:35:14 +0200 | [diff] [blame] | 309 | android/opengles.c \ |
David 'Digit' Turner | f816a75 | 2011-06-23 18:40:11 +0200 | [diff] [blame] | 310 | android/utils/setenv.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 311 | vl-android-ui.c \ |
| 312 | android/protocol/core-connection.c \ |
| 313 | android/protocol/attach-ui-impl.c \ |
| 314 | android/protocol/fb-updates-impl.c \ |
| 315 | android/protocol/ui-commands-impl.c \ |
| 316 | android/protocol/core-commands-proxy.c \ |
| 317 | android/protocol/user-events-proxy.c \ |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 318 | |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 319 | $(call gen-hw-config-defs,android/main-common.c) |
| 320 | |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 321 | LOCAL_SRC_FILES += $(SDLMAIN_SOURCES) |
| 322 | |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 323 | LOCAL_STATIC_LIBRARIES += $(SDL_STATIC_LIBRARIES) |
| 324 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 325 | $(call end-emulator-program) |
Xavier Ducrohet | fc8ed80 | 2011-02-09 18:04:23 -0800 | [diff] [blame] | 326 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 327 | ## VOILA!! |
David 'Digit' Turner | f59442f | 2010-10-08 16:22:10 +0200 | [diff] [blame] | 328 | |
Bhanu Chetlapalli | 741dc13 | 2012-05-08 17:16:03 -0700 | [diff] [blame] | 329 | endif # TARGET_ARCH == arm || TARGET_ARCH == x86 || TARGET_ARCH == mips |
Andrew Hsieh | ef0a233 | 2012-08-23 17:39:26 +0800 | [diff] [blame] | 330 | endif # BUILD_EMULATOR == true || BUILD_STANDALONE_EMULATOR == true |