1 # This is included by the top-level Makefile.
2 # It sets up standard variables based on the
3 # current configuration and platform, which
4 # are not specific to what is being built.
6 # Only use ANDROID_BUILD_SHELL to wrap around bash.
7 # DO NOT use other shells such as zsh.
8 ifdef ANDROID_BUILD_SHELL
9 SHELL := $(ANDROID_BUILD_SHELL)
11 # Use bash, not whatever shell somebody has installed as /bin/sh
12 # This is repeated from main.mk, since envsetup.sh runs this file
19 space := $(empty) $(empty)
21 # Note that make will eat the newline just before endef.
26 # Unfortunately you can't simply define backslash as \ or \\.
28 backslash := $(patsubst %a,%,$(backslash))
30 # Tell python not to spam the source tree with .pyc files. This
31 # only has an effect on python 2.6 and above.
32 export PYTHONDONTWRITEBYTECODE := 1
34 # Standard source directories.
35 SRC_DOCS:= $(TOPDIR)docs
36 # TODO: Enforce some kind of layering; only add include paths
37 # when a module links against a particular library.
38 # TODO: See if we can remove most of these from the global list.
40 $(TOPDIR)system/core/include \
41 $(TOPDIR)system/media/audio/include \
42 $(TOPDIR)hardware/libhardware/include \
43 $(TOPDIR)hardware/libhardware_legacy/include \
44 $(TOPDIR)hardware/ril/include \
45 $(TOPDIR)libnativehelper/include \
46 $(TOPDIR)frameworks/native/include \
47 $(TOPDIR)frameworks/native/opengl/include \
48 $(TOPDIR)frameworks/av/include \
49 $(TOPDIR)frameworks/base/include
50 SRC_HOST_HEADERS:=$(TOPDIR)tools/include
51 SRC_LIBRARIES:= $(TOPDIR)libs
52 SRC_SERVERS:= $(TOPDIR)servers
53 SRC_TARGET_DIR := $(TOPDIR)build/target
54 SRC_API_DIR := $(TOPDIR)prebuilts/sdk/api
55 SRC_SYSTEM_API_DIR := $(TOPDIR)prebuilts/sdk/system-api
57 # Some specific paths to tools
58 SRC_DROIDDOC_DIR := $(TOPDIR)build/tools/droiddoc
60 # Various mappings to avoid hard-coding paths all over the place
61 include $(BUILD_SYSTEM)/pathmap.mk
63 # ###############################################################
64 # Build system internal files
65 # ###############################################################
67 BUILD_COMBOS:= $(BUILD_SYSTEM)/combo
69 CLEAR_VARS:= $(BUILD_SYSTEM)/clear_vars.mk
70 BUILD_HOST_STATIC_LIBRARY:= $(BUILD_SYSTEM)/host_static_library.mk
71 BUILD_HOST_SHARED_LIBRARY:= $(BUILD_SYSTEM)/host_shared_library.mk
72 BUILD_STATIC_LIBRARY:= $(BUILD_SYSTEM)/static_library.mk
73 BUILD_SHARED_LIBRARY:= $(BUILD_SYSTEM)/shared_library.mk
74 BUILD_EXECUTABLE:= $(BUILD_SYSTEM)/executable.mk
75 BUILD_HOST_EXECUTABLE:= $(BUILD_SYSTEM)/host_executable.mk
76 BUILD_PACKAGE:= $(BUILD_SYSTEM)/package.mk
77 BUILD_PHONY_PACKAGE:= $(BUILD_SYSTEM)/phony_package.mk
78 BUILD_HOST_PREBUILT:= $(BUILD_SYSTEM)/host_prebuilt.mk
79 BUILD_PREBUILT:= $(BUILD_SYSTEM)/prebuilt.mk
80 BUILD_MULTI_PREBUILT:= $(BUILD_SYSTEM)/multi_prebuilt.mk
81 BUILD_JAVA_LIBRARY:= $(BUILD_SYSTEM)/java_library.mk
82 BUILD_STATIC_JAVA_LIBRARY:= $(BUILD_SYSTEM)/static_java_library.mk
83 BUILD_HOST_JAVA_LIBRARY:= $(BUILD_SYSTEM)/host_java_library.mk
84 BUILD_DROIDDOC:= $(BUILD_SYSTEM)/droiddoc.mk
85 BUILD_COPY_HEADERS := $(BUILD_SYSTEM)/copy_headers.mk
86 BUILD_NATIVE_TEST := $(BUILD_SYSTEM)/native_test.mk
87 BUILD_NATIVE_BENCHMARK := $(BUILD_SYSTEM)/native_benchmark.mk
88 BUILD_HOST_NATIVE_TEST := $(BUILD_SYSTEM)/host_native_test.mk
90 BUILD_SHARED_TEST_LIBRARY := $(BUILD_SYSTEM)/shared_test_lib.mk
91 BUILD_HOST_SHARED_TEST_LIBRARY := $(BUILD_SYSTEM)/host_shared_test_lib.mk
92 BUILD_STATIC_TEST_LIBRARY := $(BUILD_SYSTEM)/static_test_lib.mk
93 BUILD_HOST_STATIC_TEST_LIBRARY := $(BUILD_SYSTEM)/host_static_test_lib.mk
95 BUILD_NOTICE_FILE := $(BUILD_SYSTEM)/notice_files.mk
96 BUILD_HOST_DALVIK_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_java_library.mk
97 BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_static_java_library.mk
100 # ###############################################################
101 # Parse out any modifier targets.
102 # ###############################################################
104 # The 'showcommands' goal says to show the full command
105 # lines being executed, instead of a short message about
106 # the kind of operation being done.
107 SHOW_COMMANDS:= $(filter showcommands,$(MAKECMDGOALS))
110 # ###############################################################
112 # ###############################################################
114 # These can be changed to modify both host and device modules.
115 COMMON_GLOBAL_CFLAGS:= -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith
116 COMMON_RELEASE_CFLAGS:= -DNDEBUG -UDEBUG
118 COMMON_GLOBAL_CPPFLAGS:= $(COMMON_GLOBAL_CFLAGS) -Wsign-promo -std=gnu++11
119 COMMON_RELEASE_CPPFLAGS:= $(COMMON_RELEASE_CFLAGS)
121 GLOBAL_CFLAGS_NO_OVERRIDE := \
122 -Werror=int-to-pointer-cast \
123 -Werror=pointer-to-int-cast \
125 GLOBAL_CPPFLAGS_NO_OVERRIDE :=
127 # Set the extensions used for various packages
128 COMMON_PACKAGE_SUFFIX := .zip
129 COMMON_JAVA_PACKAGE_SUFFIX := .jar
130 COMMON_ANDROID_PACKAGE_SUFFIX := .apk
132 # list of flags to turn specific warnings in to errors
133 TARGET_ERROR_FLAGS := -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point
136 JAVA_TMPDIR_ARG := -Djava.io.tmpdir=$(TMPDIR)
141 # ###############################################################
142 # Include sub-configuration files
143 # ###############################################################
145 # ---------------------------------------------------------------
146 # Try to include buildspec.mk, which will try to set stuff up.
147 # If this file doesn't exist, the environment variables will
148 # be used, and if that doesn't work, then the default is an
150 ifndef ANDROID_BUILDSPEC
151 ANDROID_BUILDSPEC := $(TOPDIR)buildspec.mk
153 -include $(ANDROID_BUILDSPEC)
155 # ---------------------------------------------------------------
156 # Define most of the global variables. These are the ones that
157 # are specific to the user's build configuration.
158 include $(BUILD_SYSTEM)/envsetup.mk
160 # Pruned directory options used when using findleaves.py
161 # See envsetup.mk for a description of SCAN_EXCLUDE_DIRS
162 FIND_LEAVES_EXCLUDES := $(addprefix --prune=, $(OUT_DIR) $(SCAN_EXCLUDE_DIRS) .repo .git)
164 # The build system exposes several variables for where to find the kernel
166 # TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current
167 # device being built. It is set as $(TARGET_DEVICE_DIR)/kernel-headers,
168 # e.g. device/samsung/tuna/kernel-headers. This directory is not
169 # explicitly set by anyone, the build system always adds this subdir.
171 # TARGET_BOARD_KERNEL_HEADERS is specified by the BoardConfig.mk file
172 # to allow other directories to be included. This is useful if there's
173 # some common place where a few headers are being kept for a group
174 # of devices. For example, device/<vendor>/common/kernel-headers could
175 # contain some headers for several of <vendor>'s devices.
177 # TARGET_PRODUCT_KERNEL_HEADERS is generated by the product inheritance
178 # graph. This allows architecture products to provide headers for the
179 # devices using that architecture. For example,
180 # hardware/ti/omap4xxx/omap4.mk will specify
181 # PRODUCT_VENDOR_KERNEL_HEADERS variable that specify where the omap4
182 # specific headers are, e.g. hardware/ti/omap4xxx/kernel-headers.
183 # The build system then combines all the values specified by all the
184 # PRODUCT_VENDOR_KERNEL_HEADERS directives in the product inheritance
185 # tree and then exports a TARGET_PRODUCT_KERNEL_HEADERS variable.
187 # The layout of subdirs in any of the kernel-headers dir should mirror the
188 # layout of the kernel include/ directory. For example,
189 # device/samsung/tuna/kernel-headers/linux/,
190 # hardware/ti/omap4xxx/kernel-headers/media/,
193 # NOTE: These directories MUST contain post-processed headers using the
194 # bionic/libc/kernel/clean_header.py tool. Additionally, the original kernel
195 # headers must also be checked in, but in a different subdirectory. By
196 # convention, the originals should be checked into original-kernel-headers
197 # directory of the same parent dir. For example,
198 # device/samsung/tuna/kernel-headers <----- post-processed
199 # device/samsung/tuna/original-kernel-headers <----- originals
201 TARGET_DEVICE_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_DEVICE_DIR)/kernel-headers))
203 define validate-kernel-headers
204 $(if $(firstword $(foreach hdr_dir,$(1),\
205 $(filter-out kernel-headers,$(notdir $(hdr_dir))))),\
206 $(error Kernel header dirs must be end in kernel-headers: $(1)))
208 # also allow the board config to provide additional directories since
209 # there could be device/oem/base_hw and device/oem/derived_hw
210 # that both are valid devices but derived_hw needs to use kernel headers
212 TARGET_BOARD_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_BOARD_KERNEL_HEADERS)))
213 TARGET_BOARD_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_BOARD_KERNEL_HEADERS))
214 $(call validate-kernel-headers,$(TARGET_BOARD_KERNEL_HEADERS))
216 # then add product-inherited includes, to allow for
217 # hardware/sivendor/chip/chip.mk to include their own headers
218 TARGET_PRODUCT_KERNEL_HEADERS := $(strip $(wildcard $(PRODUCT_VENDOR_KERNEL_HEADERS)))
219 TARGET_PRODUCT_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_PRODUCT_KERNEL_HEADERS))
220 $(call validate-kernel-headers,$(TARGET_PRODUCT_KERNEL_HEADERS))
222 # Clean up/verify variables defined by the board config file.
223 TARGET_BOOTLOADER_BOARD_NAME := $(strip $(TARGET_BOOTLOADER_BOARD_NAME))
224 TARGET_CPU_ABI := $(strip $(TARGET_CPU_ABI))
225 ifeq ($(TARGET_CPU_ABI),)
226 $(error No TARGET_CPU_ABI defined by board config: $(board_config_mk))
228 TARGET_CPU_ABI2 := $(strip $(TARGET_CPU_ABI2))
231 define select-android-config-h
232 build/core/combo/include/arch/$(1)/AndroidConfig.h
235 combo_target := HOST_
236 combo_2nd_arch_prefix :=
237 include $(BUILD_SYSTEM)/combo/select.mk
239 # Load the 2nd host arch if it's needed.
241 combo_target := HOST_
242 combo_2nd_arch_prefix := $(HOST_2ND_ARCH_VAR_PREFIX)
243 include $(BUILD_SYSTEM)/combo/select.mk
246 # on windows, the tools have .exe at the end, and we depend on the
247 # host config stuff being done first
249 combo_target := TARGET_
250 combo_2nd_arch_prefix :=
251 include $(BUILD_SYSTEM)/combo/select.mk
253 # Load the 2nd target arch if it's needed.
254 ifdef TARGET_2ND_ARCH
255 combo_target := TARGET_
256 combo_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
257 include $(BUILD_SYSTEM)/combo/select.mk
260 include $(BUILD_SYSTEM)/ccache.mk
262 ifdef TARGET_PREFER_32_BIT
263 TARGET_PREFER_32_BIT_APPS := true
264 TARGET_PREFER_32_BIT_EXECUTABLES := true
267 ifeq (,$(TARGET_SUPPORTS_32_BIT_APPS)$(TARGET_SUPPORTS_64_BIT_APPS))
268 TARGET_SUPPORTS_32_BIT_APPS := true
271 # "ro.product.cpu.abilist32" and "ro.product.cpu.abilist64" are
272 # comma separated lists of the 32 and 64 bit ABIs (in order of
273 # preference) that the target supports. If TARGET_CPU_ABI_LIST_{32,64}_BIT
274 # are defined by the board config, we use them. Else, we construct
275 # these lists based on whether TARGET_IS_64_BIT is set.
277 # Note that this assumes that the 2ND_CPU_ABI for a 64 bit target
278 # is always 32 bits. If this isn't the case, these variables should
279 # be overriden in the board configuration.
280 ifeq (,$(TARGET_CPU_ABI_LIST_64_BIT))
281 ifeq (true|true,$(TARGET_IS_64_BIT)|$(TARGET_SUPPORTS_64_BIT_APPS))
282 TARGET_CPU_ABI_LIST_64_BIT := $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2)
286 ifeq (,$(TARGET_CPU_ABI_LIST_32_BIT))
287 ifneq (true,$(TARGET_IS_64_BIT))
288 TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_CPU_ABI) $(TARGET_CPU_ABI2)
290 ifeq (true,$(TARGET_SUPPORTS_32_BIT_APPS))
291 # For a 64 bit target, assume that the 2ND_CPU_ABI
293 TARGET_CPU_ABI_LIST_32_BIT := $(TARGET_2ND_CPU_ABI) $(TARGET_2ND_CPU_ABI2)
298 # "ro.product.cpu.abilist" is a comma separated list of ABIs (in order
299 # of preference) that the target supports. If a TARGET_CPU_ABI_LIST
300 # is specified by the board configuration, we use that. If not, we
301 # build a list out of the TARGET_CPU_ABIs specified by the config.
302 ifeq (,$(TARGET_CPU_ABI_LIST))
303 ifeq ($(TARGET_IS_64_BIT)|$(TARGET_PREFER_32_BIT_APPS),true|true)
304 TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_32_BIT) $(TARGET_CPU_ABI_LIST_64_BIT)
306 TARGET_CPU_ABI_LIST := $(TARGET_CPU_ABI_LIST_64_BIT) $(TARGET_CPU_ABI_LIST_32_BIT)
310 # Strip whitespace from the ABI list string.
311 TARGET_CPU_ABI_LIST := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST)))
312 TARGET_CPU_ABI_LIST_32_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_32_BIT)))
313 TARGET_CPU_ABI_LIST_64_BIT := $(subst $(space),$(comma),$(strip $(TARGET_CPU_ABI_LIST_64_BIT)))
315 # Compute TARGET_TOOLCHAIN_ROOT from TARGET_TOOLS_PREFIX
316 # if only TARGET_TOOLS_PREFIX is passed to the make command.
317 ifndef TARGET_TOOLCHAIN_ROOT
318 TARGET_TOOLCHAIN_ROOT := $(patsubst %/, %, $(dir $(TARGET_TOOLS_PREFIX)))
319 TARGET_TOOLCHAIN_ROOT := $(patsubst %/, %, $(dir $(TARGET_TOOLCHAIN_ROOT)))
320 TARGET_TOOLCHAIN_ROOT := $(wildcard $(TARGET_TOOLCHAIN_ROOT))
323 # Normalize WITH_STATIC_ANALYZER and WITH_SYNTAX_CHECK
324 ifeq ($(strip $(WITH_STATIC_ANALYZER)),0)
325 WITH_STATIC_ANALYZER :=
327 ifeq ($(strip $(WITH_SYNTAX_CHECK)),0)
331 # Disable WITH_STATIC_ANALYZER and WITH_SYNTAX_CHECK if tool can't be found
332 SYNTAX_TOOLS_PREFIX := prebuilts/misc/$(HOST_PREBUILT_TAG)/analyzer/bin
333 ifneq ($(strip $(WITH_STATIC_ANALYZER)),)
334 ifeq ($(wildcard $(SYNTAX_TOOLS_PREFIX)/ccc-analyzer),)
335 $(warning *** Disable WITH_STATIC_ANALYZER because $(SYNTAX_TOOLS_PREFIX)/ccc-analyzer does not exist)
336 WITH_STATIC_ANALYZER :=
339 ifneq ($(strip $(WITH_SYNTAX_CHECK)),)
340 ifeq ($(wildcard $(SYNTAX_TOOLS_PREFIX)/ccc-syntax),)
341 $(warning *** Disable WITH_SYNTAX_CHECK because $(SYNTAX_TOOLS_PREFIX)/ccc-syntax does not exist)
346 # WITH_STATIC_ANALYZER trumps WITH_SYNTAX_CHECK
347 ifneq ($(strip $(WITH_STATIC_ANALYZER)),)
348 ifneq ($(strip $(WITH_SYNTAX_CHECK)),)
349 $(warning *** Disable WITH_SYNTAX_CHECK in the presence of static analyzer WITH_STATIC_ANALYZER)
354 # Pick a Java compiler.
355 include $(BUILD_SYSTEM)/combo/javac.mk
357 # ---------------------------------------------------------------
358 # Check that the configuration is current. We check that
359 # BUILD_ENV_SEQUENCE_NUMBER is current against this value.
360 # Don't fail if we're called from envsetup, so they have a
361 # chance to update their environment.
363 ifeq (,$(strip $(CALLED_FROM_SETUP)))
364 ifneq (,$(strip $(BUILD_ENV_SEQUENCE_NUMBER)))
365 ifneq ($(BUILD_ENV_SEQUENCE_NUMBER),$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER))
366 $(warning BUILD_ENV_SEQUENCE_NUMBER is set incorrectly.)
367 $(info *** If you use envsetup/lunch/choosecombo:)
368 $(info *** - Re-execute envsetup (". envsetup.sh"))
369 $(info *** - Re-run lunch or choosecombo)
370 $(info *** If you use buildspec.mk:)
371 $(info *** - Look at buildspec.mk.default to see what has changed)
372 $(info *** - Update BUILD_ENV_SEQUENCE_NUMBER to "$(CORRECT_BUILD_ENV_SEQUENCE_NUMBER)")
379 # ---------------------------------------------------------------
381 JACK := $(HOST_OUT_EXECUTABLES)/jack
382 JACK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jack.jar
383 JACK_LAUNCHER_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jack-launcher.jar
384 JILL_JAR := $(HOST_OUT_JAVA_LIBRARIES)/jill.jar
385 JACK_MULTIDEX_DEFAULT_PREPROCESSOR := frameworks/multidex/library/resources/JACK-INF/legacyMultidexInstallation.jpp
387 LEX := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/flex/flex-2.5.39
388 # The default PKGDATADIR built in the prebuilt bison is a relative path
389 # external/bison/data.
390 # To run bison from elsewhere you need to set up enviromental variable
392 BISON_PKGDATADIR := $(PWD)/external/bison/data
393 BISON := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/bison/bison
396 YASM := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/yasm/yasm
399 AAPT := $(HOST_OUT_EXECUTABLES)/aapt$(HOST_EXECUTABLE_SUFFIX)
400 AIDL := $(HOST_OUT_EXECUTABLES)/aidl$(HOST_EXECUTABLE_SUFFIX)
401 PROTOC := $(HOST_OUT_EXECUTABLES)/aprotoc$(HOST_EXECUTABLE_SUFFIX)
402 SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX)
403 MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX)
404 MINIGZIP := $(HOST_OUT_EXECUTABLES)/minigzip$(HOST_EXECUTABLE_SUFFIX)
405 ifeq (,$(strip $(BOARD_CUSTOM_MKBOOTIMG)))
406 MKBOOTIMG := $(HOST_OUT_EXECUTABLES)/mkbootimg$(HOST_EXECUTABLE_SUFFIX)
408 MKBOOTIMG := $(BOARD_CUSTOM_MKBOOTIMG)
410 APICHECK := $(HOST_OUT_EXECUTABLES)/apicheck$(HOST_EXECUTABLE_SUFFIX)
411 FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX)
412 MAKE_EXT4FS := $(HOST_OUT_EXECUTABLES)/make_ext4fs$(HOST_EXECUTABLE_SUFFIX)
413 MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg.sh
414 ifeq ($(HOST_OS),linux)
415 MAKE_SQUASHFS := $(HOST_OUT_EXECUTABLES)/mksquashfs$(HOST_EXECUTABLE_SUFFIX)
416 MKSQUASHFSUSERIMG := $(HOST_OUT_EXECUTABLES)/mksquashfsimage.sh
421 MAKE_F2FS := $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX)
422 MKF2FSUSERIMG := $(HOST_OUT_EXECUTABLES)/mkf2fsuserimg.sh
423 SIMG2IMG := $(HOST_OUT_EXECUTABLES)/simg2img$(HOST_EXECUTABLE_SUFFIX)
424 IMG2SIMG := $(HOST_OUT_EXECUTABLES)/img2simg$(HOST_EXECUTABLE_SUFFIX)
425 E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX)
426 MKTARBALL := build/tools/mktarball.sh
427 TUNE2FS := $(HOST_OUT_EXECUTABLES)/tune2fs$(HOST_EXECUTABLE_SUFFIX)
428 E2FSCK := $(HOST_OUT_EXECUTABLES)/e2fsck$(HOST_EXECUTABLE_SUFFIX)
429 JARJAR := $(HOST_OUT_JAVA_LIBRARIES)/jarjar.jar
431 ifeq ($(ANDROID_COMPILE_WITH_JACK),true)
432 DEFAULT_JACK_ENABLED:=full
434 DEFAULT_JACK_ENABLED:=
436 ifneq ($(strip $(ANDROID_JACK_VM)),)
437 JACK_VM := $(ANDROID_JACK_VM)
444 # $(2): jack perf arguments
445 ifneq (,$(strip $(filter dist,$(MAKECMDGOALS))))
446 JACK_SERVER_LOG_COMMAND := mkdir -p $(DIST_DIR)/logs/; SERVER_LOG=$(DIST_DIR)/logs/jack-server.log
449 $(JACK_SERVER_LOG_COMMAND) JACK_VM_COMMAND="$(JACK_VM) $(1) $(JAVA_TMPDIR_ARG) -jar $(JACK_LAUNCHER_JAR) " JACK_JAR="$(JACK_JAR)" $(JACK) $(2)
451 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_VM_ARGS := $(DEFAULT_JACK_VM_ARGS)
452 ifneq ($(ANDROID_JACK_VM_ARGS),)
453 DEFAULT_JACK_VM_ARGS := $(ANDROID_JACK_VM_ARGS)
455 DEFAULT_JACK_VM_ARGS := -Dfile.encoding=UTF-8 -Xms2560m -XX:+TieredCompilation
457 ifneq ($(ANDROID_JACK_EXTRA_ARGS),)
458 DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS)
460 DEFAULT_JACK_EXTRA_ARGS := @$(BUILD_SYSTEM)/jack-default.args
462 # Turn off jack warnings by default.
463 DEFAULT_JACK_EXTRA_ARGS += --verbose error
465 JILL := java -Xmx3500m -jar $(JILL_JAR)
466 PROGUARD := external/proguard/bin/proguard.sh
467 JAVATAGS := build/tools/java-event-log-tags.py
468 LLVM_RS_CC := $(HOST_OUT_EXECUTABLES)/llvm-rs-cc$(HOST_EXECUTABLE_SUFFIX)
469 BCC_COMPAT := $(HOST_OUT_EXECUTABLES)/bcc_compat$(HOST_EXECUTABLE_SUFFIX)
470 LINT := prebuilts/sdk/tools/lint
471 RMTYPEDEFS := $(HOST_OUT_EXECUTABLES)/rmtypedefs
472 APPEND2SIMG := $(HOST_OUT_EXECUTABLES)/append2simg
473 VERITY_SIGNER := $(HOST_OUT_EXECUTABLES)/verity_signer
474 BUILD_VERITY_TREE := $(HOST_OUT_EXECUTABLES)/build_verity_tree
475 BOOT_SIGNER := $(HOST_OUT_EXECUTABLES)/boot_signer
476 FUTILITY := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/futility/futility
477 VBOOT_SIGNER := prebuilts/misc/scripts/vboot_signer/vboot_signer.sh
479 # ACP is always for the build OS, not for the host OS
480 ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX)
482 # dx is java behind a shell script; no .exe necessary.
483 DX := $(HOST_OUT_EXECUTABLES)/dx
484 ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign$(HOST_EXECUTABLE_SUFFIX)
487 RELOCATION_PACKER := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/relocation_packer/relocation_packer
489 FINDBUGS_DIR := external/owasp/sanitizer/tools/findbugs/bin
490 FINDBUGS := $(FINDBUGS_DIR)/findbugs
491 EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX)
493 # Tool to merge AndroidManifest.xmls
494 ANDROID_MANIFEST_MERGER := java -classpath prebuilts/devtools/tools/lib/manifest-merger.jar com.android.manifmerger.Main merge
496 YACC_HEADER_SUFFIX:= .hpp
498 # Don't use column under Windows, cygwin or not
499 ifeq ($(HOST_OS),windows)
505 HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh)
507 ifneq ($(HOST_JDK_TOOLS_JAR),)
508 ifeq ($(wildcard $(HOST_JDK_TOOLS_JAR)),)
509 $(error Error: could not find jdk tools.jar, please check if your JDK was installed correctly)
513 # Is the host JDK 64-bit version?
514 HOST_JDK_IS_64BIT_VERSION :=
515 ifneq ($(filter 64-Bit, $(shell java -version 2>&1)),)
516 HOST_JDK_IS_64BIT_VERSION := true
519 # It's called md5 on Mac OS and md5sum on Linux
520 ifeq ($(HOST_OS),darwin)
526 APICHECK_CLASSPATH := $(HOST_JDK_TOOLS_JAR)
527 APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/doclava$(COMMON_JAVA_PACKAGE_SUFFIX)
528 APICHECK_CLASSPATH := $(APICHECK_CLASSPATH):$(HOST_OUT_JAVA_LIBRARIES)/jsilver$(COMMON_JAVA_PACKAGE_SUFFIX)
529 APICHECK_COMMAND := $(APICHECK) -JXmx1024m -J"classpath $(APICHECK_CLASSPATH)"
531 # The default key if not set as LOCAL_CERTIFICATE
532 ifdef PRODUCT_DEFAULT_DEV_CERTIFICATE
533 DEFAULT_SYSTEM_DEV_CERTIFICATE := $(PRODUCT_DEFAULT_DEV_CERTIFICATE)
535 DEFAULT_SYSTEM_DEV_CERTIFICATE := build/target/product/security/testkey
538 # ###############################################################
539 # Set up final options.
540 # ###############################################################
542 HOST_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
543 HOST_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
545 HOST_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
546 HOST_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
548 TARGET_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
549 TARGET_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
551 TARGET_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
552 TARGET_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
554 HOST_GLOBAL_LD_DIRS += -L$(HOST_OUT_INTERMEDIATE_LIBRARIES)
555 TARGET_GLOBAL_LD_DIRS += -L$(TARGET_OUT_INTERMEDIATE_LIBRARIES)
557 HOST_PROJECT_INCLUDES:= $(SRC_HEADERS) $(SRC_HOST_HEADERS) $(HOST_OUT_HEADERS)
558 TARGET_PROJECT_INCLUDES:= $(SRC_HEADERS) $(TARGET_OUT_HEADERS) \
559 $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) \
560 $(TARGET_PRODUCT_KERNEL_HEADERS)
562 # Many host compilers don't support these flags, so we have to make
563 # sure to only specify them for the target compilers checked in to
565 TARGET_GLOBAL_CFLAGS += $(TARGET_ERROR_FLAGS)
566 TARGET_GLOBAL_CPPFLAGS += $(TARGET_ERROR_FLAGS)
568 HOST_GLOBAL_CFLAGS += $(HOST_RELEASE_CFLAGS)
569 HOST_GLOBAL_CPPFLAGS += $(HOST_RELEASE_CPPFLAGS)
571 TARGET_GLOBAL_CFLAGS += $(TARGET_RELEASE_CFLAGS)
572 TARGET_GLOBAL_CPPFLAGS += $(TARGET_RELEASE_CPPFLAGS)
574 ifdef TARGET_2ND_ARCH
575 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
576 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
577 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
578 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
579 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS += -L$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES)
580 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_INCLUDES := $(TARGET_PROJECT_INCLUDES)
581 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS += $(TARGET_ERROR_FLAGS)
582 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS += $(TARGET_ERROR_FLAGS)
583 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CFLAGS += $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CFLAGS)
584 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAGS += $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_RELEASE_CPPFLAGS)
588 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CFLAGS += $(COMMON_GLOBAL_CFLAGS)
589 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CFLAGS += $(COMMON_RELEASE_CFLAGS)
590 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CPPFLAGS += $(COMMON_GLOBAL_CPPFLAGS)
591 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CPPFLAGS += $(COMMON_RELEASE_CPPFLAGS)
592 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS += -L$($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES)
593 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_PROJECT_INCLUDES := $(HOST_PROJECT_INCLUDES)
594 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CFLAGS += $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CFLAGS)
595 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_CPPFLAGS += $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_RELEASE_CPPFLAGS)
598 # allow overriding default Java libraries on a per-target basis
599 ifeq ($(TARGET_DEFAULT_JAVA_LIBRARIES),)
600 TARGET_DEFAULT_JAVA_LIBRARIES := core-libart core-junit ext framework
604 DEX2OAT_TARGET_ARCH := $(TARGET_ARCH)
605 ifeq ($(TARGET_CPU_VARIANT),)
606 ifeq ($(TARGET_ARCH_VARIANT),)
607 DEX2OAT_TARGET_CPU_VARIANT := default
609 DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_ARCH_VARIANT)
612 DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_CPU_VARIANT)
614 DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default
616 ifdef TARGET_2ND_ARCH
617 $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH := $(TARGET_2ND_ARCH)
618 $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT := $(TARGET_2ND_CPU_VARIANT)
619 $(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES := default
622 # define clang/llvm tools and global flags
623 include $(BUILD_SYSTEM)/clang/config.mk
625 # ###############################################################
626 # Collect a list of the SDK versions that we could compile against
627 # For use with the LOCAL_SDK_VERSION variable for include $(BUILD_PACKAGE)
628 # ###############################################################
630 HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/sdk
631 HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/ndk
633 # The path where app can reference the support library resources.
634 ifdef TARGET_BUILD_APPS
635 SUPPORT_LIBRARY_ROOT := $(HISTORICAL_SDK_VERSIONS_ROOT)/current/support
637 SUPPORT_LIBRARY_ROOT := frameworks/support
640 # Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N.
641 # The 'current' version is whatever this source tree is.
643 # sgrax is the opposite of xargs. It takes the list of args and puts them
644 # on each line for sort to process.
645 # sort -g is a numeric sort, so 1 2 3 10 instead of 1 10 2 3.
647 # Numerically sort a list of numbers
648 # $(1): the list of numbers to be sorted
649 define numerically_sort
650 $(shell function sgrax() { \
651 while [ -n "$$1" ] ; do echo $$1 ; shift ; done \
653 ( sgrax $(1) | sort -g ) )
656 TARGET_AVAILABLE_SDK_VERSIONS := $(call numerically_sort,\
657 $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \
658 $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar)))
660 # We don't have prebuilt system_current SDK yet.
661 TARGET_AVAILABLE_SDK_VERSIONS := $(TARGET_AVAILABLE_SDK_VERSIONS)
663 INTERNAL_PLATFORM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/public_api.txt
664 INTERNAL_PLATFORM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/removed.txt
665 INTERNAL_PLATFORM_SYSTEM_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-api.txt
666 INTERNAL_PLATFORM_SYSTEM_REMOVED_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-removed.txt
668 # This is the standard way to name a directory containing prebuilt target
669 # objects. E.g., prebuilt/$(TARGET_PREBUILT_TAG)/libc.so
670 TARGET_PREBUILT_TAG := android-$(TARGET_ARCH)
671 ifdef TARGET_2ND_ARCH
672 TARGET_2ND_PREBUILT_TAG := android-$(TARGET_2ND_ARCH)
675 # Set up RS prebuilt variables for compatibility library
677 RS_PREBUILT_CLCORE := prebuilts/sdk/renderscript/lib/$(TARGET_ARCH)/librsrt_$(TARGET_ARCH).bc
678 RS_PREBUILT_COMPILER_RT := prebuilts/sdk/renderscript/lib/$(TARGET_ARCH)/libcompiler_rt.a
679 ifeq (true,$(TARGET_IS_64_BIT))
680 RS_PREBUILT_LIBPATH := -L prebuilts/ndk/9/platforms/android-21/arch-$(TARGET_ARCH)/usr/lib
682 RS_PREBUILT_LIBPATH := -L prebuilts/ndk/8/platforms/android-9/arch-$(TARGET_ARCH)/usr/lib
685 # API Level lists for Renderscript Compat lib.
686 RSCOMPAT_32BIT_ONLY_API_LEVELS := 8 9 10 11 12 13 14 15 16 17 18 19 20
687 RSCOMPAT_NO_USAGEIO_API_LEVELS := 8 9 10 11 12 13
689 include $(BUILD_SYSTEM)/dumpvar.mk