ifeq ($(TARGET_ARCH),arm) LOCAL_PATH:= $(call my-dir) # determine the location of platform-specific directories # CONFIG_DIRS := \ $(LOCAL_PATH)/android/config \ $(LOCAL_PATH)/android/config/$(HOST_PREBUILT_TAG) CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%) MY_CC := $(HOST_CC) MY_OPTIM := -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer ifeq ($(BUILD_DEBUG_EMULATOR),true) MY_OPTIM := -O0 -g endif MY_CFLAGS := $(CONFIG_INCLUDES) $(MY_OPTIM) # Overwrite configuration for debug builds. # ifeq ($(BUILD_DEBUG_EMULATOR),true) MY_CFLAGS := $(CONFIG_INCLUDES) -O0 -g \ -fno-PIC -falign-functions=0 endif MY_CFLAGS += -DCONFIG_MEMCHECK MY_LDLIBS := # this is needed to build the emulator on 64-bit Linux systems ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) MY_CFLAGS += -Wa,--32 endif ifeq ($(HOST_OS),freebsd) MY_CFLAGS += -Wa,--32 -I /usr/local/include endif ifeq ($(HOST_OS),windows) MY_CFLAGS += -D_WIN32 -mno-cygwin # we need Win32 features that are available since Windows 2000 Professional/Server (NT 5.0) MY_CFLAGS += -DWINVER=0x501 endif ifeq ($(HOST_ARCH),ppc) MY_CFLAGS += -D__powerpc__ endif ifeq ($(HOST_OS),darwin) MY_CFLAGS += -mdynamic-no-pic -fno-exceptions # When building on Leopard or above, we need to use the 10.4 SDK # or the generated binary will not run on Tiger. DARWIN_VERSION := $(strip $(shell sw_vers -productVersion)) ifneq ($(filter 10.1 10.2 10.3 10.1.% 10.2.% 10.3.%,$(DARWIN_VERSION)),) $(error Building the Android emulator requires OS X 10.4 or above) endif ifeq ($(filter 10.4 10.4.%,$(DARWIN_VERSION)),) # We are on Leopard or above TIGER_SDK := /Developer/SDKs/MacOSX10.4u.sdk ifeq ($(strip $(wildcard $(TIGER_SDK))),) $(info Please install the 10.4 SDK on this machine at $(TIGER_SDK)) $(error Aborting the build.) endif MY_CFLAGS += -isysroot $(TIGER_SDK) -mmacosx-version-min=10.4 -DMACOSX_DEPLOYMENT_TARGET=10.4 MY_LDLIBS += -isysroot $(TIGER_SDK) -Wl,-syslibroot,$(TIGER_SDK) -mmacosx-version-min=10.4 # Beginning with Snow Leopard, the default compiler is GCC 4.2 # which is incompatible with the 10.4 SDK, so we must # specify the use of GCC 4.0. ifeq ($(filter 10.5 10.5.%,$(DARWIN_VERSION)),) # We are on Snow Leopard or above MY_CC := gcc-4.0 endif endif endif # BUILD_STANDALONE_EMULATOR is only defined when building with # the android-rebuild.sh script. The script will also provide # adequate values for HOST_CC # ifneq ($(BUILD_STANDALONE_EMULATOR),true) ifneq ($(USE_CCACHE),) MY_CC := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache $(MY_CC) endif endif ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true) ifneq ($(HOST_ARCH),x86_64) MY_CFLAGS += -m32 MY_LDLIBS += -m32 endif endif include $(CLEAR_VARS) ########################################################### # Zlib configuration # ZLIB_DIR := distrib/zlib-1.2.3 include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make ########################################################### # Libpng configuration # LIBPNG_DIR := distrib/libpng-1.2.19 include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make ############################################################################### # build the TCG code generator # include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) LOCAL_LDLIBS := $(MY_LDLIBS) LOCAL_MODULE := emulator-tcg TCG_TARGET := $(HOST_ARCH) ifeq ($(TCG_TARGET),x86) TCG_TARGET := i386 endif TCG_CFLAGS := -I$(LOCAL_PATH)/tcg -I$(LOCAL_PATH)/tcg/$(TCG_TARGET) LOCAL_CFLAGS += $(TCG_CFLAGS) \ -I$(LOCAL_PATH)/target-arm \ -I$(LOCAL_PATH)/fpu \ LOCAL_SRC_FILES := \ tcg/tcg.c \ include $(BUILD_HOST_STATIC_LIBRARY) ############################################################################## # build the HW emulation support # include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := emulator-hw HW_CFLAGS := -I$(LOCAL_PATH)/hw LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(HW_CFLAGS) LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) HW_SOURCES := \ android_arm.c \ arm_pic.c \ bt.c \ bt-hci.c \ bt-hid.c \ bt-l2cap.c \ bt-sdp.c \ cdrom.c \ dma.c \ irq.c \ goldfish_audio.c \ goldfish_battery.c \ goldfish_device.c \ goldfish_events_device.c \ goldfish_fb.c \ goldfish_interrupt.c \ goldfish_memlog.c \ goldfish_mmc.c \ goldfish_nand.c \ goldfish_switch.c \ goldfish_timer.c \ goldfish_trace.c \ goldfish_tty.c \ msmouse.c \ pci.c \ qdev.c \ scsi-disk.c \ smc91c111.c \ sysbus.c \ usb-hid.c \ usb-hub.c \ usb-msd.c \ usb-ohci.c \ usb.c \ watchdog.c \ LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%) include $(BUILD_HOST_STATIC_LIBRARY) ############################################################################## # build the ELF/DWARF stuff # This library is used by emulator's memory checker to extract debug information # from the symbol files when reporting memory allocation violations. In # particular, this library is used to extract routine name and source file # location for the code address where violation has been detected. # include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := emulator-elff LOCAL_CPP_EXTENSION := .cc ELFF_CFLAGS := -I$(LOCAL_PATH)/elff LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(ELFF_CFLAGS) LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) ELFF_SOURCES := \ dwarf_cu.cc \ dwarf_die.cc \ dwarf_utils.cc \ elf_alloc.cc \ elf_file.cc \ elf_mapped_section.cc \ elff_api.cc \ LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%) ELFF_LDLIBS := -lstdc++ include $(BUILD_HOST_STATIC_LIBRARY) ############################################################################## # build the memory access checking support # Memory access checker uses information collected by instrumented code in # libc.so in order to keep track of memory blocks allocated from heap. Memory # checker then uses this information to make sure that every access to allocated # memory is within allocated block. This information also allows detecting # memory leaks and attempts to free/realloc invalid pointers. # include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := emulator-memcheck MCHK_CFLAGS := -I$(LOCAL_PATH)/memcheck -I$(LOCAL_PATH)/elff LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(MCHK_CFLAGS) LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) MCHK_SOURCES := \ memcheck.c \ memcheck_proc_management.c \ memcheck_malloc_map.c \ memcheck_mmrange_map.c \ memcheck_util.c \ LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%) include $(BUILD_HOST_STATIC_LIBRARY) ############################################################################## # build the ARM-specific emulation engine sources # include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := emulator-arm LOCAL_LDLIBS := $(MY_LDLIBS) LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) LOCAL_STATIC_LIBRARIES := emulator-hw LOCAL_CFLAGS := -fno-PIC -fomit-frame-pointer -Wno-sign-compare LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) LOCAL_CFLAGS += -I$(LOCAL_PATH) \ -I$(LOCAL_PATH)/target-arm \ -I$(LOCAL_PATH)/fpu \ $(TCG_CFLAGS) \ $(HW_CFLAGS) \ ifeq ($(HOST_ARCH),ppc) LOCAL_CFLAGS += -D__powerpc__ endif LOCAL_SRC_FILES += exec.c cpu-exec.c \ target-arm/op_helper.c \ target-arm/iwmmxt_helper.c \ target-arm/neon_helper.c \ target-arm/helper.c \ target-arm/translate.c \ target-arm/machine.c \ translate-all.c \ hw/armv7m.c \ hw/armv7m_nvic.c \ arm-semi.c \ trace.c \ varint.c \ dcache.c \ softmmu_outside_jit.c \ LOCAL_SRC_FILES += fpu/softfloat.c include $(BUILD_HOST_STATIC_LIBRARY) ############################################################################## # SDL-related definitions # SDL_CONFIG ?= prebuilt/$(HOST_PREBUILT_TAG)/sdl/bin/sdl-config SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) # We need to filter out the _GNU_SOURCE variable because it breaks recent # releases of Cygwin when using the -mno-cygwin option. Moreover, we don't # need this macro at all to build the Android emulator. SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS)) SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs)) ############################################################################## # determine audio sources, build the prebuilt audio-library if needed # # determine AUDIO sources based on current configuration # AUDIO_SOURCES := audio.c noaudio.c wavaudio.c wavcapture.c mixeng.c AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO AUDIO_LDLIBS := ifeq ($(HOST_OS),darwin) CONFIG_COREAUDIO ?= yes AUDIO_CFLAGS += -DHOST_BSD=1 endif ifeq ($(HOST_OS),windows) CONFIG_WINAUDIO ?= yes endif ifeq ($(HOST_OS),linux) CONFIG_OSS ?= yes CONFIG_ALSA ?= yes CONFIG_ESD ?= yes endif ifeq ($(HOST_OS),freebsd) CONFIG_OSS ?= yes endif ifeq ($(CONFIG_COREAUDIO),yes) AUDIO_SOURCES += coreaudio.c AUDIO_CFLAGS += -DCONFIG_COREAUDIO AUDIO_LDLIBS += -Wl,-framework,CoreAudio endif ifeq ($(CONFIG_WINAUDIO),yes) AUDIO_SOURCES += winaudio.c AUDIO_CFLAGS += -DCONFIG_WINAUDIO endif ifeq ($(CONFIG_ALSA),yes) AUDIO_SOURCES += alsaaudio.c audio_pt_int.c AUDIO_CFLAGS += -DCONFIG_ALSA endif ifeq ($(CONFIG_ESD),yes) AUDIO_SOURCES += esdaudio.c AUDIO_CFLAGS += -DCONFIG_ESD endif ifeq ($(CONFIG_OSS),yes) AUDIO_SOURCES += ossaudio.c AUDIO_CFLAGS += -DCONFIG_OSS endif AUDIO_SOURCES := $(AUDIO_SOURCES:%=audio/%) # determine whether we're going to use the prebuilt # audio library (this is useful on Linux to avoid requiring # all sound-related development packages to be installed on # the build and developer machines). # # note that you can define BUILD_QEMU_AUDIO_LIB to true # in your environment to force recompilation. # QEMU_AUDIO_LIB := ifneq ($(BUILD_STANDALONE_EMULATOR),true) QEMU_AUDIO_LIB := $(wildcard \ prebuilt/$(HOST_PREBUILT_TAG)/emulator/libqemu-audio.a) endif ifeq ($(BUILD_QEMU_AUDIO_LIB),true) include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := libqemu-audio LOCAL_LDLIBS := $(MY_LDLIBS) LOCAL_CFLAGS := -Wno-sign-compare \ -fno-strict-aliasing -W -Wall -Wno-unused-parameter \ -I$(LOCAL_PATH) \ -I$(LOCAL_PATH)/target-arm \ -I$(LOCAL_PATH)/fpu \ # this is very important, otherwise the generated binaries may # not link properly on our build servers ifeq ($(HOST_OS),linux) LOCAL_CFLAGS += -fno-stack-protector endif LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(AUDIO_CFLAGS) LOCAL_CFLAGS += $(SDL_CFLAGS) LOCAL_SRC_FILES += $(AUDIO_SOURCES) include $(BUILD_HOST_STATIC_LIBRARY) QEMU_AUDIO_LIB := $(LOCAL_BUILT_MODULE) endif # !QEMU_AUDIO_LIB ############################################################################## # now build the emulator itself # include $(CLEAR_VARS) LOCAL_NO_DEFAULT_COMPILER_FLAGS := true LOCAL_CC := $(MY_CC) LOCAL_MODULE := emulator LOCAL_STATIC_LIBRARIES := emulator-memcheck emulator-hw emulator-arm emulator-tcg LOCAL_STATIC_LIBRARIES += emulator-elff LOCAL_LDLIBS := $(MY_LDLIBS) # don't remove the -fno-strict-aliasing, or you'll break things # (e.g. slirp-android/network support) # LOCAL_CFLAGS := -fno-PIC -Wno-sign-compare \ -fno-strict-aliasing -g -W -Wall -Wno-unused-parameter LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) # add the build ID to the default macro definitions LOCAL_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))" # For non-standalone builds, extract the major version number from the Android SDK # tools revision number. ifneq ($(BUILD_STANDALONE_EMULATOR),true) ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties) endif ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION)) ifdef ANDROID_SDK_TOOLS_REVISION LOCAL_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION) endif # include the Zlib sources # LOCAL_SRC_FILES += $(ZLIB_SOURCES) LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR) # include the Libpng sources # LOCAL_SRC_FILES += $(LIBPNG_SOURCES) LOCAL_CFLAGS += $(LIBPNG_CFLAGS) -I$(LOCAL_PATH)/$(LIBPNG_DIR) LOCAL_CFLAGS += -I$(LOCAL_PATH)/ \ -I$(LOCAL_PATH)/target-arm \ -I$(LOCAL_PATH)/fpu \ $(TCG_CFLAGS) \ $(HW_CFLAGS) \ # Needed by the upstream code LOCAL_CFLAGS += -DNEED_CPU_H # include telephony stuff # TELEPHONY_SOURCES := android_modem.c modem_driver.c gsm.c sim_card.c sysdeps_qemu.c sms.c remote_call.c LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%) LOCAL_CFLAGS += -I$(LOCAL_PATH)/telephony # include sound support source files. we first try to see if we have a prebuilt audio # library. if not, we build things the "hard" way. # # note that to generate the prebuilt audio library, you should do the following: # # cd tools/qemu # ./android-rebuild.sh # distrib/update-audio.sh # ifeq ($(QEMU_AUDIO_LIB),) LOCAL_SRC_FILES += $(AUDIO_SOURCES) endif # !QEMU_AUDIO_LIB LOCAL_CFLAGS += $(AUDIO_CFLAGS) LOCAL_LDLIBS += $(AUDIO_LDLIBS) # include slirp-android code, i.e. the user-level networking stuff # SLIRP_SOURCES := bootp.c cksum.c debug.c if.c ip_icmp.c ip_input.c ip_output.c \ mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c tcp_output.c \ tcp_subr.c tcp_timer.c tftp.c udp.c LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%) LOCAL_CFLAGS += -I$(LOCAL_PATH)/slirp-android # socket proxy support # PROXY_SOURCES := \ proxy_common.c \ proxy_http.c \ proxy_http_connector.c \ proxy_http_rewriter.c \ LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%) LOCAL_CFLAGS += -I$(LOCAL_PATH)/proxy # the linux-user sources, I doubt we really need these # #LINUX_SOURCES := main.c elfload.c mmap.c signal.c path.c syscall.c #LOCAL_SRC_FILES += $(LINUX_SOURCES:%=linux-user/%) # the skin support sources # SKIN_SOURCES := rect.c \ region.c \ image.c \ trackball.c \ keyboard.c \ keyset.c \ file.c \ window.c \ scaler.c \ composer.c \ surface.c \ LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%) #LOCAL_CFLAGS += -I$(LOCAL_PATH)/skin ifeq ($(HOST_ARCH),x86) # enable MMX code for our skin scaler LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx endif # include other sources # VL_SOURCES := vl-android.c osdep.c cutils.c \ block.c readline.c monitor.c console.c loader.c sockets.c \ aes.c d3des.c \ block/qcow.c \ block/qcow2.c \ block/qcow2-refcount.c \ block/qcow2-snapshot.c \ block/qcow2-cluster.c \ block/cloop.c \ block/dmg.c \ block/vvfat.c \ buffered_file.c \ cbuffer.c \ gdbstub.c \ vnc-android.c disas.c arm-dis.c \ shaper.c charpipe.c loadpng.c \ framebuffer.c \ tcpdump.c \ qemu-char-android.c \ qemu-malloc.c \ qemu-option.c \ savevm.c \ net-android.c \ acl.c \ aio-android.c \ dma-helpers.c \ qemu-sockets-android.c \ keymaps.c \ bt-host.c \ bt-vhci.c \ module.c \ android/boot-properties.c \ android/charmap.c \ android/cmdline-option.c \ android/config.c \ android/console.c \ android/gps.c \ android/help.c \ android/hw-control.c \ android/hw-events.c \ android/hw-kmsg.c \ android/hw-lcd.c \ android/hw-qemud.c \ android/hw-sensors.c \ android/keycode.c \ android/main.c \ android/resource.c \ android/user-config.c \ android/utils/bufprint.c \ android/utils/debug.c \ android/utils/dirscanner.c \ android/utils/ini.c \ android/utils/filelock.c \ android/utils/misc.c \ android/utils/path.c \ android/utils/reflist.c \ android/utils/stralloc.c \ android/utils/system.c \ android/utils/tempfile.c \ android/utils/timezone.c \ android/utils/mapfile.c \ android/avd/hw-config.c \ android/avd/info.c \ VL_SOURCES += hw/arm_boot.c \ hw/android_arm.c \ ifeq ($(HOST_OS),windows) VL_SOURCES += block/raw-win32.c \ migration-dummy-android.c \ iolooper-select.c else VL_SOURCES += block/raw-posix.c \ migration.c \ migration-exec.c \ migration-tcp-android.c \ iolooper-select.c endif ifeq ($(HOST_OS),linux) VL_SOURCES += usb-linux.c \ qemu-thread.c else VL_SOURCES += usb-dummy-android.c endif ifeq ($(HOST_ARCH),x86) VL_SOURCES += i386-dis.c endif ifeq ($(HOST_ARCH),x86_64) VL_SOURCES += i386-dis.c endif ifeq ($(HOST_ARCH),ppc) VL_SOURCES += ppc-dis.c endif ifeq ($(HOST_OS),windows) VL_SOURCES += tap-win32.c LOCAL_LDLIBS += -mno-cygwin -mwindows -mconsole endif ifeq ($(HOST_OS),freebsd) LOCAL_LDLIBS += -L/usr/local/lib -lpthread -lX11 -lutil endif LOCAL_SRC_FILES += $(VL_SOURCES) ifeq ($(HOST_OS),linux) LOCAL_LDLIBS += -lutil -lrt endif # add SDL-specific flags # LOCAL_CFLAGS += $(SDL_CFLAGS) LOCAL_LDLIBS += $(SDL_LDLIBS) # Circular dependencies between libSDL and libSDLmain; # We repeat the libraries in the final link to work around it. LOCAL_STATIC_LIBRARIES += libSDL libSDLmain LOCAL_STATIC_LIBRARIES += libSDL libSDLmain # add ELFF-specific flags # LOCAL_LDLIBS += $(ELFF_LDLIBS) # on Windows, link the icon file as well into the executable # unfortunately, our build system doesn't help us much, so we need # to use some weird pathnames to make this work... # ifeq ($(HOST_OS),windows) # Locate windres executable WINDRES := windres ifneq ($(USE_MINGW),) # When building the Windows emulator under Linux, use the MinGW one WINDRES := i586-mingw32msvc-windres endif INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) ANDROID_ICON_OBJ := android_icon.o ANDROID_ICON_PATH := $(LOCAL_PATH)/images $(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@ # seems to be the only way to add an object file that was not generated from # a C/C++/Java source file to our build system. and very unfortunately, # $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces # us to put the object file in the source directory... # LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ) endif # qemu-options.h is generated from qemu-options.hx with the "hxtool" shell script # intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) QEMU_OPTIONS_H := $(intermediates)/qemu-options.h $(QEMU_OPTIONS_H): PRIVATE_PATH := $(LOCAL_PATH) $(QEMU_OPTIONS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ $(QEMU_OPTIONS_H): $(LOCAL_PATH)/qemu-options.hx $(LOCAL_PATH)/hxtool $(transform-generated-source) $(intermediates)/vl-android.o: $(QEMU_OPTIONS_H) LOCAL_GENERATED_SOURCES += $(QEMU_OPTIONS_H) # qemu-monitor.h is generated from qemu-monitor.hx with the "hxtool" shell script # intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true) QEMU_MONITOR_H := $(intermediates)/qemu-monitor.h $(QEMU_MONITOR_H): PRIVATE_PATH := $(LOCAL_PATH) $(QEMU_MONITOR_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@ $(QEMU_MONITOR_H): $(LOCAL_PATH)/qemu-monitor.hx $(LOCAL_PATH)/hxtool $(transform-generated-source) $(intermediates)/vl-android.o: $(QEMU_MONITOR_H) LOCAL_GENERATED_SOURCES += $(QEMU_MONITOR_H) # gdbstub-xml.c contains C-compilable arrays corresponding to the content # of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script. # ifeq ($(QEMU_TARGET_XML_SOURCES),) QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3 QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml) endif QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c $(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH) $(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES) $(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES) $(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh $(hide) rm -f $@ $(transform-generated-source) $(intermediates)/vl-android.o: $(QEMU_GDBSTUB_XML_C) LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C) # hw-config-defs.h is generated from android/avd/hardware-properties.ini # QEMU_HARDWARE_PROPERTIES_INI := $(LOCAL_PATH)/android/avd/hardware-properties.ini QEMU_HW_CONFIG_DEFS_H := $(LOCAL_PATH)/android/avd/hw-config-defs.h $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_PATH := $(LOCAL_PATH) $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_SOURCES := $(QEMU_HARDWARE_PROPERTIES_INI) $(QEMU_HW_CONFIG_DEFS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/android/tools/gen-hw-config.py $(QEMU_HARDWARE_PROPERTIES_INI) $@ $(QEMU_HW_CONFIG_DEFS_H): $(QEMU_HARDWARE_PROPERTIES_INI) $(LOCAL_PATH)/android/tools/gen-hw-config.py $(hide) rm -f $@ $(transform-generated-source) $(LOCAL_PATH)/android/avd/hw-config.h: $(QEMU_HW_CONFIG_DEFS_H) LOCAL_GENERATED_SOURCES += $(QEMU_HW_CONFIG_DEFS_H) # this is already done by the Android build system, but is done for the # benefit of the stand-alone one. # ifeq ($(BUILD_STANDALONE_EMULATOR),true) LOCAL_CFLAGS += -I$(intermediates) endif # other flags LOCAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LOCAL_LDLIBS += -lm ifeq ($(HOST_OS),windows) LOCAL_LDLIBS += -lwinmm -lws2_32 -liphlpapi else LOCAL_LDLIBS += -lpthread endif LOCAL_LDLIBS += $(QEMU_AUDIO_LIB) # Generate a completely static executable if needed. # Note that this means no sound and graphics on Linux. # ifeq ($(CONFIG_STATIC_EXECUTABLE),true) LOCAL_SRC_FILES += dynlink-static.c LOCAL_LDLIBS += -static endif LOCAL_MODULE := emulator include $(BUILD_HOST_EXECUTABLE) endif # TARGET_ARCH == arm