blob: 01e7de34ffd53fe649934845288475dc355e7cbf [file] [log] [blame]
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -08001ifeq ($(TARGET_ARCH),arm)
2LOCAL_PATH:= $(call my-dir)
3
David 'Digit' Turner34d16512010-05-18 17:02:33 -07004# determine the host tag to use
5QEMU_HOST_TAG := $(HOST_PREBUILT_TAG)
6ifneq ($(USE_MINGW),)
7 QEMU_HOST_TAG := windows
8endif
9
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080010# determine the location of platform-specific directories
11#
12CONFIG_DIRS := \
13 $(LOCAL_PATH)/android/config \
David 'Digit' Turner34d16512010-05-18 17:02:33 -070014 $(LOCAL_PATH)/android/config/$(QEMU_HOST_TAG)
15
16ifeq ($(BUILD_STANDALONE_EMULATOR),true)
17 CONFIG_DIRS := $(LOCAL_PATH)/objs $(CONFIG_DIRS)
18endif
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080019
20CONFIG_INCLUDES := $(CONFIG_DIRS:%=-I%)
21
Kenny Root095cd0f2009-09-19 18:32:44 -050022MY_CC := $(HOST_CC)
23
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -070024MY_OPTIM := -O2 -g -fno-PIC -falign-functions=0 -fomit-frame-pointer
25ifeq ($(BUILD_DEBUG_EMULATOR),true)
26 MY_OPTIM := -O0 -g
27endif
28
David 'Digit' Turner9a0f1fb2010-02-25 14:22:29 -080029MY_CFLAGS := $(CONFIG_INCLUDES) $(MY_OPTIM)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080030
David 'Digit' Turner466f5482009-07-30 15:50:19 +020031# Overwrite configuration for debug builds.
32#
33ifeq ($(BUILD_DEBUG_EMULATOR),true)
34 MY_CFLAGS := $(CONFIG_INCLUDES) -O0 -g \
35 -fno-PIC -falign-functions=0
36endif
37
David 'Digit' Turner9a0f1fb2010-02-25 14:22:29 -080038MY_CFLAGS += -DCONFIG_MEMCHECK
39
David 'Digit' Turnerb95f8922009-08-21 23:10:16 -070040MY_LDLIBS :=
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080041
42# this is needed to build the emulator on 64-bit Linux systems
43ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
44 MY_CFLAGS += -Wa,--32
45endif
46
47ifeq ($(HOST_OS),freebsd)
48 MY_CFLAGS += -Wa,--32 -I /usr/local/include
49endif
50
51ifeq ($(HOST_OS),windows)
52 MY_CFLAGS += -D_WIN32 -mno-cygwin
53 # we need Win32 features that are available since Windows 2000 Professional/Server (NT 5.0)
54 MY_CFLAGS += -DWINVER=0x501
55endif
56
57ifeq ($(HOST_ARCH),ppc)
58 MY_CFLAGS += -D__powerpc__
59endif
60
61ifeq ($(HOST_OS),darwin)
David 'Digit' Turner2910f182010-05-10 18:48:35 -070062 MY_CFLAGS += -mdynamic-no-pic
David Turnerbba461c2009-06-03 10:48:15 -070063
64 # When building on Leopard or above, we need to use the 10.4 SDK
65 # or the generated binary will not run on Tiger.
66 DARWIN_VERSION := $(strip $(shell sw_vers -productVersion))
Jeff Hamiltond0d97342010-05-27 11:41:41 -050067 ifneq ($(filter 10.1 10.2 10.3 10.1.% 10.2.% 10.3.% 10.4 10.4.%,$(DARWIN_VERSION)),)
68 $(error Building the Android emulator requires OS X 10.5 or above)
David Turnerbba461c2009-06-03 10:48:15 -070069 endif
Jeff Hamiltond0d97342010-05-27 11:41:41 -050070 ifeq ($(filter 10.5 10.5.%,$(DARWIN_VERSION)),)
71 # We are on Snow Leopard or above
72 LEOPARD_SDK := /Developer/SDKs/MacOSX10.5.sdk
73 ifeq ($(strip $(wildcard $(LEOPARD_SDK))),)
74 $(info Please install the 10.5 SDK on this machine at $(LEOPARD_SDK))
David Turnerbba461c2009-06-03 10:48:15 -070075 $(error Aborting the build.)
76 endif
Jeff Hamiltond0d97342010-05-27 11:41:41 -050077 MY_CFLAGS += -isysroot $(LEOPARD_SDK) -mmacosx-version-min=10.5 -DMACOSX_DEPLOYMENT_TARGET=10.5
78 MY_LDLIBS += -isysroot $(LEOPARD_SDK) -Wl,-syslibroot,$(LEOPARD_SDK) -mmacosx-version-min=10.5
David Turnerbba461c2009-06-03 10:48:15 -070079 endif
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080080endif
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080081
82# BUILD_STANDALONE_EMULATOR is only defined when building with
83# the android-rebuild.sh script. The script will also provide
84# adequate values for HOST_CC
85#
86ifneq ($(BUILD_STANDALONE_EMULATOR),true)
87
88 ifneq ($(USE_CCACHE),)
89 MY_CC := prebuilt/$(HOST_PREBUILT_TAG)/ccache/ccache $(MY_CC)
90 endif
91endif
92
93
94ifneq ($(combo_target)$(TARGET_SIMULATOR),HOST_true)
95 ifneq ($(HOST_ARCH),x86_64)
David 'Digit' Turnerb95f8922009-08-21 23:10:16 -070096 MY_CFLAGS += -m32
97 MY_LDLIBS += -m32
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -080098 endif
99endif
100
101include $(CLEAR_VARS)
102
103###########################################################
104# Zlib configuration
105#
106ZLIB_DIR := distrib/zlib-1.2.3
107include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make
108
109###########################################################
110# Libpng configuration
111#
112LIBPNG_DIR := distrib/libpng-1.2.19
113include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make
114
115###############################################################################
116# build the TCG code generator
117#
118include $(CLEAR_VARS)
119
120LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
121LOCAL_CC := $(MY_CC)
122LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS)
David 'Digit' Turnerb95f8922009-08-21 23:10:16 -0700123LOCAL_LDLIBS := $(MY_LDLIBS)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800124LOCAL_MODULE := emulator-tcg
125
126TCG_TARGET := $(HOST_ARCH)
127ifeq ($(TCG_TARGET),x86)
128 TCG_TARGET := i386
129endif
130
131TCG_CFLAGS := -I$(LOCAL_PATH)/tcg -I$(LOCAL_PATH)/tcg/$(TCG_TARGET)
132
133LOCAL_CFLAGS += $(TCG_CFLAGS) \
134 -I$(LOCAL_PATH)/target-arm \
135 -I$(LOCAL_PATH)/fpu \
136
137LOCAL_SRC_FILES := \
138 tcg/tcg.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800139
140include $(BUILD_HOST_STATIC_LIBRARY)
141
142##############################################################################
143# build the HW emulation support
144#
145include $(CLEAR_VARS)
146
147LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
148LOCAL_CC := $(MY_CC)
Jeff Hamiltond0d97342010-05-27 11:41:41 -0500149LOCAL_LDLIBS := $(MY_LDLIBS)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800150LOCAL_MODULE := emulator-hw
151
152HW_CFLAGS := -I$(LOCAL_PATH)/hw
153
154LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS)
155LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(HW_CFLAGS)
156LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR)
157
158HW_SOURCES := \
159 android_arm.c \
Vladimir Chtchetkine45d6d6d2010-06-14 15:26:05 -0700160 arm_boot.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800161 arm_pic.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700162 bt.c \
163 bt-hci.c \
164 bt-hid.c \
165 bt-l2cap.c \
166 bt-sdp.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800167 cdrom.c \
168 dma.c \
169 irq.c \
170 goldfish_audio.c \
171 goldfish_battery.c \
172 goldfish_device.c \
173 goldfish_events_device.c \
174 goldfish_fb.c \
175 goldfish_interrupt.c \
176 goldfish_memlog.c \
177 goldfish_mmc.c \
178 goldfish_nand.c \
179 goldfish_switch.c \
180 goldfish_timer.c \
181 goldfish_trace.c \
182 goldfish_tty.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700183 msmouse.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800184 pci.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700185 qdev.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800186 scsi-disk.c \
187 smc91c111.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700188 sysbus.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800189 usb-hid.c \
190 usb-hub.c \
191 usb-msd.c \
192 usb-ohci.c \
193 usb.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700194 watchdog.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800195
196LOCAL_SRC_FILES += $(HW_SOURCES:%=hw/%)
197
198include $(BUILD_HOST_STATIC_LIBRARY)
199
200##############################################################################
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800201# build the ELF/DWARF stuff
202# This library is used by emulator's memory checker to extract debug information
203# from the symbol files when reporting memory allocation violations. In
204# particular, this library is used to extract routine name and source file
205# location for the code address where violation has been detected.
206#
207include $(CLEAR_VARS)
208
209LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
210LOCAL_CC := $(MY_CC)
Jeff Hamiltond0d97342010-05-27 11:41:41 -0500211LOCAL_LDLIBS := $(MY_LDLIBS)
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800212LOCAL_MODULE := emulator-elff
213LOCAL_CPP_EXTENSION := .cc
214
215ELFF_CFLAGS := -I$(LOCAL_PATH)/elff
216
David 'Digit' Turner3d66dc72010-01-27 18:18:41 -0800217LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) -fno-exceptions
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800218LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(ELFF_CFLAGS)
219LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR)
220
221ELFF_SOURCES := \
222 dwarf_cu.cc \
223 dwarf_die.cc \
224 dwarf_utils.cc \
225 elf_alloc.cc \
226 elf_file.cc \
227 elf_mapped_section.cc \
228 elff_api.cc \
229
230LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%)
231ELFF_LDLIBS := -lstdc++
232
233include $(BUILD_HOST_STATIC_LIBRARY)
234
235##############################################################################
236# build the memory access checking support
237# Memory access checker uses information collected by instrumented code in
238# libc.so in order to keep track of memory blocks allocated from heap. Memory
239# checker then uses this information to make sure that every access to allocated
240# memory is within allocated block. This information also allows detecting
241# memory leaks and attempts to free/realloc invalid pointers.
242#
243include $(CLEAR_VARS)
244
245LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
246LOCAL_CC := $(MY_CC)
Jeff Hamiltond0d97342010-05-27 11:41:41 -0500247LOCAL_LDLIBS := $(MY_LDLIBS)
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800248LOCAL_MODULE := emulator-memcheck
249
250MCHK_CFLAGS := -I$(LOCAL_PATH)/memcheck -I$(LOCAL_PATH)/elff
251
252LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS)
253LOCAL_CFLAGS += -I$(LOCAL_PATH)/target-arm -I$(LOCAL_PATH)/fpu $(MCHK_CFLAGS)
254LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR)
255
256MCHK_SOURCES := \
257 memcheck.c \
258 memcheck_proc_management.c \
259 memcheck_malloc_map.c \
260 memcheck_mmrange_map.c \
261 memcheck_util.c \
262
263LOCAL_SRC_FILES += $(MCHK_SOURCES:%=memcheck/%)
264
265include $(BUILD_HOST_STATIC_LIBRARY)
266
267##############################################################################
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800268# build the ARM-specific emulation engine sources
269#
270include $(CLEAR_VARS)
271
272LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
273LOCAL_CC := $(MY_CC)
274LOCAL_MODULE := emulator-arm
David 'Digit' Turnerb95f8922009-08-21 23:10:16 -0700275LOCAL_LDLIBS := $(MY_LDLIBS)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800276LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS)
277LOCAL_STATIC_LIBRARIES := emulator-hw
278
279LOCAL_CFLAGS := -fno-PIC -fomit-frame-pointer -Wno-sign-compare
280LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS)
281
282LOCAL_CFLAGS += -I$(LOCAL_PATH) \
283 -I$(LOCAL_PATH)/target-arm \
284 -I$(LOCAL_PATH)/fpu \
285 $(TCG_CFLAGS) \
286 $(HW_CFLAGS) \
287
288ifeq ($(HOST_ARCH),ppc)
289 LOCAL_CFLAGS += -D__powerpc__
290endif
291
292LOCAL_SRC_FILES += exec.c cpu-exec.c \
293 target-arm/op_helper.c \
294 target-arm/iwmmxt_helper.c \
295 target-arm/neon_helper.c \
296 target-arm/helper.c \
297 target-arm/translate.c \
298 target-arm/machine.c \
299 translate-all.c \
300 hw/armv7m.c \
301 hw/armv7m_nvic.c \
302 arm-semi.c \
303 trace.c \
304 varint.c \
305 dcache.c \
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800306 softmmu_outside_jit.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800307
308LOCAL_SRC_FILES += fpu/softfloat.c
309
310include $(BUILD_HOST_STATIC_LIBRARY)
311
312##############################################################################
313# SDL-related definitions
314#
315
David 'Digit' Turner34d16512010-05-18 17:02:33 -0700316# Build SDL from sources except on linux-x86, to avoid installing all
317# the X11 development packages on our build servers.
318#
319BUILD_SDL_FROM_SOURCES := true
320ifeq ($(QEMU_HOST_TAG),linux-x86)
321 BUILD_SDL_FROM_SOURCES := false
322endif
David 'Digit' Turnerb74c48f2010-05-20 15:17:32 -0700323ifeq ($(QEMU_HOST_TAG),darwin-x86)
324 BUILD_SDL_FROM_SOURCES := false
325endif
David 'Digit' Turner34f29742010-05-25 18:16:10 -0700326ifeq ($(BUILD_STANDALONE_EMULATOR),true)
327 BUILD_SDL_FROM_SOURCES := true
328endif
329
David 'Digit' Turner34d16512010-05-18 17:02:33 -0700330ifneq ($(SDL_CONFIG),)
331 BUILD_SDL_FROM_SOURCES := false
332endif
333
334ifneq ($(BUILD_SDL_FROM_SOURCES),true)
335
336SDL_CONFIG ?= prebuilt/$(QEMU_HOST_TAG)/sdl/bin/sdl-config
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800337SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
338
339# We need to filter out the _GNU_SOURCE variable because it breaks recent
340# releases of Cygwin when using the -mno-cygwin option. Moreover, we don't
341# need this macro at all to build the Android emulator.
342SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS))
343SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs))
344
David 'Digit' Turner34d16512010-05-18 17:02:33 -0700345# Circular dependencies between libSDL and libSDLmain;
346# We repeat the libraries in the final link to work around it.
347SDL_STATIC_LIBRARIES := libSDL libSDLmain libSDL libSDLmain
348
349else # !BUILD_STANDALONE_EMULATOR
350
351SDL_DIR := distrib/sdl-1.2.12
352include $(LOCAL_PATH)/$(SDL_DIR)/sources.make
353
354endif # !BUILD_STANDALONE_EMULATOR
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800355
356##############################################################################
357# determine audio sources, build the prebuilt audio-library if needed
358#
359
360# determine AUDIO sources based on current configuration
361#
Vladimir Chtchetkineeeac0132010-05-03 10:46:28 -0700362AUDIO_SOURCES := audio.c noaudio.c wavaudio.c wavcapture.c mixeng.c
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800363AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO
364AUDIO_LDLIBS :=
365
366ifeq ($(HOST_OS),darwin)
367 CONFIG_COREAUDIO ?= yes
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700368 AUDIO_CFLAGS += -DHOST_BSD=1
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800369endif
370
371ifeq ($(HOST_OS),windows)
372 CONFIG_WINAUDIO ?= yes
373endif
374
375ifeq ($(HOST_OS),linux)
376 CONFIG_OSS ?= yes
377 CONFIG_ALSA ?= yes
378 CONFIG_ESD ?= yes
379endif
380
381ifeq ($(HOST_OS),freebsd)
382 CONFIG_OSS ?= yes
383endif
384
385ifeq ($(CONFIG_COREAUDIO),yes)
386 AUDIO_SOURCES += coreaudio.c
387 AUDIO_CFLAGS += -DCONFIG_COREAUDIO
388 AUDIO_LDLIBS += -Wl,-framework,CoreAudio
389endif
390
391ifeq ($(CONFIG_WINAUDIO),yes)
392 AUDIO_SOURCES += winaudio.c
393 AUDIO_CFLAGS += -DCONFIG_WINAUDIO
394endif
395
396ifeq ($(CONFIG_ALSA),yes)
397 AUDIO_SOURCES += alsaaudio.c audio_pt_int.c
398 AUDIO_CFLAGS += -DCONFIG_ALSA
399endif
400
401ifeq ($(CONFIG_ESD),yes)
402 AUDIO_SOURCES += esdaudio.c
403 AUDIO_CFLAGS += -DCONFIG_ESD
404endif
405
406ifeq ($(CONFIG_OSS),yes)
407 AUDIO_SOURCES += ossaudio.c
408 AUDIO_CFLAGS += -DCONFIG_OSS
409endif
410
411AUDIO_SOURCES := $(AUDIO_SOURCES:%=audio/%)
412
413# determine whether we're going to use the prebuilt
414# audio library (this is useful on Linux to avoid requiring
415# all sound-related development packages to be installed on
416# the build and developer machines).
417#
418# note that you can define BUILD_QEMU_AUDIO_LIB to true
419# in your environment to force recompilation.
420#
421QEMU_AUDIO_LIB :=
422
423ifneq ($(BUILD_STANDALONE_EMULATOR),true)
424 QEMU_AUDIO_LIB := $(wildcard \
David 'Digit' Turner34d16512010-05-18 17:02:33 -0700425 prebuilt/$(QEMU_HOST_TAG)/emulator/libqemu-audio.a)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800426endif
427
428ifeq ($(BUILD_QEMU_AUDIO_LIB),true)
429 include $(CLEAR_VARS)
430 LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
431 LOCAL_CC := $(MY_CC)
432 LOCAL_MODULE := libqemu-audio
David 'Digit' Turnerb95f8922009-08-21 23:10:16 -0700433 LOCAL_LDLIBS := $(MY_LDLIBS)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800434
435 LOCAL_CFLAGS := -Wno-sign-compare \
436 -fno-strict-aliasing -W -Wall -Wno-unused-parameter \
437 -I$(LOCAL_PATH) \
438 -I$(LOCAL_PATH)/target-arm \
439 -I$(LOCAL_PATH)/fpu \
440
David 'Digit' Turner46be4872009-06-04 16:07:01 +0200441 # this is very important, otherwise the generated binaries may
442 # not link properly on our build servers
443 ifeq ($(HOST_OS),linux)
444 LOCAL_CFLAGS += -fno-stack-protector
445 endif
446
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800447 LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(AUDIO_CFLAGS)
448
449 LOCAL_CFLAGS += $(SDL_CFLAGS)
450
451 LOCAL_SRC_FILES += $(AUDIO_SOURCES)
452
453 include $(BUILD_HOST_STATIC_LIBRARY)
454 QEMU_AUDIO_LIB := $(LOCAL_BUILT_MODULE)
455
456endif # !QEMU_AUDIO_LIB
457
458##############################################################################
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700459# Build emulator core library.
460# This library contains "pure" emulation code separated from the intricacies
461# of the UI.
462#
463include $(CLEAR_VARS)
464
465LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
466LOCAL_CC := $(MY_CC)
467LOCAL_LDLIBS := $(MY_LDLIBS)
468LOCAL_MODULE := emulator-core
469
470# don't remove the -fno-strict-aliasing, or you'll break things
471# (e.g. slirp-android/network support)
472#
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700473EMULATOR_CORE_CFLAGS := -fno-PIC -Wno-sign-compare \
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700474 -fno-strict-aliasing -g -W -Wall -Wno-unused-parameter
475
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700476# Needed by the upstream code
477EMULATOR_CORE_CFLAGS += -DNEED_CPU_H
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700478
479# Common includes for the emulator
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700480EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/ \
481 -I$(LOCAL_PATH)/target-arm \
482 -I$(LOCAL_PATH)/fpu \
483 $(TCG_CFLAGS) \
484 $(HW_CFLAGS) \
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700485
486# include slirp-android code, i.e. the user-level networking stuff
487#
488SLIRP_SOURCES := bootp.c cksum.c debug.c if.c ip_icmp.c ip_input.c ip_output.c \
489 mbuf.c misc.c sbuf.c slirp.c socket.c tcp_input.c tcp_output.c \
490 tcp_subr.c tcp_timer.c tftp.c udp.c
491
492LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%)
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700493EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/slirp-android
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700494
495# socket proxy support
496#
497PROXY_SOURCES := \
498 proxy_common.c \
499 proxy_http.c \
500 proxy_http_connector.c \
501 proxy_http_rewriter.c \
502
503LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%)
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700504EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/proxy
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700505
506# include telephony stuff
507#
508TELEPHONY_SOURCES := android_modem.c modem_driver.c gsm.c sim_card.c sysdeps_qemu.c sms.c remote_call.c
509LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%)
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700510EMULATOR_CORE_CFLAGS += -I$(LOCAL_PATH)/telephony
511
Vladimir Chtchetkine45d6d6d2010-06-14 15:26:05 -0700512# include block sources
513#
514BLOCK_SOURCES := \
515 block.c \
516 block/qcow.c \
517 block/qcow2.c \
518 block/qcow2-refcount.c \
519 block/qcow2-snapshot.c \
520 block/qcow2-cluster.c \
521 block/cloop.c \
522 block/dmg.c \
523 block/vvfat.c \
524
525ifeq ($(HOST_OS),windows)
526 BLOCK_SOURCES += block/raw-win32.c
527else
528 BLOCK_SOURCES += block/raw-posix.c
529endif
530
531# ZLIB is required by "block" on Windows
532LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR)
533LOCAL_SRC_FILES += $(BLOCK_SOURCES)
534
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700535LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS)
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700536
537include $(BUILD_HOST_STATIC_LIBRARY)
538
539##############################################################################
540# Build emulator UI library.
541# This library contains some emulator related UI components.
542#
543include $(CLEAR_VARS)
544
545LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
546LOCAL_CC := $(MY_CC)
547LOCAL_LDLIBS := $(MY_LDLIBS)
548LOCAL_MODULE := emulator-ui
549
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700550EMULATOR_UI_CFLAGS :=
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700551
552# include the SDL sources
553#
David 'Digit' Turnerca85ee22010-06-10 15:14:55 -0700554
555# IMPORTANT: Normally, we should add SDLMAIN_SOURCES here, however this breaks
556# the Linux mingw32 build. Apparently, the i586-mingw32-ld wants the
557# implementation of _WinMain@16 to be in an object file on the final
558# link command used to generate the executable, and will not search
559# in the static libraries that are used to build it.
560#
561LOCAL_SRC_FILES += $(SDL_SOURCES) #$(SDLMAIN_SOURCES)
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700562EMULATOR_UI_CFLAGS += $(SDL_CFLAGS) -I$(LOCAL_PATH)/$(SDL_DIR)/include
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700563
564# the skin support sources
565#
566SKIN_SOURCES := rect.c \
567 region.c \
568 image.c \
569 trackball.c \
570 keyboard.c \
571 keyset.c \
572 file.c \
573 window.c \
574 scaler.c \
575 composer.c \
576 surface.c \
577
578LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%)
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700579EMULATOR_UI_CFLAGS += -I$(LOCAL_PATH)/skin
580
581LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS) $(EMULATOR_UI_CFLAGS)
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700582
583include $(BUILD_HOST_STATIC_LIBRARY)
584
585
586##############################################################################
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800587# now build the emulator itself
588#
589include $(CLEAR_VARS)
590
591LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
592LOCAL_CC := $(MY_CC)
593LOCAL_MODULE := emulator
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800594LOCAL_STATIC_LIBRARIES := emulator-memcheck emulator-hw emulator-arm emulator-tcg
595LOCAL_STATIC_LIBRARIES += emulator-elff
Vladimir Chtchetkinea05284d2010-06-10 10:45:55 -0700596LOCAL_STATIC_LIBRARIES += emulator-core emulator-ui
David 'Digit' Turnerb95f8922009-08-21 23:10:16 -0700597LOCAL_LDLIBS := $(MY_LDLIBS)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800598
Vladimir Chtchetkine526a9912010-06-10 11:15:27 -0700599LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) $(EMULATOR_CORE_CFLAGS) $(EMULATOR_UI_CFLAGS)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800600
601# add the build ID to the default macro definitions
602LOCAL_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))"
603
David 'Digit' Turnera383d022009-12-03 13:50:00 -0800604# For non-standalone builds, extract the major version number from the Android SDK
605# tools revision number.
606ifneq ($(BUILD_STANDALONE_EMULATOR),true)
607 ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties)
608endif
609
610ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION))
611ifdef ANDROID_SDK_TOOLS_REVISION
612 LOCAL_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION)
613endif
614
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800615# include the Zlib sources
616#
617LOCAL_SRC_FILES += $(ZLIB_SOURCES)
618LOCAL_CFLAGS += $(ZLIB_CFLAGS) -I$(LOCAL_PATH)/$(ZLIB_DIR)
619
620# include the Libpng sources
621#
622LOCAL_SRC_FILES += $(LIBPNG_SOURCES)
623LOCAL_CFLAGS += $(LIBPNG_CFLAGS) -I$(LOCAL_PATH)/$(LIBPNG_DIR)
624
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800625# include sound support source files. we first try to see if we have a prebuilt audio
626# library. if not, we build things the "hard" way.
627#
628# note that to generate the prebuilt audio library, you should do the following:
629#
630# cd tools/qemu
631# ./android-rebuild.sh
632# distrib/update-audio.sh
633#
634ifeq ($(QEMU_AUDIO_LIB),)
635 LOCAL_SRC_FILES += $(AUDIO_SOURCES)
636endif # !QEMU_AUDIO_LIB
637
638LOCAL_CFLAGS += $(AUDIO_CFLAGS)
639LOCAL_LDLIBS += $(AUDIO_LDLIBS)
640
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800641# the linux-user sources, I doubt we really need these
642#
643#LINUX_SOURCES := main.c elfload.c mmap.c signal.c path.c syscall.c
644#LOCAL_SRC_FILES += $(LINUX_SOURCES:%=linux-user/%)
645
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800646ifeq ($(HOST_ARCH),x86)
647# enable MMX code for our skin scaler
648LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx
649endif
650
651# include other sources
652#
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700653VL_SOURCES := vl-android.c osdep.c cutils.c \
Vladimir Chtchetkine45d6d6d2010-06-14 15:26:05 -0700654 readline.c monitor.c console.c loader.c sockets.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700655 aes.c d3des.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700656 buffered_file.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800657 cbuffer.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700658 gdbstub.c \
David 'Digit' Turner3266b512010-05-10 18:44:56 -0700659 ioport.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700660 vnc-android.c disas.c arm-dis.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800661 shaper.c charpipe.c loadpng.c \
662 framebuffer.c \
663 tcpdump.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700664 qemu-char-android.c \
665 qemu-malloc.c \
666 qemu-option.c \
667 savevm.c \
668 net-android.c \
669 acl.c \
670 aio-android.c \
671 dma-helpers.c \
672 qemu-sockets-android.c \
673 keymaps.c \
674 bt-host.c \
675 bt-vhci.c \
676 module.c \
David 'Digit' Turner2910f182010-05-10 18:48:35 -0700677 json-lexer.c \
678 json-parser.c \
679 json-streamer.c \
680 qbool.c \
681 qdict.c \
682 qfloat.c \
683 qint.c \
684 qjson.c \
685 qlist.c \
686 qstring.c \
David 'Digit' Turner34f29742010-05-25 18:16:10 -0700687 user-events-qemu.c \
David Turner9c0c5152009-06-02 12:30:47 -0700688 android/boot-properties.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800689 android/charmap.c \
690 android/cmdline-option.c \
691 android/config.c \
692 android/console.c \
693 android/gps.c \
694 android/help.c \
695 android/hw-control.c \
696 android/hw-events.c \
697 android/hw-kmsg.c \
David 'Digit' Turnerc5b12702009-06-19 00:36:12 +0200698 android/hw-lcd.c \
The Android Open Source Project9877e2e2009-03-18 17:39:44 -0700699 android/hw-qemud.c \
700 android/hw-sensors.c \
David 'Digit' Turner87250c22009-09-17 16:45:03 -0700701 android/keycode.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800702 android/main.c \
Vladimir Chtchetkined27aca12010-05-13 11:04:42 -0700703 android/qemu-setup.c \
Vladimir Chtchetkine01193622010-05-11 13:07:22 -0700704 android/qemulator.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800705 android/resource.c \
706 android/user-config.c \
707 android/utils/bufprint.c \
708 android/utils/debug.c \
709 android/utils/dirscanner.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800710 android/utils/ini.c \
711 android/utils/filelock.c \
712 android/utils/misc.c \
713 android/utils/path.c \
714 android/utils/reflist.c \
715 android/utils/stralloc.c \
716 android/utils/system.c \
717 android/utils/tempfile.c \
718 android/utils/timezone.c \
Vladimir Chtchetkine8339d182010-03-25 10:57:29 -0700719 android/utils/mapfile.c \
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800720 android/avd/hw-config.c \
721 android/avd/info.c \
722
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800723ifeq ($(HOST_OS),windows)
Vladimir Chtchetkine45d6d6d2010-06-14 15:26:05 -0700724 VL_SOURCES += migration-dummy-android.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700725 iolooper-select.c
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800726else
Vladimir Chtchetkine45d6d6d2010-06-14 15:26:05 -0700727 VL_SOURCES += migration.c \
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700728 migration-exec.c \
729 migration-tcp-android.c \
730 iolooper-select.c
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800731endif
732
733ifeq ($(HOST_OS),linux)
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700734 VL_SOURCES += usb-linux.c \
735 qemu-thread.c
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700736else
737 VL_SOURCES += usb-dummy-android.c
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800738endif
739
740ifeq ($(HOST_ARCH),x86)
741 VL_SOURCES += i386-dis.c
742endif
743ifeq ($(HOST_ARCH),x86_64)
744 VL_SOURCES += i386-dis.c
745endif
746ifeq ($(HOST_ARCH),ppc)
747 VL_SOURCES += ppc-dis.c
748endif
749
750ifeq ($(HOST_OS),windows)
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700751 VL_SOURCES += tap-win32.c
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800752 LOCAL_LDLIBS += -mno-cygwin -mwindows -mconsole
753endif
754
Alexey Tarasov43fbac12009-06-15 14:28:15 +1100755ifeq ($(HOST_OS),freebsd)
756 LOCAL_LDLIBS += -L/usr/local/lib -lpthread -lX11 -lutil
757endif
758
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800759LOCAL_SRC_FILES += $(VL_SOURCES)
760
761ifeq ($(HOST_OS),linux)
762 LOCAL_LDLIBS += -lutil -lrt
763endif
764
765# add SDL-specific flags
766#
767LOCAL_CFLAGS += $(SDL_CFLAGS)
768LOCAL_LDLIBS += $(SDL_LDLIBS)
David 'Digit' Turner34d16512010-05-18 17:02:33 -0700769LOCAL_STATIC_LIBRARIES += $(SDL_STATIC_LIBRARIES)
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800770
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800771# add ELFF-specific flags
772#
773LOCAL_LDLIBS += $(ELFF_LDLIBS)
774
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800775# on Windows, link the icon file as well into the executable
776# unfortunately, our build system doesn't help us much, so we need
777# to use some weird pathnames to make this work...
778#
779ifeq ($(HOST_OS),windows)
Raphaelaea1b872010-04-14 12:16:28 -0700780
781# Locate windres executable
782WINDRES := windres
783ifneq ($(USE_MINGW),)
784 # When building the Windows emulator under Linux, use the MinGW one
785 WINDRES := i586-mingw32msvc-windres
786endif
787
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800788INTERMEDIATE := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true)
789ANDROID_ICON_OBJ := android_icon.o
790ANDROID_ICON_PATH := $(LOCAL_PATH)/images
791$(ANDROID_ICON_PATH)/$(ANDROID_ICON_OBJ): $(ANDROID_ICON_PATH)/android_icon.rc
Raphaelaea1b872010-04-14 12:16:28 -0700792 $(WINDRES) $< -I $(ANDROID_ICON_PATH) -o $@
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800793
794# seems to be the only way to add an object file that was not generated from
795# a C/C++/Java source file to our build system. and very unfortunately,
796# $(TOPDIR)/$(LOCALPATH) will always be prepended to this value, which forces
797# us to put the object file in the source directory...
798#
799LOCAL_PREBUILT_OBJ_FILES += images/$(ANDROID_ICON_OBJ)
800endif
801
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700802# qemu-options.h is generated from qemu-options.hx with the "hxtool" shell script
803#
804intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true)
805
806QEMU_OPTIONS_H := $(intermediates)/qemu-options.h
807$(QEMU_OPTIONS_H): PRIVATE_PATH := $(LOCAL_PATH)
808$(QEMU_OPTIONS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@
809$(QEMU_OPTIONS_H): $(LOCAL_PATH)/qemu-options.hx $(LOCAL_PATH)/hxtool
810 $(transform-generated-source)
811
812$(intermediates)/vl-android.o: $(QEMU_OPTIONS_H)
813
814LOCAL_GENERATED_SOURCES += $(QEMU_OPTIONS_H)
815
816# qemu-monitor.h is generated from qemu-monitor.hx with the "hxtool" shell script
817#
818intermediates := $(call intermediates-dir-for,EXECUTABLES,$(LOCAL_MODULE),true)
819
820QEMU_MONITOR_H := $(intermediates)/qemu-monitor.h
821$(QEMU_MONITOR_H): PRIVATE_PATH := $(LOCAL_PATH)
822$(QEMU_MONITOR_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/hxtool -h < $< > $@
823$(QEMU_MONITOR_H): $(LOCAL_PATH)/qemu-monitor.hx $(LOCAL_PATH)/hxtool
824 $(transform-generated-source)
825
826$(intermediates)/vl-android.o: $(QEMU_MONITOR_H)
827
828LOCAL_GENERATED_SOURCES += $(QEMU_MONITOR_H)
829
830
831# gdbstub-xml.c contains C-compilable arrays corresponding to the content
832# of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script.
833#
834ifeq ($(QEMU_TARGET_XML_SOURCES),)
835 QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3
836 QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml)
837endif
838
839QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c
840$(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH)
841$(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES)
842$(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES)
843$(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh
844 $(hide) rm -f $@
845 $(transform-generated-source)
846
847$(intermediates)/vl-android.o: $(QEMU_GDBSTUB_XML_C)
848
849LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C)
850
David 'Digit' Turner065242d2009-10-07 13:43:33 -0700851# hw-config-defs.h is generated from android/avd/hardware-properties.ini
852#
David 'Digit' Turner2ec45592009-10-07 14:48:19 -0700853QEMU_HARDWARE_PROPERTIES_INI := $(LOCAL_PATH)/android/avd/hardware-properties.ini
David 'Digit' Turner065242d2009-10-07 13:43:33 -0700854QEMU_HW_CONFIG_DEFS_H := $(LOCAL_PATH)/android/avd/hw-config-defs.h
855$(QEMU_HW_CONFIG_DEFS_H): PRIVATE_PATH := $(LOCAL_PATH)
David 'Digit' Turner2ec45592009-10-07 14:48:19 -0700856$(QEMU_HW_CONFIG_DEFS_H): PRIVATE_SOURCES := $(QEMU_HARDWARE_PROPERTIES_INI)
857$(QEMU_HW_CONFIG_DEFS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/android/tools/gen-hw-config.py $(QEMU_HARDWARE_PROPERTIES_INI) $@
858$(QEMU_HW_CONFIG_DEFS_H): $(QEMU_HARDWARE_PROPERTIES_INI) $(LOCAL_PATH)/android/tools/gen-hw-config.py
David 'Digit' Turner065242d2009-10-07 13:43:33 -0700859 $(hide) rm -f $@
860 $(transform-generated-source)
861
862$(LOCAL_PATH)/android/avd/hw-config.h: $(QEMU_HW_CONFIG_DEFS_H)
863
864LOCAL_GENERATED_SOURCES += $(QEMU_HW_CONFIG_DEFS_H)
David 'Digit' Turner5d8f37a2009-09-14 14:32:27 -0700865
866# this is already done by the Android build system, but is done for the
867# benefit of the stand-alone one.
868#
869ifeq ($(BUILD_STANDALONE_EMULATOR),true)
870 LOCAL_CFLAGS += -I$(intermediates)
871endif
872
873
874
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800875# other flags
876LOCAL_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
Raphaelaea1b872010-04-14 12:16:28 -0700877LOCAL_LDLIBS += -lm
Vladimir Chtchetkine5389aa12010-02-16 10:38:35 -0800878
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800879ifeq ($(HOST_OS),windows)
880 LOCAL_LDLIBS += -lwinmm -lws2_32 -liphlpapi
Raphaelaea1b872010-04-14 12:16:28 -0700881else
882 LOCAL_LDLIBS += -lpthread
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800883endif
884
885LOCAL_LDLIBS += $(QEMU_AUDIO_LIB)
886
David 'Digit' Turnerab873b72010-03-08 18:33:50 -0800887# Generate a completely static executable if needed.
888# Note that this means no sound and graphics on Linux.
889#
890ifeq ($(CONFIG_STATIC_EXECUTABLE),true)
891 LOCAL_SRC_FILES += dynlink-static.c
892 LOCAL_LDLIBS += -static
893endif
894
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800895LOCAL_MODULE := emulator
896
David 'Digit' Turnerca85ee22010-06-10 15:14:55 -0700897# See comment about SDLMAIN_SOURCES in the 'emulator-ui' module declarations.
898LOCAL_SRC_FILES += $(SDLMAIN_SOURCES)
899
The Android Open Source Project8b23a6c2009-03-03 19:30:32 -0800900include $(BUILD_HOST_EXECUTABLE)
901
902endif # TARGET_ARCH == arm