envsetup.mk revision 737bc02ee8d38069e72fd86e60c79abdca590b4e
1# Variables we check:
2#     HOST_BUILD_TYPE = { release debug }
3#     TARGET_BUILD_TYPE = { release debug }
4# and we output a bunch of variables, see the case statement at
5# the bottom for the full list
6#     OUT_DIR is also set to "out" if it's not already set.
7#         this allows you to set it to somewhere else if you like
8#     SCAN_EXCLUDE_DIRS is an optional, whitespace separated list of
9#         directories that will also be excluded from full checkout tree
10#         searches for source or make files, in addition to OUT_DIR.
11#         This can be useful if you set OUT_DIR to be a different directory
12#         than other outputs of your build system.
13
14# Set up version information.
15include $(BUILD_SYSTEM)/version_defaults.mk
16
17# ---------------------------------------------------------------
18# If you update the build system such that the environment setup
19# or buildspec.mk need to be updated, increment this number, and
20# people who haven't re-run those will have to do so before they
21# can build.  Make sure to also update the corresponding value in
22# buildspec.mk.default and envsetup.sh.
23CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 12
24
25# ---------------------------------------------------------------
26# The product defaults to generic on hardware
27# NOTE: This will be overridden in product_config.mk if make
28# was invoked with a PRODUCT-xxx-yyy goal.
29ifeq ($(TARGET_PRODUCT),)
30TARGET_PRODUCT := aosp_arm
31endif
32
33
34# the variant -- the set of files that are included for a build
35ifeq ($(strip $(TARGET_BUILD_VARIANT)),)
36TARGET_BUILD_VARIANT := eng
37endif
38
39# ---------------------------------------------------------------
40# Set up configuration for host machine.  We don't do cross-
41# compiles except for arm/mips, so the HOST is whatever we are
42# running on
43
44UNAME := $(shell uname -sm)
45
46# HOST_OS
47ifneq (,$(findstring Linux,$(UNAME)))
48  HOST_OS := linux
49endif
50ifneq (,$(findstring Darwin,$(UNAME)))
51  HOST_OS := darwin
52endif
53ifneq (,$(findstring Macintosh,$(UNAME)))
54  HOST_OS := darwin
55endif
56
57HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
58
59# BUILD_OS is the real host doing the build.
60BUILD_OS := $(HOST_OS)
61
62HOST_CROSS_OS :=
63# We can cross-build Windows binaries on Linux
64ifeq ($(HOST_OS),linux)
65HOST_CROSS_OS := windows
66HOST_CROSS_ARCH := x86
67HOST_CROSS_2ND_ARCH := x86_64
682ND_HOST_CROSS_IS_64_BIT := true
69endif
70
71ifeq ($(HOST_OS),)
72$(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
73endif
74
75# HOST_ARCH
76ifneq (,$(findstring x86_64,$(UNAME)))
77  HOST_ARCH := x86_64
78  HOST_2ND_ARCH := x86
79  HOST_IS_64_BIT := true
80else
81ifneq (,$(findstring i686,$(UNAME))$(findstring x86,$(UNAME)))
82$(error Building on a 32-bit x86 host is not supported: $(UNAME)!)
83endif
84endif
85
86BUILD_ARCH := $(HOST_ARCH)
87BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
88
89ifeq ($(HOST_ARCH),)
90$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
91endif
92
93# the host build defaults to release, and it must be release or debug
94ifeq ($(HOST_BUILD_TYPE),)
95HOST_BUILD_TYPE := release
96endif
97
98ifneq ($(HOST_BUILD_TYPE),release)
99ifneq ($(HOST_BUILD_TYPE),debug)
100$(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)')
101endif
102endif
103
104# We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
105HOST_PREBUILT_ARCH := x86
106# This is the standard way to name a directory containing prebuilt host
107# objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
108HOST_PREBUILT_TAG := $(BUILD_OS)-$(HOST_PREBUILT_ARCH)
109
110# TARGET_COPY_OUT_* are all relative to the staging directory, ie PRODUCT_OUT.
111# Define them here so they can be used in product config files.
112TARGET_COPY_OUT_SYSTEM := system
113TARGET_COPY_OUT_DATA := data
114TARGET_COPY_OUT_OEM := oem
115TARGET_COPY_OUT_ODM := odm
116TARGET_COPY_OUT_ROOT := root
117TARGET_COPY_OUT_RECOVERY := recovery
118###########################################
119# Define TARGET_COPY_OUT_VENDOR to a placeholder, for at this point
120# we don't know if the device wants to build a separate vendor.img
121# or just build vendor stuff into system.img.
122# A device can set up TARGET_COPY_OUT_VENDOR to "vendor" in its
123# BoardConfig.mk.
124# We'll substitute with the real value after loading BoardConfig.mk.
125_vendor_path_placeholder := ||VENDOR-PATH-PH||
126TARGET_COPY_OUT_VENDOR := $(_vendor_path_placeholder)
127###########################################
128
129# Read the product specs so we can get TARGET_DEVICE and other
130# variables that we need in order to locate the output files.
131include $(BUILD_SYSTEM)/product_config.mk
132
133build_variant := $(filter-out eng user userdebug,$(TARGET_BUILD_VARIANT))
134ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
135$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
136$(error must be empty or one of: eng user userdebug)
137endif
138
139SDK_HOST_ARCH := x86
140
141# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
142# or under vendor/*/$(TARGET_DEVICE).  Search in both places, but
143# make sure only one exists.
144# Real boards should always be associated with an OEM vendor.
145board_config_mk := \
146	$(strip $(sort $(wildcard \
147		$(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
148		$(shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
149		$(shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
150	)))
151ifeq ($(board_config_mk),)
152  $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
153endif
154ifneq ($(words $(board_config_mk)),1)
155  $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
156endif
157include $(board_config_mk)
158ifeq ($(TARGET_ARCH),)
159  $(error TARGET_ARCH not defined by board config: $(board_config_mk))
160endif
161ifneq ($(MALLOC_IMPL),)
162  $(warning *** Unsupported option MALLOC_IMPL defined by board config: $(board_config_mk).)
163  $(error Use `MALLOC_SVELTE := true` to configure jemalloc for low-memory)
164endif
165TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
166board_config_mk :=
167
168###########################################
169# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
170ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder))
171TARGET_COPY_OUT_VENDOR := system/vendor
172else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),)
173$(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
174endif
175PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES))
176
177BOARD_USES_VENDORIMAGE :=
178ifdef BOARD_PREBUILT_VENDORIMAGE
179BOARD_USES_VENDORIMAGE := true
180endif
181ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
182BOARD_USES_VENDORIMAGE := true
183endif
184ifeq ($(TARGET_COPY_OUT_VENDOR),vendor)
185BOARD_USES_VENDORIMAGE := true
186else ifdef BOARD_USES_VENDORIMAGE
187$(error TARGET_COPY_OUT_VENDOR must be set to 'vendor' to use a vendor image)
188endif
189###########################################
190
191
192# ---------------------------------------------------------------
193# Set up configuration for target machine.
194# The following must be set:
195# 		TARGET_OS = { linux }
196# 		TARGET_ARCH = { arm | x86 | mips }
197
198TARGET_OS := linux
199# TARGET_ARCH should be set by BoardConfig.mk and will be checked later
200ifneq ($(filter %64,$(TARGET_ARCH)),)
201TARGET_IS_64_BIT := true
202endif
203
204# the target build type defaults to release
205ifneq ($(TARGET_BUILD_TYPE),debug)
206TARGET_BUILD_TYPE := release
207endif
208
209# ---------------------------------------------------------------
210# figure out the output directories
211
212ifeq (,$(strip $(OUT_DIR)))
213ifeq (,$(strip $(OUT_DIR_COMMON_BASE)))
214OUT_DIR := $(TOPDIR)out
215else
216OUT_DIR := $(OUT_DIR_COMMON_BASE)/$(notdir $(PWD))
217endif
218endif
219
220SOONG_OUT_DIR := $(OUT_DIR)/soong
221
222DEBUG_OUT_DIR := $(OUT_DIR)/debug
223
224# Move the host or target under the debug/ directory
225# if necessary.
226TARGET_OUT_ROOT_release := $(OUT_DIR)/target
227TARGET_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/target
228TARGET_OUT_ROOT := $(TARGET_OUT_ROOT_$(TARGET_BUILD_TYPE))
229
230HOST_OUT_ROOT_release := $(OUT_DIR)/host
231HOST_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/host
232HOST_OUT_ROOT := $(HOST_OUT_ROOT_$(HOST_BUILD_TYPE))
233
234# We want to avoid two host bin directories in multilib build.
235HOST_OUT_release := $(HOST_OUT_ROOT_release)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
236HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
237HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
238SOONG_HOST_OUT := $(SOONG_OUT_DIR)/host/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
239# TODO: remove
240BUILD_OUT := $(HOST_OUT)
241
242HOST_CROSS_OUT_release := $(HOST_OUT_ROOT_release)/windows-$(HOST_PREBUILT_ARCH)
243HOST_CROSS_OUT_debug := $(HOST_OUT_ROOT_debug)/windows-$(HOST_PREBUILT_ARCH)
244HOST_CROSS_OUT := $(HOST_CROSS_OUT_$(HOST_BUILD_TYPE))
245
246TARGET_PRODUCT_OUT_ROOT := $(TARGET_OUT_ROOT)/product
247
248TARGET_COMMON_OUT_ROOT := $(TARGET_OUT_ROOT)/common
249HOST_COMMON_OUT_ROOT := $(HOST_OUT_ROOT)/common
250
251PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_DEVICE)
252
253OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
254
255BUILD_OUT_EXECUTABLES := $(BUILD_OUT)/bin
256SOONG_HOST_OUT_EXECUTABLES := $(SOONG_HOST_OUT)/bin
257
258HOST_OUT_EXECUTABLES := $(HOST_OUT)/bin
259HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib64
260HOST_OUT_RENDERSCRIPT_BITCODE := $(HOST_OUT_SHARED_LIBRARIES)
261HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT)/framework
262HOST_OUT_SDK_ADDON := $(HOST_OUT)/sdk_addon
263HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest64
264HOST_OUT_COVERAGE := $(HOST_OUT)/coverage
265
266HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT)/bin
267HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib
268HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest
269HOST_CROSS_OUT_COVERAGE := $(HOST_CROSS_OUT)/coverage
270
271HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj
272HOST_OUT_HEADERS := $(HOST_OUT_INTERMEDIATES)/include
273HOST_OUT_INTERMEDIATE_LIBRARIES := $(HOST_OUT_INTERMEDIATES)/lib
274HOST_OUT_NOTICE_FILES := $(HOST_OUT_INTERMEDIATES)/NOTICE_FILES
275HOST_OUT_COMMON_INTERMEDIATES := $(HOST_COMMON_OUT_ROOT)/obj
276HOST_OUT_FAKE := $(HOST_OUT)/fake_packages
277
278# Nano environment config
279include $(BUILD_SYSTEM)/aux_config.mk
280
281HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj
282HOST_CROSS_OUT_HEADERS := $(HOST_CROSS_OUT_INTERMEDIATES)/include
283HOST_CROSS_OUT_INTERMEDIATE_LIBRARIES := $(HOST_CROSS_OUT_INTERMEDIATES)/lib
284HOST_CROSS_OUT_NOTICE_FILES := $(HOST_CROSS_OUT_INTERMEDIATES)/NOTICE_FILES
285
286HOST_OUT_GEN := $(HOST_OUT)/gen
287HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
288
289HOST_CROSS_OUT_GEN := $(HOST_CROSS_OUT)/gen
290
291# Out for HOST_2ND_ARCH
292HOST_2ND_ARCH_VAR_PREFIX := 2ND_
293HOST_2ND_ARCH_MODULE_SUFFIX := _32
294$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj32
295$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES := $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES)/lib
296$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib
297$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES)
298$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT_JAVA_LIBRARIES)
299$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest
300
301# The default host library path.
302# It always points to the path where we build libraries in the default bitness.
303HOST_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES)
304
305# Out for HOST_CROSS_2ND_ARCH
306HOST_CROSS_2ND_ARCH_VAR_PREFIX := 2ND_
307HOST_CROSS_2ND_ARCH_MODULE_SUFFIX := _64
308$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj64
309$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATE_LIBRARIES := $($(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATES)/lib
310$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib64
311$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT_EXECUTABLES)
312$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest64
313
314TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj
315TARGET_OUT_HEADERS := $(TARGET_OUT_INTERMEDIATES)/include
316TARGET_OUT_INTERMEDIATE_LIBRARIES := $(TARGET_OUT_INTERMEDIATES)/lib
317TARGET_OUT_COMMON_INTERMEDIATES := $(TARGET_COMMON_OUT_ROOT)/obj
318
319TARGET_OUT_GEN := $(PRODUCT_OUT)/gen
320TARGET_OUT_COMMON_GEN := $(TARGET_COMMON_OUT_ROOT)/gen
321
322TARGET_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM)
323ifneq ($(filter address,$(SANITIZE_TARGET)),)
324target_out_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
325else
326target_out_shared_libraries_base := $(TARGET_OUT)
327endif
328
329TARGET_OUT_EXECUTABLES := $(TARGET_OUT)/bin
330TARGET_OUT_OPTIONAL_EXECUTABLES := $(TARGET_OUT)/xbin
331ifeq ($(TARGET_IS_64_BIT),true)
332# /system/lib always contains 32-bit libraries,
333# and /system/lib64 (if present) always contains 64-bit libraries.
334TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib64
335else
336TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
337endif
338TARGET_OUT_RENDERSCRIPT_BITCODE := $(TARGET_OUT_SHARED_LIBRARIES)
339TARGET_OUT_JAVA_LIBRARIES := $(TARGET_OUT)/framework
340TARGET_OUT_APPS := $(TARGET_OUT)/app
341TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT)/priv-app
342TARGET_OUT_KEYLAYOUT := $(TARGET_OUT)/usr/keylayout
343TARGET_OUT_KEYCHARS := $(TARGET_OUT)/usr/keychars
344TARGET_OUT_ETC := $(TARGET_OUT)/etc
345TARGET_OUT_NOTICE_FILES := $(TARGET_OUT_INTERMEDIATES)/NOTICE_FILES
346TARGET_OUT_FAKE := $(PRODUCT_OUT)/fake_packages
347
348# Out for TARGET_2ND_ARCH
349TARGET_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
350ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
351# With this you can reference the arm binary translation library with libfoo_arm in PRODUCT_PACKAGES.
352TARGET_2ND_ARCH_MODULE_SUFFIX := _$(TARGET_2ND_ARCH)
353else
354TARGET_2ND_ARCH_MODULE_SUFFIX := $(HOST_2ND_ARCH_MODULE_SUFFIX)
355endif
356$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)
357$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES)/lib
358ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
359$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
360else
361$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
362endif
363$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_RENDERSCRIPT_BITCODE := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES)
364$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
365$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS := $(TARGET_OUT_APPS)
366$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT_APPS_PRIVILEGED)
367
368TARGET_OUT_DATA := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
369TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
370TARGET_OUT_DATA_SHARED_LIBRARIES := $(TARGET_OUT_SHARED_LIBRARIES)
371TARGET_OUT_DATA_JAVA_LIBRARIES := $(TARGET_OUT_DATA)/framework
372TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA)/app
373TARGET_OUT_DATA_KEYLAYOUT := $(TARGET_OUT_KEYLAYOUT)
374TARGET_OUT_DATA_KEYCHARS := $(TARGET_OUT_KEYCHARS)
375TARGET_OUT_DATA_ETC := $(TARGET_OUT_ETC)
376ifeq ($(TARGET_IS_64_BIT),true)
377TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest64
378TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest64
379else
380TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
381TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest
382endif
383TARGET_OUT_DATA_FAKE := $(TARGET_OUT_DATA)/fake_packages
384
385$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_DATA_EXECUTABLES)
386$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_SHARED_LIBRARIES := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES)
387$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA_APPS)
388ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
389$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest/$(TARGET_2ND_ARCH)
390$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest/$(TARGET_2ND_ARCH)
391else
392$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
393$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest
394endif
395
396TARGET_OUT_CACHE := $(PRODUCT_OUT)/cache
397
398TARGET_OUT_VENDOR := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR)
399ifneq ($(filter address,$(SANITIZE_TARGET)),)
400target_out_vendor_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)/vendor
401else
402target_out_vendor_shared_libraries_base := $(TARGET_OUT_VENDOR)
403endif
404
405TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR)/bin
406TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES := $(TARGET_OUT_VENDOR)/xbin
407ifeq ($(TARGET_IS_64_BIT),true)
408TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib64
409else
410TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
411endif
412TARGET_OUT_VENDOR_JAVA_LIBRARIES := $(TARGET_OUT_VENDOR)/framework
413TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR)/app
414TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(TARGET_OUT_VENDOR)/priv-app
415TARGET_OUT_VENDOR_ETC := $(TARGET_OUT_VENDOR)/etc
416
417$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR_EXECUTABLES)
418ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
419$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
420else
421$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
422endif
423$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR_APPS)
424
425TARGET_OUT_OEM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_OEM)
426TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM)/bin
427ifeq ($(TARGET_IS_64_BIT),true)
428TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib64
429else
430TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
431endif
432# We don't expect Java libraries in the oem.img.
433# TARGET_OUT_OEM_JAVA_LIBRARIES:= $(TARGET_OUT_OEM)/framework
434TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM)/app
435TARGET_OUT_OEM_ETC := $(TARGET_OUT_OEM)/etc
436
437$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM_EXECUTABLES)
438ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
439$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib/$(TARGET_2ND_ARCH)
440else
441$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
442endif
443$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM_APPS)
444
445TARGET_OUT_ODM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ODM)
446TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM)/bin
447ifeq ($(TARGET_IS_64_BIT),true)
448TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib64
449else
450TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib
451endif
452TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM)/app
453TARGET_OUT_ODM_ETC := $(TARGET_OUT_ODM)/etc
454
455$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM_EXECUTABLES)
456ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
457$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib/$(TARGET_2ND_ARCH)
458else
459$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib
460endif
461$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM_APPS)
462
463TARGET_OUT_BREAKPAD := $(PRODUCT_OUT)/breakpad
464
465TARGET_OUT_UNSTRIPPED := $(PRODUCT_OUT)/symbols
466TARGET_OUT_EXECUTABLES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/bin
467TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/lib
468TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/$(TARGET_COPY_OUT_VENDOR)/lib
469TARGET_ROOT_OUT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)
470TARGET_ROOT_OUT_SBIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/sbin
471TARGET_ROOT_OUT_BIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/bin
472TARGET_OUT_COVERAGE := $(PRODUCT_OUT)/coverage
473
474TARGET_ROOT_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ROOT)
475TARGET_ROOT_OUT_BIN := $(TARGET_ROOT_OUT)/bin
476TARGET_ROOT_OUT_SBIN := $(TARGET_ROOT_OUT)/sbin
477TARGET_ROOT_OUT_ETC := $(TARGET_ROOT_OUT)/etc
478TARGET_ROOT_OUT_USR := $(TARGET_ROOT_OUT)/usr
479
480TARGET_RECOVERY_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_RECOVERY)
481TARGET_RECOVERY_ROOT_OUT := $(TARGET_RECOVERY_OUT)/root
482
483TARGET_SYSLOADER_OUT := $(PRODUCT_OUT)/sysloader
484TARGET_SYSLOADER_ROOT_OUT := $(TARGET_SYSLOADER_OUT)/root
485TARGET_SYSLOADER_SYSTEM_OUT := $(TARGET_SYSLOADER_OUT)/root/system
486
487TARGET_INSTALLER_OUT := $(PRODUCT_OUT)/installer
488TARGET_INSTALLER_DATA_OUT := $(TARGET_INSTALLER_OUT)/data
489TARGET_INSTALLER_ROOT_OUT := $(TARGET_INSTALLER_OUT)/root
490TARGET_INSTALLER_SYSTEM_OUT := $(TARGET_INSTALLER_OUT)/root/system
491
492COMMON_MODULE_CLASSES := TARGET-NOTICE_FILES HOST-NOTICE_FILES HOST-JAVA_LIBRARIES
493PER_ARCH_MODULE_CLASSES := SHARED_LIBRARIES STATIC_LIBRARIES EXECUTABLES GYP RENDERSCRIPT_BITCODE NATIVE_TESTS
494
495ifeq (,$(strip $(DIST_DIR)))
496  DIST_DIR := $(OUT_DIR)/dist
497endif
498
499ifeq ($(PRINT_BUILD_CONFIG),)
500PRINT_BUILD_CONFIG := true
501endif
502
503ifeq ($(USE_CLANG_PLATFORM_BUILD),)
504USE_CLANG_PLATFORM_BUILD := true
505endif
506
507ifneq ($(USE_CLANG_PLATFORM_BUILD),true)
508ifneq ($(USE_CLANG_PLATFORM_BUILD),false)
509$(error USE_CLANG_PLATFORM_BUILD must be true or false)
510endif
511endif
512