blob: 2179ae71712579c125af4d9a890bd15702183b05 [file] [log] [blame]
David 'Digit' Turneraff94b82011-02-07 18:10:54 +01001# 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' Turner42fc4492011-06-29 13:16:16 +020016### 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.
31intermediates := $(call intermediates-dir-for,SHARED_LIBRARIES,emulator_hw_config_defs,true)
32
33QEMU_HARDWARE_PROPERTIES_INI := $(LOCAL_PATH)/android/avd/hardware-properties.ini
34QEMU_HW_CONFIG_DEFS_H := $(intermediates)/android/avd/hw-config-defs.h
35$(QEMU_HW_CONFIG_DEFS_H): PRIVATE_PATH := $(LOCAL_PATH)
David 'Digit' Turner66241a62011-07-06 00:31:59 +020036$(QEMU_HW_CONFIG_DEFS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/android/tools/gen-hw-config.py $< $@
David 'Digit' Turner42fc4492011-06-29 13:16:16 +020037$(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
41QEMU_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.
45gen-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' Turneraff94b82011-02-07 18:10:54 +010052### emulator-common: LIBRARY OF COMMON FUNCTIONS
53###
54### THESE ARE POTENTIALLY USED BY ALL COMPONENTS
55###
56
57$(call start-emulator-library, emulator-common)
58
59EMULATOR_COMMON_CFLAGS :=
60
61# Needed by everything about the host
62EMULATOR_COMMON_CFLAGS += \
63 -I$(LOCAL_PATH)/android/config/$(QEMU_HOST_TAG)
64
65# add the build ID to the default macro definitions
66ifeq ($(BUILD_STANDALONE_EMULATOR),)
67EMULATOR_COMMON_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))"
68endif
69
70# For non-standalone builds, extract the major version number from the Android SDK
71# tools revision number.
72ifneq ($(BUILD_STANDALONE_EMULATOR),true)
73 ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties)
74endif
75
76ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION))
77ifdef ANDROID_SDK_TOOLS_REVISION
78 EMULATOR_COMMON_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION)
79endif
80
81# Enable large-file support (i.e. make off_t a 64-bit value)
82ifeq ($(HOST_OS),linux)
83EMULATOR_COMMON_CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
84endif
85
86###########################################################
87# Zlib sources
88#
89ZLIB_DIR := distrib/zlib-1.2.3
90include $(LOCAL_PATH)/$(ZLIB_DIR)/sources.make
91EMULATOR_COMMON_CFLAGS += -I$(LOCAL_PATH)/$(ZLIB_DIR)
92
93LOCAL_SRC_FILES += $(ZLIB_SOURCES)
94
95###########################################################
96# Android utility functions
97#
98LOCAL_SRC_FILES += \
99 sockets.c \
100 iolooper-select.c \
101 android/async-console.c \
102 android/async-utils.c \
103 android/charmap.c \
104 android/framebuffer.c \
105 android/keycode-array.c \
106 android/avd/hw-config.c \
107 android/avd/info.c \
David 'Digit' Turner2d238fd2011-03-25 10:34:47 +0100108 android/avd/util.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100109 android/sync-utils.c \
110 android/utils/assert.c \
111 android/utils/bufprint.c \
112 android/utils/debug.c \
113 android/utils/dirscanner.c \
114 android/utils/filelock.c \
115 android/utils/ini.c \
David 'Digit' Turnerbbb81042011-03-17 14:48:44 +0100116 android/utils/intmap.c \
David 'Digit' Turner0a879bf2011-05-12 18:45:18 +0200117 android/utils/lineinput.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100118 android/utils/mapfile.c \
119 android/utils/misc.c \
120 android/utils/panic.c \
121 android/utils/path.c \
122 android/utils/reflist.c \
123 android/utils/refset.c \
124 android/utils/stralloc.c \
125 android/utils/system.c \
126 android/utils/tempfile.c \
127 android/utils/vector.c \
128
David 'Digit' Turner42fc4492011-06-29 13:16:16 +0200129$(call gen-hw-config-defs)
130
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100131LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
132
133$(call end-emulator-library)
134
135##############################################################################
136##############################################################################
137###
138### emulator-libui: LIBRARY OF UI-RELATED FUNCTIONS
139###
140### THESE ARE USED BY 'emulator-ui' AND THE STANDALONE PROGRAMS
141###
142
143$(call start-emulator-library, emulator-libui)
144
145EMULATOR_LIBUI_CFLAGS :=
146
147LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
148
149###########################################################
150# Libpng configuration
151#
152LIBPNG_DIR := distrib/libpng-1.2.19
153include $(LOCAL_PATH)/$(LIBPNG_DIR)/sources.make
154
155EMULATOR_LIBUI_CFLAGS += \
156 $(LIBPNG_CFLAGS) \
157 -I$(LOCAL_PATH)/$(LIBPNG_DIR)
158
159LOCAL_SRC_FILES += $(LIBPNG_SOURCES) loadpng.c
160
161##############################################################################
162# SDL-related definitions
163#
164
165# Build SDL from sources except in certain cases where we use
166# prebuilt libraries instead.
167#
168BUILD_SDL_FROM_SOURCES := true
169
170# On linux-x86, using the prebuilts avoid installing all the X11
171# development packages on our build servers.
172#
173ifeq ($(QEMU_HOST_TAG),linux-x86)
174 BUILD_SDL_FROM_SOURCES := false
175endif
176
177# On darwin-x86, a bug in the Android build system prevents the compilation
178# of Objective-C sources. Fixed recently in AOSP, but we still use the
179# prebuilts for the benefit of older platform branches.
180#
181ifeq ($(QEMU_HOST_TAG),darwin-x86)
182 BUILD_SDL_FROM_SOURCES := false
183endif
184
185# If we're building with android-configure.sh && make, always build from
186# sources to catch regressions as soon as they happen.
187#
188ifeq ($(BUILD_STANDALONE_EMULATOR),true)
189 BUILD_SDL_FROM_SOURCES := true
190endif
191
192# Except if we used android-configure.sh --sdl-config=<script>
193#
194ifneq ($(SDL_CONFIG),)
195 BUILD_SDL_FROM_SOURCES := false
196endif
197
198ifneq ($(BUILD_SDL_FROM_SOURCES),true)
199
200 SDL_CONFIG ?= prebuilt/$(QEMU_HOST_TAG)/sdl/bin/sdl-config
201 SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
202
203 # We need to filter out the _GNU_SOURCE variable because it breaks recent
204 # releases of Cygwin when using the -mno-cygwin option. Moreover, we don't
205 # need this macro at all to build the Android emulator.
206 SDL_CFLAGS := $(filter-out -D_GNU_SOURCE=1,$(SDL_CFLAGS))
207 SDL_LDLIBS := $(filter-out %.a %.lib,$(shell $(SDL_CONFIG) --static-libs))
208
209 # Circular dependencies between libSDL and libSDLmain
210 # We repeat the libraries in the final link to work around it
211 SDL_STATIC_LIBRARIES := libSDL libSDLmain libSDL libSDLmain
212
213else # BUILD_SDL_FROM_SOURCES
214
215 SDL_DIR := distrib/sdl-1.2.12
216 include $(LOCAL_PATH)/$(SDL_DIR)/sources.make
217 LOCAL_SRC_FILES += $(SDL_SOURCES)
218
219 EMULATOR_LIBUI_CFLAGS += \
220 -I$(LOCAL_PATH)/$(SDL_DIR)/include
221
222 SDL_STATIC_LIBRARIES :=
223
224endif # BUILD_SDL_FROM_SOURCES
225
226EMULATOR_LIBUI_CFLAGS += $(SDL_CFLAGS)
227EMULATOR_LIBUI_LDLIBS += $(SDL_LDLIBS)
228
229# The following is needed by SDL_LoadObject
230ifneq ($(HOST_OS),windows)
231 EMULATOR_LIBUI_LDLIBS += -ldl
232endif
233
234# the skin support sources
235#
236SKIN_SOURCES := rect.c \
237 region.c \
238 image.c \
239 trackball.c \
240 keyboard.c \
241 keyset.c \
242 file.c \
243 window.c \
244 scaler.c \
245 composer.c \
246 surface.c \
247
248LOCAL_SRC_FILES += $(SKIN_SOURCES:%=android/skin/%)
249
250LOCAL_SRC_FILES += \
251 android/user-config.c \
252 android/resource.c \
253 android/qemulator.c \
254 android/keycode.c \
255
David 'Digit' Turner42fc4492011-06-29 13:16:16 +0200256$(call gen-hw-config-defs)
257
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100258# enable MMX code for our skin scaler
259ifeq ($(HOST_ARCH),x86)
260LOCAL_CFLAGS += -DUSE_MMX=1 -mmmx
261endif
262
263LOCAL_CFLAGS += $(EMULATOR_LIBUI_CFLAGS)
264
265$(call end-emulator-library)
266
267##############################################################################
268##############################################################################
269###
270### emulator-libqemu: TARGET-INDEPENDENT QEMU FUNCTIONS
271###
272### THESE ARE USED BY EVERYTHING EXCEPT 'emulator-ui'
273###
274
275$(call start-emulator-library, emulator-libqemu)
276
277EMULATOR_LIBQEMU_CFLAGS :=
278
279LOCAL_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
280
281AUDIO_SOURCES := noaudio.c wavaudio.c wavcapture.c mixeng.c
282AUDIO_CFLAGS := -I$(LOCAL_PATH)/audio -DHAS_AUDIO
283AUDIO_LDLIBS :=
284
285LOCAL_CFLAGS += -Wall -Wno-missing-field-initializers
286
287ifeq ($(HOST_OS),darwin)
288 CONFIG_COREAUDIO ?= yes
289 AUDIO_CFLAGS += -DHOST_BSD=1
290endif
291
292ifeq ($(HOST_OS),windows)
293 CONFIG_WINAUDIO ?= yes
294endif
295
296ifeq ($(HOST_OS),linux)
297 CONFIG_OSS ?= yes
298 CONFIG_ALSA ?= yes
299 CONFIG_PULSEAUDIO ?= yes
300 CONFIG_ESD ?= yes
301endif
302
303ifeq ($(HOST_OS),freebsd)
304 CONFIG_OSS ?= yes
305endif
306
307ifeq ($(CONFIG_COREAUDIO),yes)
308 AUDIO_SOURCES += coreaudio.c
309 AUDIO_CFLAGS += -DCONFIG_COREAUDIO
310 AUDIO_LDLIBS += -Wl,-framework,CoreAudio
311endif
312
313ifeq ($(CONFIG_WINAUDIO),yes)
314 AUDIO_SOURCES += winaudio.c
315 AUDIO_CFLAGS += -DCONFIG_WINAUDIO
316endif
317
318ifeq ($(CONFIG_PULSEAUDIO),yes)
319 AUDIO_SOURCES += paaudio.c audio_pt_int.c
320 AUDIO_CFLAGS += -DCONFIG_PULSEAUDIO
321endif
322
323ifeq ($(CONFIG_ALSA),yes)
324 AUDIO_SOURCES += alsaaudio.c audio_pt_int.c
325 AUDIO_CFLAGS += -DCONFIG_ALSA
326endif
327
328ifeq ($(CONFIG_ESD),yes)
329 AUDIO_SOURCES += esdaudio.c
330 AUDIO_CFLAGS += -DCONFIG_ESD
331endif
332
333ifeq ($(CONFIG_OSS),yes)
334 AUDIO_SOURCES += ossaudio.c
335 AUDIO_CFLAGS += -DCONFIG_OSS
336endif
337
338AUDIO_SOURCES := $(call sort,$(AUDIO_SOURCES:%=audio/%))
339
340LOCAL_CFLAGS += -Wno-sign-compare \
341 -fno-strict-aliasing -W -Wall -Wno-unused-parameter \
342
343# this is very important, otherwise the generated binaries may
344# not link properly on our build servers
345ifeq ($(HOST_OS),linux)
346LOCAL_CFLAGS += -fno-stack-protector
347endif
348
349LOCAL_SRC_FILES += $(AUDIO_SOURCES)
350LOCAL_SRC_FILES += \
351 android/audio-test.c
352
353# other flags
354ifneq ($(HOST_OS),windows)
355 AUDIO_LDLIBS += -ldl
356else
357endif
358
359
360EMULATOR_LIBQEMU_CFLAGS += $(AUDIO_CFLAGS)
361EMULATOR_LIBQEMU_LDLIBS += $(AUDIO_LDLIBS)
362
363LOCAL_CFLAGS += -Wno-missing-field-initializers
364
365# migration sources
366#
367ifeq ($(HOST_OS),windows)
368 LOCAL_SRC_FILES += migration-dummy-android.c
369else
370 LOCAL_SRC_FILES += migration.c \
371 migration-exec.c \
372 migration-tcp-android.c
373endif
374
375# misc. sources
376#
377CORE_MISC_SOURCES = \
378 acl.c \
379 aes.c \
380 aio-android.c \
381 async.c \
382 bt-host.c \
383 bt-vhci.c \
384 buffered_file.c \
385 cbuffer.c \
386 charpipe.c \
387 console.c \
388 cutils.c \
389 d3des.c \
390 input.c \
David 'Digit' Turner8354d2d2011-05-11 00:19:06 +0200391 iohandler.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100392 ioport.c \
393 module.c \
394 net-android.c \
395 notify.c \
396 osdep.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100397 path.c \
David 'Digit' Turner3b2846a2011-05-11 01:34:40 +0200398 qemu-char.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100399 qemu-config.c \
400 qemu-error.c \
401 qemu-malloc.c \
402 qemu-option.c \
403 qemu-sockets-android.c \
404 qerror.c \
405 readline.c \
406 savevm.c \
407 shaper.c \
408 tcpdump.c \
409 vnc-android.c \
410 android/boot-properties.c \
411 android/config.c \
412 android/core-init-utils.c \
413 android/gps.c \
414 android/hw-kmsg.c \
415 android/hw-lcd.c \
416 android/hw-events.c \
417 android/hw-control.c \
418 android/hw-sensors.c \
419 android/hw-qemud.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100420 android/looper-qemu.c \
David 'Digit' Turnerc0ac7332011-05-02 15:05:35 +0200421 android/hw-pipe-net.c \
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100422 android/qemu-setup.c \
423 android/snapshot.c \
424 android/utils/timezone.c \
Vladimir Chtchetkine4ed09fd2011-08-18 09:42:40 -0700425 android/camera/camera-format-converters.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100426
David 'Digit' Turner42fc4492011-06-29 13:16:16 +0200427$(call gen-hw-config-defs)
428
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100429ifeq ($(HOST_ARCH),x86)
430 CORE_MISC_SOURCES += i386-dis.c
431endif
432ifeq ($(HOST_ARCH),x86_64)
433 CORE_MISC_SOURCES += i386-dis.c
434endif
435ifeq ($(HOST_ARCH),ppc)
436 CORE_MISC_SOURCES += ppc-dis.c \
437 cache-utils.c
438endif
439
440ifeq ($(HOST_OS),linux)
441 CORE_MISC_SOURCES += usb-linux.c \
Vladimir Chtchetkine4ed09fd2011-08-18 09:42:40 -0700442 qemu-thread.c \
443 android/camera/camera-capture-linux.c
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100444else
445 CORE_MISC_SOURCES += usb-dummy-android.c
446endif
447
448ifeq ($(HOST_OS),windows)
Vladimir Chtchetkine4ed09fd2011-08-18 09:42:40 -0700449 CORE_MISC_SOURCES += tap-win32.c \
450 android/camera/camera-capture-windows.c
451
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100452else
453 CORE_MISC_SOURCES += posix-aio-compat.c
454endif
455
456LOCAL_SRC_FILES += $(CORE_MISC_SOURCES)
457
458# Required
459LOCAL_CFLAGS += -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
460
461SLIRP_SOURCES := \
462 bootp.c \
463 cksum.c \
464 debug.c \
465 if.c \
466 ip_icmp.c \
467 ip_input.c \
468 ip_output.c \
469 mbuf.c \
470 misc.c \
471 sbuf.c \
472 slirp.c \
473 socket.c \
474 tcp_input.c \
475 tcp_output.c \
476 tcp_subr.c \
477 tcp_timer.c \
478 tftp.c \
479 udp.c
480
481LOCAL_SRC_FILES += $(SLIRP_SOURCES:%=slirp-android/%)
482EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/slirp-android
483
484# socket proxy support
485#
486PROXY_SOURCES := \
487 proxy_common.c \
488 proxy_http.c \
489 proxy_http_connector.c \
490 proxy_http_rewriter.c \
491
492LOCAL_SRC_FILES += $(PROXY_SOURCES:%=proxy/%)
493EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/proxy
494
495# include telephony stuff
496#
497TELEPHONY_SOURCES := \
498 android_modem.c \
499 modem_driver.c \
500 gsm.c \
501 sim_card.c \
502 sysdeps_qemu.c \
503 sms.c \
504 remote_call.c
505
506LOCAL_SRC_FILES += $(TELEPHONY_SOURCES:%=telephony/%)
507EMULATOR_LIBQEMU_CFLAGS += -I$(LOCAL_PATH)/telephony
508
509# sources inherited from upstream, but not fully
510# integrated into android emulator
511#
512LOCAL_SRC_FILES += \
513 json-lexer.c \
514 json-parser.c \
515 json-streamer.c \
516 qjson.c \
517 qbool.c \
518 qdict.c \
519 qfloat.c \
520 qint.c \
521 qlist.c \
522 qstring.c \
523
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100524# gdbstub-xml.c contains C-compilable arrays corresponding to the content
525# of $(LOCAL_PATH)/gdb-xml/, and is generated with the 'feature_to_c.sh' script.
526#
527intermediates := $(call intermediates-dir-for,STATIC_LIBRARIES,$(LOCAL_MODULE),true)
528
529ifeq ($(QEMU_TARGET_XML_SOURCES),)
530 QEMU_TARGET_XML_SOURCES := arm-core arm-neon arm-vfp arm-vfp3
531 QEMU_TARGET_XML_SOURCES := $(QEMU_TARGET_XML_SOURCES:%=$(LOCAL_PATH)/gdb-xml/%.xml)
532endif
533
534QEMU_GDBSTUB_XML_C := $(intermediates)/gdbstub-xml.c
535$(QEMU_GDBSTUB_XML_C): PRIVATE_PATH := $(LOCAL_PATH)
536$(QEMU_GDBSTUB_XML_C): PRIVATE_SOURCES := $(TARGET_XML_SOURCES)
537$(QEMU_GDBSTUB_XML_C): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/feature_to_c.sh $@ $(QEMU_TARGET_XML_SOURCES)
538$(QEMU_GDBSTUB_XML_C): $(QEMU_TARGET_XML_SOURCES) $(LOCAL_PATH)/feature_to_c.sh
539 $(hide) rm -f $@
540 $(transform-generated-source)
541
542LOCAL_GENERATED_SOURCES += $(QEMU_GDBSTUB_XML_C)
543
544EMULATOR_LIBQEMU_CFLAGS += -I$(intermediates)
545
546LOCAL_CFLAGS += $(EMULATOR_LIBQEMU_CFLAGS)
547
548$(call end-emulator-library)
549
550# Block sources, we must compile them with each executable because they
551# are only referenced by the rest of the code using constructor functions.
552# If their object files are put in a static library, these are never compiled
553# into the final linked executable that uses them.
554#
555# Normally, one would solve thus using LOCAL_WHOLE_STATIC_LIBRARIES, but
556# the Darwin linker doesn't support -Wl,--whole-archive or equivalent :-(
557#
558BLOCK_SOURCES += \
559 block.c \
560 blockdev.c \
561 block/qcow.c \
562 block/qcow2.c \
563 block/qcow2-refcount.c \
564 block/qcow2-snapshot.c \
565 block/qcow2-cluster.c \
566 block/cloop.c \
567 block/dmg.c \
568 block/vvfat.c \
569 block/raw.c
570
571ifeq ($(HOST_OS),windows)
572 BLOCK_SOURCES += block/raw-win32.c
573else
574 BLOCK_SOURCES += block/raw-posix.c
575endif
576
577BLOCK_CFLAGS += $(EMULATOR_COMMON_CFLAGS)
578BLOCK_CFLAGS += -DCONFIG_BDRV_WHITELIST=""
579
580
581##############################################################################
582##############################################################################
583###
584### emulator-libelff: TARGET-INDEPENDENT ELF/DWARD PARSER
585###
586### THESE ARE USED BY EVERYTHING EXCEPT 'emulator-ui', BUT WE CANNOT PUT
587### THEM IN emulator-libqemu SINCE THE SOURCES ARE C++
588###
589
590$(call start-emulator-library, emulator-libelff)
591
592LOCAL_CPP_EXTENSION := .cc
593
594ELFF_CFLAGS := -I$(LOCAL_PATH)/elff
595ELFF_LDLIBS := -lstdc++
596
597ELFF_SOURCES := \
598 dwarf_cu.cc \
599 dwarf_die.cc \
600 dwarf_utils.cc \
601 elf_alloc.cc \
602 elf_file.cc \
603 elf_mapped_section.cc \
604 elff_api.cc \
605
606LOCAL_SRC_FILES += $(ELFF_SOURCES:%=elff/%)
607
608LOCAL_CFLAGS += \
609 -fno-exceptions \
610 $(ELFF_CFLAGS) \
611
612$(call end-emulator-library)
613
614
615##############################################################################
616##############################################################################
617###
618### gen-hx-header: Generate headers from .hx file with "hxtool" script.
619###
620### The 'hxtool' script is used to generate header files from an input
621### file with the .hx suffix. I.e. foo.hx --> foo.h
622###
623### Due to the way the Android build system works, we need to regenerate
624### it for each module (the output will go into a module-specific directory).
625###
626### This defines a function that can be used inside a module definition
627###
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200628### $(call gen-hx-header,<input>,<output>,<source-files>)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100629###
630### Where: <input> is the input file, with a .hx suffix (e.g. foo.hx)
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200631### <output> is the output file, with a .h or .def suffix
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100632### <source-files> is a list of source files that include the header
633###
634
635
636gen-hx-header = $(eval $(call gen-hx-header-ev,$1,$2,$3))
637
638define gen-hx-header-ev
David 'Digit' Turner42fc4492011-06-29 13:16:16 +0200639intermediates := $$(call intermediates-dir-for,$$(LOCAL_MODULE_CLASS),$$(LOCAL_MODULE),true)
David 'Digit' Turner317c9d52011-05-10 06:38:21 +0200640
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200641QEMU_HEADER_H := $$(intermediates)/$$2
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100642$$(QEMU_HEADER_H): PRIVATE_PATH := $$(LOCAL_PATH)
643$$(QEMU_HEADER_H): PRIVATE_CUSTOM_TOOL = $$(PRIVATE_PATH)/hxtool -h < $$< > $$@
644$$(QEMU_HEADER_H): $$(LOCAL_PATH)/$$1 $$(LOCAL_PATH)/hxtool
645 $$(transform-generated-source)
646
647LOCAL_GENERATED_SOURCES += $$(QEMU_HEADER_H)
David 'Digit' Turner088edf82011-05-09 15:59:28 +0200648LOCAL_C_INCLUDES += $$(intermediates)
David 'Digit' Turneraff94b82011-02-07 18:10:54 +0100649endef
650