David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 1 | # When building this project, we actually generate several components which |
| 2 | # are the following: |
| 3 | # |
| 4 | # - the emulator-ui program (which is target-agnostic) |
| 5 | # - the target-specific qemu-android-$ARCH programs (headless emulation engines) |
| 6 | # - the "standalone" emulator programs (embed both UI and engine in a single |
| 7 | # binary and process), i.e. "emulator" for ARM and "emulator-x86" for x86. |
| 8 | # |
| 9 | # This file defines static host libraries that will be used by at least two |
| 10 | # of these components. |
| 11 | # |
| 12 | |
| 13 | ############################################################################## |
| 14 | ############################################################################## |
| 15 | ### |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 16 | ### gen-hw-config-defs: Generate hardware configuration definitions header |
| 17 | ### |
| 18 | ### The 'gen-hw-config.py' script is used to generate the hw-config-defs.h |
| 19 | ### header from the an .ini file like android/avd/hardware-properties.ini |
| 20 | ### |
| 21 | ### Due to the way the Android build system works, we need to regenerate |
| 22 | ### it for each module (the output will go into a module-specific directory). |
| 23 | ### |
| 24 | ### This defines a function that can be used inside a module definition |
| 25 | ### |
| 26 | ### $(call gen-hw-config-defs) |
| 27 | ### |
| 28 | |
| 29 | # First, define a rule to generate a dummy "emulator_hw_config_defs" module |
| 30 | # which purpose is simply to host the generated header in its output directory. |
| 31 | intermediates := $(call intermediates-dir-for,SHARED_LIBRARIES,emulator_hw_config_defs,true) |
| 32 | |
| 33 | QEMU_HARDWARE_PROPERTIES_INI := $(LOCAL_PATH)/android/avd/hardware-properties.ini |
| 34 | QEMU_HW_CONFIG_DEFS_H := $(intermediates)/android/avd/hw-config-defs.h |
| 35 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_PATH := $(LOCAL_PATH) |
David 'Digit' Turner | 66241a6 | 2011-07-06 00:31:59 +0200 | [diff] [blame] | 36 | $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/android/tools/gen-hw-config.py $< $@ |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 37 | $(QEMU_HW_CONFIG_DEFS_H): $(QEMU_HARDWARE_PROPERTIES_INI) $(LOCAL_PATH)/android/tools/gen-hw-config.py |
| 38 | $(hide) rm -f $@ |
| 39 | $(transform-generated-source) |
| 40 | |
| 41 | QEMU_HW_CONFIG_DEFS_INCLUDES := $(intermediates) |
| 42 | |
| 43 | # Second, define a function that needs to be called inside each module that contains |
| 44 | # a source file that includes the generated header file. |
| 45 | gen-hw-config-defs = \ |
| 46 | $(eval LOCAL_GENERATED_SOURCES += $(QEMU_HW_CONFIG_DEFS_H))\ |
| 47 | $(eval LOCAL_C_INCLUDES += $(QEMU_HW_CONFIG_DEFS_INCLUDES)) |
| 48 | |
| 49 | ############################################################################## |
| 50 | ############################################################################## |
| 51 | ### |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 52 | ### emulator-common: LIBRARY OF COMMON FUNCTIONS |
| 53 | ### |
| 54 | ### THESE ARE POTENTIALLY USED BY ALL COMPONENTS |
| 55 | ### |
| 56 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 57 | common_LOCAL_CFLAGS = |
| 58 | common_LOCAL_SRC_FILES = |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 59 | |
| 60 | EMULATOR_COMMON_CFLAGS := |
| 61 | |
| 62 | # Needed by everything about the host |
| 63 | EMULATOR_COMMON_CFLAGS += \ |
| 64 | -I$(LOCAL_PATH)/android/config/$(QEMU_HOST_TAG) |
| 65 | |
| 66 | # add the build ID to the default macro definitions |
| 67 | ifeq ($(BUILD_STANDALONE_EMULATOR),) |
| 68 | EMULATOR_COMMON_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))" |
| 69 | endif |
| 70 | |
| 71 | # For non-standalone builds, extract the major version number from the Android SDK |
| 72 | # tools revision number. |
| 73 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 74 | ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties) |
| 75 | endif |
| 76 | |
| 77 | ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION)) |
| 78 | ifdef ANDROID_SDK_TOOLS_REVISION |
| 79 | EMULATOR_COMMON_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION) |
| 80 | endif |
| 81 | |
| 82 | # Enable large-file support (i.e. make off_t a 64-bit value) |
| 83 | ifeq ($(HOST_OS),linux) |
| 84 | EMULATOR_COMMON_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
| 85 | endif |
| 86 | |
| 87 | ########################################################### |
| 88 | # Zlib sources |
| 89 | # |
| 90 | ZLIB_DIR := distrib/zlib-1.2.3 |
| 91 | include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make |
| 92 | EMULATOR_COMMON_CFLAGS += -I$(LOCAL_PATH)/$(ZLIB_DIR) |
| 93 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 94 | common_LOCAL_SRC_FILES += $(ZLIB_SOURCES) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 95 | |
| 96 | ########################################################### |
| 97 | # Android utility functions |
| 98 | # |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 99 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 100 | sockets.c \ |
| 101 | iolooper-select.c \ |
| 102 | android/async-console.c \ |
| 103 | android/async-utils.c \ |
| 104 | android/charmap.c \ |
| 105 | android/framebuffer.c \ |
| 106 | android/keycode-array.c \ |
| 107 | android/avd/hw-config.c \ |
| 108 | android/avd/info.c \ |
David 'Digit' Turner | 2d238fd | 2011-03-25 10:34:47 +0100 | [diff] [blame] | 109 | android/avd/util.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 110 | android/sync-utils.c \ |
| 111 | android/utils/assert.c \ |
| 112 | android/utils/bufprint.c \ |
| 113 | android/utils/debug.c \ |
David 'Digit' Turner | 816e53c | 2011-08-17 18:33:45 +0200 | [diff] [blame] | 114 | android/utils/dll.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 115 | android/utils/dirscanner.c \ |
| 116 | android/utils/filelock.c \ |
| 117 | android/utils/ini.c \ |
David 'Digit' Turner | bbb8104 | 2011-03-17 14:48:44 +0100 | [diff] [blame] | 118 | android/utils/intmap.c \ |
David 'Digit' Turner | 0a879bf | 2011-05-12 18:45:18 +0200 | [diff] [blame] | 119 | android/utils/lineinput.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 120 | android/utils/mapfile.c \ |
| 121 | android/utils/misc.c \ |
| 122 | android/utils/panic.c \ |
| 123 | android/utils/path.c \ |
| 124 | android/utils/reflist.c \ |
| 125 | android/utils/refset.c \ |
| 126 | android/utils/stralloc.c \ |
| 127 | android/utils/system.c \ |
| 128 | android/utils/tempfile.c \ |
| 129 | android/utils/vector.c \ |
| 130 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 131 | common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS) |
| 132 | |
| 133 | |
| 134 | ## one for 32-bit |
| 135 | $(call start-emulator-library, emulator-common) |
| 136 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) |
| 137 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 138 | $(call gen-hw-config-defs) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 139 | $(call end-emulator-library) |
| 140 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 141 | ## another for 64-bit |
| 142 | # NOTE: only linux in non-standalone mode is supported, because |
| 143 | # 1) For Windows: amd64-mingw32msvc-gcc doesn't work, see http://b/issue?id=5949152. |
| 144 | # 2) For MacOSX: 64-bit libSDL*.a 1.2.x depends on NSQuickDrawView doesn't exist |
| 145 | # 3) Standalone has --try-64 |
Andrew Hsieh | d0f2ab6 | 2012-03-23 17:35:11 +0800 | [diff] [blame] | 146 | ifeq ($(HOST_OS),linux) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 147 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 148 | $(call start-emulator-library, emulator64-common) |
| 149 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64 |
| 150 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 151 | $(call gen-hw-config-defs) |
| 152 | $(call end-emulator-library) |
| 153 | endif # BUILD_STANDALONE_EMULATOR == nil |
| 154 | endif # HOST_OS == linux |
| 155 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 156 | ############################################################################## |
| 157 | ############################################################################## |
| 158 | ### |
| 159 | ### emulator-libui: LIBRARY OF UI-RELATED FUNCTIONS |
| 160 | ### |
| 161 | ### THESE ARE USED BY 'emulator-ui' AND THE STANDALONE PROGRAMS |
| 162 | ### |
| 163 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 164 | common_LOCAL_CFLAGS = |
| 165 | common_LOCAL_SRC_FILES = |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 166 | |
| 167 | EMULATOR_LIBUI_CFLAGS := |
| 168 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 169 | common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 170 | |
| 171 | ########################################################### |
| 172 | # Libpng configuration |
| 173 | # |
| 174 | LIBPNG_DIR := distrib/libpng-1.2.19 |
| 175 | include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make |
| 176 | |
| 177 | EMULATOR_LIBUI_CFLAGS += \ |
| 178 | $(LIBPNG_CFLAGS) \ |
| 179 | -I$(LOCAL_PATH)/$(LIBPNG_DIR) |
| 180 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 181 | common_LOCAL_SRC_FILES += $(LIBPNG_SOURCES) loadpng.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 182 | |
| 183 | ############################################################################## |
| 184 | # SDL-related definitions |
| 185 | # |
| 186 | |
| 187 | # Build SDL from sources except in certain cases where we use |
| 188 | # prebuilt libraries instead. |
| 189 | # |
| 190 | BUILD_SDL_FROM_SOURCES := true |
| 191 | |
| 192 | # On linux-x86, using the prebuilts avoid installing all the X11 |
| 193 | # development packages on our build servers. |
| 194 | # |
| 195 | ifeq ($(QEMU_HOST_TAG),linux-x86) |
| 196 | BUILD_SDL_FROM_SOURCES := false |
| 197 | endif |
| 198 | |
| 199 | # On darwin-x86, a bug in the Android build system prevents the compilation |
| 200 | # of Objective-C sources. Fixed recently in AOSP, but we still use the |
| 201 | # prebuilts for the benefit of older platform branches. |
| 202 | # |
| 203 | ifeq ($(QEMU_HOST_TAG),darwin-x86) |
| 204 | BUILD_SDL_FROM_SOURCES := false |
| 205 | endif |
| 206 | |
| 207 | # If we're building with android-configure.sh && make, always build from |
| 208 | # sources to catch regressions as soon as they happen. |
| 209 | # |
| 210 | ifeq ($(BUILD_STANDALONE_EMULATOR),true) |
| 211 | BUILD_SDL_FROM_SOURCES := true |
| 212 | endif |
| 213 | |
| 214 | # Except if we used android-configure.sh --sdl-config=<script> |
| 215 | # |
David 'Digit' Turner | a402668 | 2011-08-24 12:54:01 +0200 | [diff] [blame] | 216 | ifneq ($(QEMU_SDL_CONFIG),) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 217 | BUILD_SDL_FROM_SOURCES := false |
David 'Digit' Turner | a402668 | 2011-08-24 12:54:01 +0200 | [diff] [blame] | 218 | SDL_CONFIG := $(QEMU_SDL_CONFIG) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 219 | endif |
| 220 | |
| 221 | ifneq ($(BUILD_SDL_FROM_SOURCES),true) |
| 222 | |
| 223 | SDL_CONFIG ?= prebuilt/$(QEMU_HOST_TAG)/sdl/bin/sdl-config |
| 224 | SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) |
| 225 | |
| 226 | # We need to filter out the _GNU_SOURCE variable because it breaks recent |
| 227 | # releases of Cygwin when using the -mno-cygwin option. Moreover, we don't |
| 228 | # need this macro at all to build the Android emulator. |
| 229 | SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS)) |
| 230 | SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs)) |
| 231 | |
| 232 | # Circular dependencies between libSDL and libSDLmain |
| 233 | # We repeat the libraries in the final link to work around it |
| 234 | SDL_STATIC_LIBRARIES := libSDL libSDLmain libSDL libSDLmain |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 235 | SDL_STATIC_LIBRARIES_64 := lib64SDL lib64SDLmain lib64SDL lib64SDLmain |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 236 | |
| 237 | else # BUILD_SDL_FROM_SOURCES |
| 238 | |
| 239 | SDL_DIR := distrib/sdl-1.2.12 |
| 240 | include $(LOCAL_PATH)/$(SDL_DIR)/sources.make |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 241 | common_LOCAL_SRC_FILES += $(SDL_SOURCES) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 242 | |
| 243 | EMULATOR_LIBUI_CFLAGS += \ |
| 244 | -I$(LOCAL_PATH)/$(SDL_DIR)/include |
| 245 | |
| 246 | SDL_STATIC_LIBRARIES := |
| 247 | |
| 248 | endif # BUILD_SDL_FROM_SOURCES |
| 249 | |
| 250 | EMULATOR_LIBUI_CFLAGS += $(SDL_CFLAGS) |
| 251 | EMULATOR_LIBUI_LDLIBS += $(SDL_LDLIBS) |
| 252 | |
| 253 | # The following is needed by SDL_LoadObject |
| 254 | ifneq ($(HOST_OS),windows) |
| 255 | EMULATOR_LIBUI_LDLIBS += -ldl |
| 256 | endif |
| 257 | |
| 258 | # the skin support sources |
| 259 | # |
| 260 | SKIN_SOURCES := rect.c \ |
| 261 | region.c \ |
| 262 | image.c \ |
| 263 | trackball.c \ |
| 264 | keyboard.c \ |
| 265 | keyset.c \ |
| 266 | file.c \ |
| 267 | window.c \ |
| 268 | scaler.c \ |
| 269 | composer.c \ |
| 270 | surface.c \ |
| 271 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 272 | common_LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 273 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 274 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 275 | android/user-config.c \ |
| 276 | android/resource.c \ |
| 277 | android/qemulator.c \ |
| 278 | android/keycode.c \ |
| 279 | |
| 280 | # enable MMX code for our skin scaler |
| 281 | ifeq ($(HOST_ARCH),x86) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 282 | common_LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 283 | endif |
| 284 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 285 | common_LOCAL_CFLAGS += $(EMULATOR_LIBUI_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 286 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 287 | |
| 288 | ## one for 32-bit |
| 289 | $(call start-emulator-library, emulator-libui) |
| 290 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) |
| 291 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 292 | $(call gen-hw-config-defs) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 293 | $(call end-emulator-library) |
| 294 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 295 | |
| 296 | ## another for 64-bit, see note in emulator64-common |
Andrew Hsieh | d0f2ab6 | 2012-03-23 17:35:11 +0800 | [diff] [blame] | 297 | ifeq ($(HOST_OS),linux) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 298 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 299 | $(call start-emulator-library, emulator64-libui) |
| 300 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64 |
| 301 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 302 | $(call gen-hw-config-defs) |
| 303 | $(call end-emulator-library) |
| 304 | endif # BUILD_STANDALONE_EMULATOR == nil |
| 305 | endif # HOST_OS == linux |
| 306 | |
| 307 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 308 | ############################################################################## |
| 309 | ############################################################################## |
| 310 | ### |
| 311 | ### emulator-libqemu: TARGET-INDEPENDENT QEMU FUNCTIONS |
| 312 | ### |
| 313 | ### THESE ARE USED BY EVERYTHING EXCEPT 'emulator-ui' |
| 314 | ### |
| 315 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 316 | common_LOCAL_CFLAGS = |
| 317 | common_LOCAL_SRC_FILES = |
| 318 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 319 | |
| 320 | EMULATOR_LIBQEMU_CFLAGS := |
| 321 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 322 | common_LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 323 | |
Vladimir Chtchetkine | 70a18cd | 2012-01-31 16:21:06 -0800 | [diff] [blame] | 324 | ########################################################### |
| 325 | # Jpeg configuration |
| 326 | # |
| 327 | LIBJPEG_DIR := distrib/jpeg-6b |
| 328 | include $(LOCAL_PATH)/$(LIBJPEG_DIR)/sources.make |
| 329 | |
| 330 | EMULATOR_LIBQEMU_CFLAGS += \ |
| 331 | $(LIBJPEG_CFLAGS) \ |
| 332 | -I$(LOCAL_PATH)/$(LIBJPEG_DIR) |
| 333 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 334 | common_LOCAL_SRC_FILES += $(LIBJPEG_SOURCES) |
Vladimir Chtchetkine | 70a18cd | 2012-01-31 16:21:06 -0800 | [diff] [blame] | 335 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 336 | AUDIO_SOURCES := noaudio.c wavaudio.c wavcapture.c mixeng.c |
| 337 | AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO |
| 338 | AUDIO_LDLIBS := |
| 339 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 340 | common_LOCAL_CFLAGS += -Wall -Wno-missing-field-initializers |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 341 | |
| 342 | ifeq ($(HOST_OS),darwin) |
| 343 | CONFIG_COREAUDIO ?= yes |
| 344 | AUDIO_CFLAGS += -DHOST_BSD=1 |
| 345 | endif |
| 346 | |
| 347 | ifeq ($(HOST_OS),windows) |
| 348 | CONFIG_WINAUDIO ?= yes |
| 349 | endif |
| 350 | |
| 351 | ifeq ($(HOST_OS),linux) |
| 352 | CONFIG_OSS ?= yes |
| 353 | CONFIG_ALSA ?= yes |
| 354 | CONFIG_PULSEAUDIO ?= yes |
| 355 | CONFIG_ESD ?= yes |
| 356 | endif |
| 357 | |
| 358 | ifeq ($(HOST_OS),freebsd) |
| 359 | CONFIG_OSS ?= yes |
| 360 | endif |
| 361 | |
| 362 | ifeq ($(CONFIG_COREAUDIO),yes) |
| 363 | AUDIO_SOURCES += coreaudio.c |
| 364 | AUDIO_CFLAGS += -DCONFIG_COREAUDIO |
| 365 | AUDIO_LDLIBS += -Wl,-framework,CoreAudio |
| 366 | endif |
| 367 | |
| 368 | ifeq ($(CONFIG_WINAUDIO),yes) |
| 369 | AUDIO_SOURCES += winaudio.c |
| 370 | AUDIO_CFLAGS += -DCONFIG_WINAUDIO |
| 371 | endif |
| 372 | |
| 373 | ifeq ($(CONFIG_PULSEAUDIO),yes) |
| 374 | AUDIO_SOURCES += paaudio.c audio_pt_int.c |
| 375 | AUDIO_CFLAGS += -DCONFIG_PULSEAUDIO |
| 376 | endif |
| 377 | |
| 378 | ifeq ($(CONFIG_ALSA),yes) |
| 379 | AUDIO_SOURCES += alsaaudio.c audio_pt_int.c |
| 380 | AUDIO_CFLAGS += -DCONFIG_ALSA |
| 381 | endif |
| 382 | |
| 383 | ifeq ($(CONFIG_ESD),yes) |
| 384 | AUDIO_SOURCES += esdaudio.c |
| 385 | AUDIO_CFLAGS += -DCONFIG_ESD |
| 386 | endif |
| 387 | |
| 388 | ifeq ($(CONFIG_OSS),yes) |
| 389 | AUDIO_SOURCES += ossaudio.c |
| 390 | AUDIO_CFLAGS += -DCONFIG_OSS |
| 391 | endif |
| 392 | |
| 393 | AUDIO_SOURCES := $(call sort,$(AUDIO_SOURCES:%=audio/%)) |
| 394 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 395 | common_LOCAL_CFLAGS += -Wno-sign-compare \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 396 | -fno-strict-aliasing -W -Wall -Wno-unused-parameter \ |
| 397 | |
| 398 | # this is very important, otherwise the generated binaries may |
| 399 | # not link properly on our build servers |
| 400 | ifeq ($(HOST_OS),linux) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 401 | common_LOCAL_CFLAGS += -fno-stack-protector |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 402 | endif |
| 403 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 404 | common_LOCAL_SRC_FILES += $(AUDIO_SOURCES) |
| 405 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 406 | android/audio-test.c |
| 407 | |
| 408 | # other flags |
| 409 | ifneq ($(HOST_OS),windows) |
| 410 | AUDIO_LDLIBS += -ldl |
| 411 | else |
| 412 | endif |
| 413 | |
| 414 | |
| 415 | EMULATOR_LIBQEMU_CFLAGS += $(AUDIO_CFLAGS) |
| 416 | EMULATOR_LIBQEMU_LDLIBS += $(AUDIO_LDLIBS) |
| 417 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 418 | common_LOCAL_CFLAGS += -Wno-missing-field-initializers |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 419 | |
| 420 | # migration sources |
| 421 | # |
| 422 | ifeq ($(HOST_OS),windows) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 423 | common_LOCAL_SRC_FILES += migration-dummy-android.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 424 | else |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 425 | common_LOCAL_SRC_FILES += migration.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 426 | migration-exec.c \ |
| 427 | migration-tcp-android.c |
| 428 | endif |
| 429 | |
| 430 | # misc. sources |
| 431 | # |
| 432 | CORE_MISC_SOURCES = \ |
| 433 | acl.c \ |
| 434 | aes.c \ |
| 435 | aio-android.c \ |
| 436 | async.c \ |
| 437 | bt-host.c \ |
| 438 | bt-vhci.c \ |
| 439 | buffered_file.c \ |
| 440 | cbuffer.c \ |
| 441 | charpipe.c \ |
| 442 | console.c \ |
| 443 | cutils.c \ |
| 444 | d3des.c \ |
| 445 | input.c \ |
David 'Digit' Turner | 8354d2d | 2011-05-11 00:19:06 +0200 | [diff] [blame] | 446 | iohandler.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 447 | ioport.c \ |
| 448 | module.c \ |
| 449 | net-android.c \ |
| 450 | notify.c \ |
| 451 | osdep.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 452 | path.c \ |
David 'Digit' Turner | 3b2846a | 2011-05-11 01:34:40 +0200 | [diff] [blame] | 453 | qemu-char.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 454 | qemu-config.c \ |
| 455 | qemu-error.c \ |
| 456 | qemu-malloc.c \ |
| 457 | qemu-option.c \ |
| 458 | qemu-sockets-android.c \ |
| 459 | qerror.c \ |
| 460 | readline.c \ |
| 461 | savevm.c \ |
| 462 | shaper.c \ |
| 463 | tcpdump.c \ |
| 464 | vnc-android.c \ |
| 465 | android/boot-properties.c \ |
| 466 | android/config.c \ |
| 467 | android/core-init-utils.c \ |
| 468 | android/gps.c \ |
| 469 | android/hw-kmsg.c \ |
| 470 | android/hw-lcd.c \ |
| 471 | android/hw-events.c \ |
| 472 | android/hw-control.c \ |
| 473 | android/hw-sensors.c \ |
| 474 | android/hw-qemud.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 475 | android/looper-qemu.c \ |
David 'Digit' Turner | c0ac733 | 2011-05-02 15:05:35 +0200 | [diff] [blame] | 476 | android/hw-pipe-net.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 477 | android/qemu-setup.c \ |
| 478 | android/snapshot.c \ |
Vladimir Chtchetkine | db611d5 | 2011-11-01 17:35:07 -0700 | [diff] [blame] | 479 | android/android-device.c \ |
Vladimir Chtchetkine | 9d36fe7 | 2012-03-26 10:29:20 -0700 | [diff] [blame^] | 480 | android/async-socket-connector.c \ |
Vladimir Chtchetkine | db611d5 | 2011-11-01 17:35:07 -0700 | [diff] [blame] | 481 | android/sensors-port.c \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 482 | android/utils/timezone.c \ |
Vladimir Chtchetkine | c646f5e | 2011-09-03 15:17:13 -0700 | [diff] [blame] | 483 | android/camera/camera-format-converters.c \ |
Vladimir Chtchetkine | d86c724 | 2011-12-09 15:45:46 -0800 | [diff] [blame] | 484 | android/camera/camera-service.c \ |
| 485 | android/adb-server.c \ |
Vladimir Chtchetkine | db450d7 | 2012-01-12 13:37:40 -0800 | [diff] [blame] | 486 | android/adb-qemud.c \ |
Vladimir Chtchetkine | 8dd31e8 | 2012-02-15 17:16:04 -0800 | [diff] [blame] | 487 | android/snaphost-android.c \ |
| 488 | android/multitouch-screen.c \ |
| 489 | android/multitouch-port.c \ |
| 490 | android/utils/jpeg-compress.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 491 | |
| 492 | ifeq ($(HOST_ARCH),x86) |
| 493 | CORE_MISC_SOURCES += i386-dis.c |
| 494 | endif |
| 495 | ifeq ($(HOST_ARCH),x86_64) |
| 496 | CORE_MISC_SOURCES += i386-dis.c |
| 497 | endif |
| 498 | ifeq ($(HOST_ARCH),ppc) |
| 499 | CORE_MISC_SOURCES += ppc-dis.c \ |
| 500 | cache-utils.c |
| 501 | endif |
| 502 | |
| 503 | ifeq ($(HOST_OS),linux) |
| 504 | CORE_MISC_SOURCES += usb-linux.c \ |
Vladimir Chtchetkine | 4ed09fd | 2011-08-18 09:42:40 -0700 | [diff] [blame] | 505 | qemu-thread.c \ |
| 506 | android/camera/camera-capture-linux.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 507 | else |
| 508 | CORE_MISC_SOURCES += usb-dummy-android.c |
| 509 | endif |
| 510 | |
| 511 | ifeq ($(HOST_OS),windows) |
Vladimir Chtchetkine | 4ed09fd | 2011-08-18 09:42:40 -0700 | [diff] [blame] | 512 | CORE_MISC_SOURCES += tap-win32.c \ |
| 513 | android/camera/camera-capture-windows.c |
| 514 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 515 | else |
| 516 | CORE_MISC_SOURCES += posix-aio-compat.c |
| 517 | endif |
| 518 | |
Vladimir Chtchetkine | b92b303 | 2011-09-12 15:29:32 -0700 | [diff] [blame] | 519 | ifeq ($(HOST_OS),darwin) |
Vladimir Chtchetkine | 955a997 | 2011-10-12 15:40:17 -0700 | [diff] [blame] | 520 | CORE_MISC_SOURCES += android/camera/camera-capture-mac.m |
Vladimir Chtchetkine | b92b303 | 2011-09-12 15:29:32 -0700 | [diff] [blame] | 521 | endif |
| 522 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 523 | common_LOCAL_SRC_FILES += $(CORE_MISC_SOURCES) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 524 | |
| 525 | # Required |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 526 | common_LOCAL_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1 |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 527 | |
| 528 | SLIRP_SOURCES := \ |
| 529 | bootp.c \ |
| 530 | cksum.c \ |
| 531 | debug.c \ |
| 532 | if.c \ |
| 533 | ip_icmp.c \ |
| 534 | ip_input.c \ |
| 535 | ip_output.c \ |
| 536 | mbuf.c \ |
| 537 | misc.c \ |
| 538 | sbuf.c \ |
| 539 | slirp.c \ |
| 540 | socket.c \ |
| 541 | tcp_input.c \ |
| 542 | tcp_output.c \ |
| 543 | tcp_subr.c \ |
| 544 | tcp_timer.c \ |
| 545 | tftp.c \ |
| 546 | udp.c |
| 547 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 548 | common_LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 549 | EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/slirp-android |
| 550 | |
| 551 | # socket proxy support |
| 552 | # |
| 553 | PROXY_SOURCES := \ |
| 554 | proxy_common.c \ |
| 555 | proxy_http.c \ |
| 556 | proxy_http_connector.c \ |
| 557 | proxy_http_rewriter.c \ |
| 558 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 559 | common_LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 560 | EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/proxy |
| 561 | |
| 562 | # include telephony stuff |
| 563 | # |
| 564 | TELEPHONY_SOURCES := \ |
| 565 | android_modem.c \ |
| 566 | modem_driver.c \ |
| 567 | gsm.c \ |
| 568 | sim_card.c \ |
| 569 | sysdeps_qemu.c \ |
| 570 | sms.c \ |
| 571 | remote_call.c |
| 572 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 573 | common_LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 574 | EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/telephony |
| 575 | |
| 576 | # sources inherited from upstream, but not fully |
| 577 | # integrated into android emulator |
| 578 | # |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 579 | common_LOCAL_SRC_FILES += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 580 | json-lexer.c \ |
| 581 | json-parser.c \ |
| 582 | json-streamer.c \ |
| 583 | qjson.c \ |
| 584 | qbool.c \ |
| 585 | qdict.c \ |
| 586 | qfloat.c \ |
| 587 | qint.c \ |
| 588 | qlist.c \ |
| 589 | qstring.c \ |
| 590 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 591 | ifeq ($(QEMU_TARGET_XML_SOURCES),) |
| 592 | QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3 |
| 593 | QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml) |
| 594 | endif |
| 595 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 596 | common_LOCAL_CFLAGS += $(EMULATOR_LIBQEMU_CFLAGS) |
| 597 | |
| 598 | |
| 599 | ## one for 32-bit |
| 600 | $(call start-emulator-library, emulator-libqemu) |
| 601 | # gdbstub-xml.c contains C-compilable arrays corresponding to the content |
| 602 | # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script. |
| 603 | # |
| 604 | intermediates = $(call intermediates-dir-for,STATIC_LIBRARIES,$(LOCAL_MODULE),true) |
| 605 | QEMU_GDBSTUB_XML_C = $(intermediates)/gdbstub-xml.c |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 606 | $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH) |
| 607 | $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES) |
| 608 | $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES) |
| 609 | $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh |
| 610 | $(hide) rm -f $@ |
| 611 | $(transform-generated-source) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 612 | LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 613 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -I$(intermediates) |
| 614 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 615 | $(call gen-hw-config-defs) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 616 | $(call end-emulator-library) |
| 617 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 618 | |
| 619 | ## another for 64-bit, see note in emulator64-common |
Andrew Hsieh | d0f2ab6 | 2012-03-23 17:35:11 +0800 | [diff] [blame] | 620 | ifeq ($(HOST_OS),linux) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 621 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 622 | $(call start-emulator-library, emulator64-libqemu) |
| 623 | # gdbstub-xml.c contains C-compilable arrays corresponding to the content |
| 624 | # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script. |
| 625 | # |
| 626 | intermediates = $(call intermediates-dir-for,STATIC_LIBRARIES,$(LOCAL_MODULE),true) |
| 627 | QEMU_GDBSTUB_XML_C = $(intermediates)/gdbstub-xml.c |
| 628 | $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH) |
| 629 | $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES) |
| 630 | $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES) |
| 631 | $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh |
| 632 | $(hide) rm -f $@ |
| 633 | $(transform-generated-source) |
| 634 | LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C) |
| 635 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -I$(intermediates) -m64 |
| 636 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 637 | $(call gen-hw-config-defs) |
| 638 | $(call end-emulator-library) |
| 639 | endif # BUILD_STANDALONE_EMULATOR == nil |
| 640 | endif # HOST_OS == linux |
| 641 | |
| 642 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 643 | # Block sources, we must compile them with each executable because they |
| 644 | # are only referenced by the rest of the code using constructor functions. |
| 645 | # If their object files are put in a static library, these are never compiled |
| 646 | # into the final linked executable that uses them. |
| 647 | # |
| 648 | # Normally, one would solve thus using LOCAL_WHOLE_STATIC_LIBRARIES, but |
| 649 | # the Darwin linker doesn't support -Wl,--whole-archive or equivalent :-( |
| 650 | # |
| 651 | BLOCK_SOURCES += \ |
| 652 | block.c \ |
| 653 | blockdev.c \ |
| 654 | block/qcow.c \ |
| 655 | block/qcow2.c \ |
| 656 | block/qcow2-refcount.c \ |
| 657 | block/qcow2-snapshot.c \ |
| 658 | block/qcow2-cluster.c \ |
| 659 | block/cloop.c \ |
| 660 | block/dmg.c \ |
| 661 | block/vvfat.c \ |
| 662 | block/raw.c |
| 663 | |
| 664 | ifeq ($(HOST_OS),windows) |
| 665 | BLOCK_SOURCES += block/raw-win32.c |
| 666 | else |
| 667 | BLOCK_SOURCES += block/raw-posix.c |
| 668 | endif |
| 669 | |
| 670 | BLOCK_CFLAGS += $(EMULATOR_COMMON_CFLAGS) |
| 671 | BLOCK_CFLAGS += -DCONFIG_BDRV_WHITELIST="" |
| 672 | |
| 673 | |
| 674 | ############################################################################## |
| 675 | ############################################################################## |
| 676 | ### |
| 677 | ### emulator-libelff: TARGET-INDEPENDENT ELF/DWARD PARSER |
| 678 | ### |
| 679 | ### THESE ARE USED BY EVERYTHING EXCEPT 'emulator-ui', BUT WE CANNOT PUT |
| 680 | ### THEM IN emulator-libqemu SINCE THE SOURCES ARE C++ |
| 681 | ### |
| 682 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 683 | common_LOCAL_CFLAGS = |
| 684 | common_LOCAL_SRC_FILES = |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 685 | |
| 686 | ELFF_CFLAGS := -I$(LOCAL_PATH)/elff |
| 687 | ELFF_LDLIBS := -lstdc++ |
| 688 | |
| 689 | ELFF_SOURCES := \ |
| 690 | dwarf_cu.cc \ |
| 691 | dwarf_die.cc \ |
| 692 | dwarf_utils.cc \ |
| 693 | elf_alloc.cc \ |
| 694 | elf_file.cc \ |
| 695 | elf_mapped_section.cc \ |
| 696 | elff_api.cc \ |
| 697 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 698 | common_LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 699 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 700 | common_LOCAL_CFLAGS += \ |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 701 | -fno-exceptions \ |
| 702 | $(ELFF_CFLAGS) \ |
| 703 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 704 | |
| 705 | ## one for 32-bit |
| 706 | $(call start-emulator-library, emulator-libelff) |
| 707 | LOCAL_CPP_EXTENSION := .cc |
| 708 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) |
| 709 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 710 | $(call end-emulator-library) |
| 711 | |
| 712 | |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 713 | ## another for 64-bit, see note in emulator64-common |
Andrew Hsieh | d0f2ab6 | 2012-03-23 17:35:11 +0800 | [diff] [blame] | 714 | ifeq ($(HOST_OS),linux) |
Andrew Hsieh | c7389bd | 2012-03-13 02:13:40 -0700 | [diff] [blame] | 715 | ifneq ($(BUILD_STANDALONE_EMULATOR),true) |
| 716 | $(call start-emulator-library, emulator64-libelff) |
| 717 | LOCAL_CPP_EXTENSION := .cc |
| 718 | LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64 |
| 719 | LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES) |
| 720 | $(call end-emulator-library) |
| 721 | endif # BUILD_STANDALONE_EMULATOR == nil |
| 722 | endif # HOST_OS == linux |
| 723 | |
| 724 | |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 725 | ############################################################################## |
| 726 | ############################################################################## |
| 727 | ### |
| 728 | ### gen-hx-header: Generate headers from .hx file with "hxtool" script. |
| 729 | ### |
| 730 | ### The 'hxtool' script is used to generate header files from an input |
| 731 | ### file with the .hx suffix. I.e. foo.hx --> foo.h |
| 732 | ### |
| 733 | ### Due to the way the Android build system works, we need to regenerate |
| 734 | ### it for each module (the output will go into a module-specific directory). |
| 735 | ### |
| 736 | ### This defines a function that can be used inside a module definition |
| 737 | ### |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 738 | ### $(call gen-hx-header,<input>,<output>,<source-files>) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 739 | ### |
| 740 | ### Where: <input> is the input file, with a .hx suffix (e.g. foo.hx) |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 741 | ### <output> is the output file, with a .h or .def suffix |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 742 | ### <source-files> is a list of source files that include the header |
| 743 | ### |
| 744 | |
| 745 | |
| 746 | gen-hx-header = $(eval $(call gen-hx-header-ev,$1,$2,$3)) |
| 747 | |
| 748 | define gen-hx-header-ev |
David 'Digit' Turner | 42fc449 | 2011-06-29 13:16:16 +0200 | [diff] [blame] | 749 | intermediates := $$(call intermediates-dir-for,$$(LOCAL_MODULE_CLASS),$$(LOCAL_MODULE),true) |
David 'Digit' Turner | 317c9d5 | 2011-05-10 06:38:21 +0200 | [diff] [blame] | 750 | |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 751 | QEMU_HEADER_H := $$(intermediates)/$$2 |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 752 | $$(QEMU_HEADER_H): PRIVATE_PATH := $$(LOCAL_PATH) |
| 753 | $$(QEMU_HEADER_H): PRIVATE_CUSTOM_TOOL = $$(PRIVATE_PATH)/hxtool -h < $$< > $$@ |
| 754 | $$(QEMU_HEADER_H): $$(LOCAL_PATH)/$$1 $$(LOCAL_PATH)/hxtool |
| 755 | $$(transform-generated-source) |
| 756 | |
| 757 | LOCAL_GENERATED_SOURCES += $$(QEMU_HEADER_H) |
David 'Digit' Turner | 088edf8 | 2011-05-09 15:59:28 +0200 | [diff] [blame] | 758 | LOCAL_C_INCLUDES += $$(intermediates) |
David 'Digit' Turner | aff94b8 | 2011-02-07 18:10:54 +0100 | [diff] [blame] | 759 | endef |
| 760 | |