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