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