blob: 67ac7516fcd4e5c1f3d658a220db7e3232a7b021 [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001# Variables we check:
2# HOST_BUILD_TYPE = { release debug }
The Android Open Source Project88b60792009-03-03 19:28:42 -08003# 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
C. Sean Youngcf469982015-06-09 12:35:45 -05008# 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.
The Android Open Source Project88b60792009-03-03 19:28:42 -080013
Colin Crossc9016592017-03-28 13:07:56 -070014# Returns all words in $1 up to and including $2
15define find_and_earlier
16 $(strip $(if $(1),
17 $(firstword $(1))
18 $(if $(filter $(firstword $(1)),$(2)),,
19 $(call find_and_earlier,$(wordlist 2,$(words $(1)),$(1)),$(2)))))
20endef
21
22#$(warning $(call find_and_earlier,A B C,A))
23#$(warning $(call find_and_earlier,A B C,B))
24#$(warning $(call find_and_earlier,A B C,C))
25#$(warning $(call find_and_earlier,A B C,D))
26
27define version-list
28$(1)PR1 $(1)PD1 $(1)PD2 $(1)PM1 $(1)PM2
29endef
30
31ALL_VERSIONS := O P Q R S T U V W X Y Z
32ALL_VERSIONS := $(foreach v,$(ALL_VERSIONS),$(call version-list,$(v)))
33
34# Filters ALL_VERSIONS down to the range [$1, $2], and errors if $1 > $2 or $3 is
35# not in [$1, $2]
36# $(1): min platform version
37# $(2): max platform version
38# $(3): default platform version
39define allowed-platform-versions
40$(strip \
41 $(if $(filter $(ALL_VERSIONS),$(1)),,
42 $(error Invalid MIN_PLATFORM_VERSION '$(1)'))
43 $(if $(filter $(ALL_VERSIONS),$(2)),,
44 $(error Invalid MAX_PLATFORM_VERSION '$(2)'))
45 $(if $(filter $(ALL_VERSIONS),$(3)),,
46 $(error Invalid DEFAULT_PLATFORM_VERSION '$(3)'))
47
48 $(eval allowed_versions_ := $(call find_and_earlier,$(ALL_VERSIONS),$(2)))
49
50 $(if $(filter $(allowed_versions_),$(1)),,
51 $(error MIN_PLATFORM_VERSION '$(1)' must be before MAX_PLATFORM_VERSION '$(2)'))
52
53 $(eval allowed_versions_ := $(1) \
54 $(filter-out $(call find_and_earlier,$(allowed_versions_),$(1)),$(allowed_versions_)))
55
56 $(if $(filter $(allowed_versions_),$(3)),,
57 $(error DEFAULT_PLATFORM_VERSION '$(3)' must be between MIN_PLATFORM_VERSION '$(1)' and MAX_PLATFORM_VERSION '$(2)'))
58
59 $(allowed_versions_))
60endef
61
62#$(warning $(call allowed-platform-versions,OPR1,PPR1,OPR1))
63#$(warning $(call allowed-platform-versions,OPM1,PPR1,OPR1))
64
Joe Onoratoeefd0212009-05-13 00:45:23 -040065# Set up version information.
66include $(BUILD_SYSTEM)/version_defaults.mk
67
Colin Crossc9016592017-03-28 13:07:56 -070068ENABLED_VERSIONS := $(call find_and_earlier,$(ALL_VERSIONS),$(TARGET_PLATFORM_VERSION))
69
70$(foreach v,$(ENABLED_VERSIONS), \
71 $(eval IS_AT_LEAST_$(v) := true))
72
The Android Open Source Project88b60792009-03-03 19:28:42 -080073# ---------------------------------------------------------------
74# If you update the build system such that the environment setup
75# or buildspec.mk need to be updated, increment this number, and
76# people who haven't re-run those will have to do so before they
77# can build. Make sure to also update the corresponding value in
78# buildspec.mk.default and envsetup.sh.
Colin Cross88737132017-03-21 17:41:03 -070079CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 13
The Android Open Source Project88b60792009-03-03 19:28:42 -080080
81# ---------------------------------------------------------------
Jeff Browne33ba4c2011-07-11 22:11:46 -070082# The product defaults to generic on hardware
The Android Open Source Project88b60792009-03-03 19:28:42 -080083# NOTE: This will be overridden in product_config.mk if make
84# was invoked with a PRODUCT-xxx-yyy goal.
85ifeq ($(TARGET_PRODUCT),)
Ying Wang0a76df52015-06-08 11:57:26 -070086TARGET_PRODUCT := aosp_arm
The Android Open Source Project88b60792009-03-03 19:28:42 -080087endif
The Android Open Source Project88b60792009-03-03 19:28:42 -080088
89
90# the variant -- the set of files that are included for a build
91ifeq ($(strip $(TARGET_BUILD_VARIANT)),)
92TARGET_BUILD_VARIANT := eng
93endif
94
The Android Open Source Project88b60792009-03-03 19:28:42 -080095# ---------------------------------------------------------------
96# Set up configuration for host machine. We don't do cross-
Raghu Gandham8da43102012-07-25 19:57:22 -070097# compiles except for arm/mips, so the HOST is whatever we are
The Android Open Source Project88b60792009-03-03 19:28:42 -080098# running on
99
100UNAME := $(shell uname -sm)
101
102# HOST_OS
103ifneq (,$(findstring Linux,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -0700104 HOST_OS := linux
The Android Open Source Project88b60792009-03-03 19:28:42 -0800105endif
106ifneq (,$(findstring Darwin,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -0700107 HOST_OS := darwin
The Android Open Source Project88b60792009-03-03 19:28:42 -0800108endif
109ifneq (,$(findstring Macintosh,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -0700110 HOST_OS := darwin
The Android Open Source Project88b60792009-03-03 19:28:42 -0800111endif
Raphael9ca16282010-04-16 17:50:09 -0700112
Ying Wang08800fd2016-03-03 20:57:21 -0800113HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
114
Raphael9ca16282010-04-16 17:50:09 -0700115# BUILD_OS is the real host doing the build.
116BUILD_OS := $(HOST_OS)
117
Dan Willemsen057aaea2015-08-14 12:59:50 -0700118HOST_CROSS_OS :=
119# We can cross-build Windows binaries on Linux
Raphael9ca16282010-04-16 17:50:09 -0700120ifeq ($(HOST_OS),linux)
Dan Willemsen057aaea2015-08-14 12:59:50 -0700121HOST_CROSS_OS := windows
122HOST_CROSS_ARCH := x86
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800123HOST_CROSS_2ND_ARCH := x86_64
Dan Willemsen056609c2016-05-16 22:07:31 -07001242ND_HOST_CROSS_IS_64_BIT := true
Raphael9ca16282010-04-16 17:50:09 -0700125endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800126
127ifeq ($(HOST_OS),)
128$(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
129endif
130
The Android Open Source Project88b60792009-03-03 19:28:42 -0800131# HOST_ARCH
Ying Wang6feb6d52014-04-17 10:03:35 -0700132ifneq (,$(findstring x86_64,$(UNAME)))
Ying Wang2713fce2014-06-09 12:31:12 -0700133 HOST_ARCH := x86_64
134 HOST_2ND_ARCH := x86
Ying Wang4b1c95d2014-07-08 17:07:36 -0700135 HOST_IS_64_BIT := true
Brian Carlstrom2cd8a742015-03-20 11:39:00 -0700136else
Dan Willemsen88225fd2016-06-29 12:26:53 -0700137ifneq (,$(findstring i686,$(UNAME))$(findstring x86,$(UNAME)))
Brian Carlstrom2cd8a742015-03-20 11:39:00 -0700138$(error Building on a 32-bit x86 host is not supported: $(UNAME)!)
139endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800140endif
141
Raphael9ca16282010-04-16 17:50:09 -0700142BUILD_ARCH := $(HOST_ARCH)
Ying Wang6feb6d52014-04-17 10:03:35 -0700143BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
Raphael9ca16282010-04-16 17:50:09 -0700144
The Android Open Source Project88b60792009-03-03 19:28:42 -0800145ifeq ($(HOST_ARCH),)
146$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
147endif
148
149# the host build defaults to release, and it must be release or debug
150ifeq ($(HOST_BUILD_TYPE),)
151HOST_BUILD_TYPE := release
152endif
153
154ifneq ($(HOST_BUILD_TYPE),release)
155ifneq ($(HOST_BUILD_TYPE),debug)
156$(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)')
157endif
158endif
159
Ying Wang6feb6d52014-04-17 10:03:35 -0700160# We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
161HOST_PREBUILT_ARCH := x86
The Android Open Source Project88b60792009-03-03 19:28:42 -0800162# This is the standard way to name a directory containing prebuilt host
163# objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
Dan Albert216ecac2015-05-04 12:44:44 -0700164HOST_PREBUILT_TAG := $(BUILD_OS)-$(HOST_PREBUILT_ARCH)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800165
Ying Wang2b6aaa32011-10-27 15:18:39 -0700166# TARGET_COPY_OUT_* are all relative to the staging directory, ie PRODUCT_OUT.
167# Define them here so they can be used in product config files.
168TARGET_COPY_OUT_SYSTEM := system
Alex Light4e358ab2016-06-16 14:47:10 -0700169TARGET_COPY_OUT_SYSTEM_OTHER := system_other
Ying Wang2b6aaa32011-10-27 15:18:39 -0700170TARGET_COPY_OUT_DATA := data
Vishwath Mohanb285c462017-03-29 15:32:04 -0700171TARGET_COPY_OUT_ASAN := $(TARGET_COPY_OUT_DATA)/asan
Ying Wangb8888432014-03-11 17:13:27 -0700172TARGET_COPY_OUT_OEM := oem
Ying Wang4540a852015-03-12 18:30:39 -0700173TARGET_COPY_OUT_ODM := odm
Ying Wang2b6aaa32011-10-27 15:18:39 -0700174TARGET_COPY_OUT_ROOT := root
175TARGET_COPY_OUT_RECOVERY := recovery
Ying Wang6aef0472014-07-23 20:20:49 -0700176###########################################
177# Define TARGET_COPY_OUT_VENDOR to a placeholder, for at this point
178# we don't know if the device wants to build a separate vendor.img
179# or just build vendor stuff into system.img.
180# A device can set up TARGET_COPY_OUT_VENDOR to "vendor" in its
181# BoardConfig.mk.
182# We'll substitute with the real value after loading BoardConfig.mk.
183_vendor_path_placeholder := ||VENDOR-PATH-PH||
184TARGET_COPY_OUT_VENDOR := $(_vendor_path_placeholder)
185###########################################
Ying Wang2b6aaa32011-10-27 15:18:39 -0700186
Ying Wang6aef0472014-07-23 20:20:49 -0700187# Read the product specs so we can get TARGET_DEVICE and other
Ryo Fujiicbb32662011-06-16 16:58:11 -0700188# variables that we need in order to locate the output files.
189include $(BUILD_SYSTEM)/product_config.mk
Jesse Wilsonce7d5022010-09-22 10:59:10 -0700190
Ying Wangd0244b32011-11-17 14:51:12 -0800191build_variant := $(filter-out eng user userdebug,$(TARGET_BUILD_VARIANT))
Ryo Fujiicbb32662011-06-16 16:58:11 -0700192ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
193$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
Ying Wangd0244b32011-11-17 14:51:12 -0800194$(error must be empty or one of: eng user userdebug)
Ryo Fujiicbb32662011-06-16 16:58:11 -0700195endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800196
Ying Wang7ba7d7f2014-09-02 15:11:20 -0700197SDK_HOST_ARCH := x86
198
Ying Wangc6349742014-01-13 16:14:20 -0800199# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
200# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
201# make sure only one exists.
202# Real boards should always be associated with an OEM vendor.
203board_config_mk := \
Dan Willemsen7c3e3f82015-09-29 16:30:21 -0700204 $(strip $(sort $(wildcard \
Ying Wangc6349742014-01-13 16:14:20 -0800205 $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
Will Drewryc13f9c92015-10-06 19:40:11 -0700206 $(shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
207 $(shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
Dan Willemsen7c3e3f82015-09-29 16:30:21 -0700208 )))
Ying Wangc6349742014-01-13 16:14:20 -0800209ifeq ($(board_config_mk),)
210 $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
211endif
212ifneq ($(words $(board_config_mk)),1)
213 $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
214endif
215include $(board_config_mk)
216ifeq ($(TARGET_ARCH),)
217 $(error TARGET_ARCH not defined by board config: $(board_config_mk))
218endif
Josh Gaof3e72042016-01-22 11:24:59 -0800219ifneq ($(MALLOC_IMPL),)
220 $(warning *** Unsupported option MALLOC_IMPL defined by board config: $(board_config_mk).)
221 $(error Use `MALLOC_SVELTE := true` to configure jemalloc for low-memory)
222endif
Ying Wangc6349742014-01-13 16:14:20 -0800223TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
224board_config_mk :=
225
Ying Wang6aef0472014-07-23 20:20:49 -0700226###########################################
227# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
228ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder))
229TARGET_COPY_OUT_VENDOR := system/vendor
230else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),)
231$(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
232endif
233PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES))
Dan Willemsen6c3e79b2016-06-17 14:07:37 -0700234
235BOARD_USES_VENDORIMAGE :=
236ifdef BOARD_PREBUILT_VENDORIMAGE
237BOARD_USES_VENDORIMAGE := true
238endif
239ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
240BOARD_USES_VENDORIMAGE := true
241endif
242ifeq ($(TARGET_COPY_OUT_VENDOR),vendor)
243BOARD_USES_VENDORIMAGE := true
244else ifdef BOARD_USES_VENDORIMAGE
245$(error TARGET_COPY_OUT_VENDOR must be set to 'vendor' to use a vendor image)
246endif
Ying Wang6aef0472014-07-23 20:20:49 -0700247###########################################
Dan Willemsen00cf7672017-01-04 17:16:09 -0800248# Ensure that only TARGET_RECOVERY_UPDATER_LIBS *or* AB_OTA_UPDATER is set.
249TARGET_RECOVERY_UPDATER_LIBS ?=
250AB_OTA_UPDATER ?=
251.KATI_READONLY := TARGET_RECOVERY_UPDATER_LIBS AB_OTA_UPDATER
252ifeq ($(AB_OTA_UPDATER),true)
253 ifneq ($(strip $(TARGET_RECOVERY_UPDATER_LIBS)),)
254 $(error Do not use TARGET_RECOVERY_UPDATER_LIBS when using AB_OTA_UPDATER)
255 endif
256endif
Ying Wang6aef0472014-07-23 20:20:49 -0700257
Dan Willemsen2c3289b2017-03-19 13:22:45 -0700258# Check BOARD_VNDK_VERSION
259ifdef BOARD_VNDK_VERSION
260 ifneq ($(BOARD_VNDK_VERSION),current)
261 $(error BOARD_VNDK_VERSION: Only "current" is implemented)
262 endif
263endif
264
The Android Open Source Project88b60792009-03-03 19:28:42 -0800265# ---------------------------------------------------------------
266# Set up configuration for target machine.
267# The following must be set:
268# TARGET_OS = { linux }
Raghu Gandham8da43102012-07-25 19:57:22 -0700269# TARGET_ARCH = { arm | x86 | mips }
The Android Open Source Project88b60792009-03-03 19:28:42 -0800270
The Android Open Source Project88b60792009-03-03 19:28:42 -0800271TARGET_OS := linux
Raghu Gandham8da43102012-07-25 19:57:22 -0700272# TARGET_ARCH should be set by BoardConfig.mk and will be checked later
Ying Wang4b1c95d2014-07-08 17:07:36 -0700273ifneq ($(filter %64,$(TARGET_ARCH)),)
274TARGET_IS_64_BIT := true
275endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800276
277# the target build type defaults to release
278ifneq ($(TARGET_BUILD_TYPE),debug)
279TARGET_BUILD_TYPE := release
280endif
281
The Android Open Source Project88b60792009-03-03 19:28:42 -0800282# ---------------------------------------------------------------
283# figure out the output directories
284
285ifeq (,$(strip $(OUT_DIR)))
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -0800286ifeq (,$(strip $(OUT_DIR_COMMON_BASE)))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800287OUT_DIR := $(TOPDIR)out
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -0800288else
289OUT_DIR := $(OUT_DIR_COMMON_BASE)/$(notdir $(PWD))
290endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800291endif
292
Dan Willemsen60d9c672016-05-27 15:15:47 -0700293SOONG_OUT_DIR := $(OUT_DIR)/soong
294
The Android Open Source Project88b60792009-03-03 19:28:42 -0800295DEBUG_OUT_DIR := $(OUT_DIR)/debug
296
297# Move the host or target under the debug/ directory
298# if necessary.
299TARGET_OUT_ROOT_release := $(OUT_DIR)/target
300TARGET_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/target
301TARGET_OUT_ROOT := $(TARGET_OUT_ROOT_$(TARGET_BUILD_TYPE))
302
303HOST_OUT_ROOT_release := $(OUT_DIR)/host
304HOST_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/host
305HOST_OUT_ROOT := $(HOST_OUT_ROOT_$(HOST_BUILD_TYPE))
306
Ying Wang6feb6d52014-04-17 10:03:35 -0700307# We want to avoid two host bin directories in multilib build.
308HOST_OUT_release := $(HOST_OUT_ROOT_release)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
309HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800310HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
Dan Willemsen60d9c672016-05-27 15:15:47 -0700311SOONG_HOST_OUT := $(SOONG_OUT_DIR)/host/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
Dan Willemsen057aaea2015-08-14 12:59:50 -0700312# TODO: remove
313BUILD_OUT := $(HOST_OUT)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800314
Dan Willemsen057aaea2015-08-14 12:59:50 -0700315HOST_CROSS_OUT_release := $(HOST_OUT_ROOT_release)/windows-$(HOST_PREBUILT_ARCH)
316HOST_CROSS_OUT_debug := $(HOST_OUT_ROOT_debug)/windows-$(HOST_PREBUILT_ARCH)
317HOST_CROSS_OUT := $(HOST_CROSS_OUT_$(HOST_BUILD_TYPE))
Raphael9ca16282010-04-16 17:50:09 -0700318
Jeff Browne33ba4c2011-07-11 22:11:46 -0700319TARGET_PRODUCT_OUT_ROOT := $(TARGET_OUT_ROOT)/product
The Android Open Source Project88b60792009-03-03 19:28:42 -0800320
321TARGET_COMMON_OUT_ROOT := $(TARGET_OUT_ROOT)/common
322HOST_COMMON_OUT_ROOT := $(HOST_OUT_ROOT)/common
323
324PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_DEVICE)
325
326OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
327
Ying Wangc6349742014-01-13 16:14:20 -0800328BUILD_OUT_EXECUTABLES := $(BUILD_OUT)/bin
Dan Willemsen60d9c672016-05-27 15:15:47 -0700329SOONG_HOST_OUT_EXECUTABLES := $(SOONG_HOST_OUT)/bin
Raphael9ca16282010-04-16 17:50:09 -0700330
Ying Wangc6349742014-01-13 16:14:20 -0800331HOST_OUT_EXECUTABLES := $(HOST_OUT)/bin
Ying Wang36ef50f2014-06-30 17:06:21 -0700332HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib64
Dan Willemsenc6e194f2016-02-13 00:19:40 -0800333HOST_OUT_RENDERSCRIPT_BITCODE := $(HOST_OUT_SHARED_LIBRARIES)
Ying Wangc6349742014-01-13 16:14:20 -0800334HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT)/framework
Joe Onorato64d85d02009-04-09 19:31:12 -0700335HOST_OUT_SDK_ADDON := $(HOST_OUT)/sdk_addon
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800336HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest64
Ryan Campbell81c9d292016-09-12 13:56:50 -0700337HOST_OUT_COVERAGE := $(HOST_OUT)/coverage
The Android Open Source Project88b60792009-03-03 19:28:42 -0800338
Dan Willemsen057aaea2015-08-14 12:59:50 -0700339HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT)/bin
340HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800341HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest
Ryan Campbell81c9d292016-09-12 13:56:50 -0700342HOST_CROSS_OUT_COVERAGE := $(HOST_CROSS_OUT)/coverage
Simran Basi7166d1f2017-01-25 15:11:55 -0800343HOST_OUT_TESTCASES := $(HOST_OUT)/testcases
Dan Willemsen057aaea2015-08-14 12:59:50 -0700344
The Android Open Source Project88b60792009-03-03 19:28:42 -0800345HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj
The Android Open Source Project88b60792009-03-03 19:28:42 -0800346HOST_OUT_INTERMEDIATE_LIBRARIES := $(HOST_OUT_INTERMEDIATES)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800347HOST_OUT_NOTICE_FILES := $(HOST_OUT_INTERMEDIATES)/NOTICE_FILES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800348HOST_OUT_COMMON_INTERMEDIATES := $(HOST_COMMON_OUT_ROOT)/obj
Ying Wangec900ac2013-11-13 15:56:18 -0800349HOST_OUT_FAKE := $(HOST_OUT)/fake_packages
The Android Open Source Project88b60792009-03-03 19:28:42 -0800350
Alexey Polyudovccdc3112016-08-01 17:41:49 -0700351# Nano environment config
352include $(BUILD_SYSTEM)/aux_config.mk
353
Dan Willemsen057aaea2015-08-14 12:59:50 -0700354HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj
Dan Willemsen057aaea2015-08-14 12:59:50 -0700355HOST_CROSS_OUT_INTERMEDIATE_LIBRARIES := $(HOST_CROSS_OUT_INTERMEDIATES)/lib
356HOST_CROSS_OUT_NOTICE_FILES := $(HOST_CROSS_OUT_INTERMEDIATES)/NOTICE_FILES
357
Colin Crossd8262642014-01-24 23:17:21 -0800358HOST_OUT_GEN := $(HOST_OUT)/gen
359HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
360
Dan Willemsen057aaea2015-08-14 12:59:50 -0700361HOST_CROSS_OUT_GEN := $(HOST_CROSS_OUT)/gen
362
Ying Wang6feb6d52014-04-17 10:03:35 -0700363# Out for HOST_2ND_ARCH
364HOST_2ND_ARCH_VAR_PREFIX := 2ND_
365HOST_2ND_ARCH_MODULE_SUFFIX := _32
366$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj32
367$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES := $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES)/lib
Ying Wang966c1e02014-05-20 14:43:51 -0700368$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib
Ying Wang6feb6d52014-04-17 10:03:35 -0700369$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES)
Dan Albertdc941372015-05-04 18:17:52 -0700370$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT_JAVA_LIBRARIES)
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800371$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest
Simran Basi7166d1f2017-01-25 15:11:55 -0800372$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_TESTCASES := $(HOST_OUT_TESTCASES)
Ying Wang6feb6d52014-04-17 10:03:35 -0700373
Ying Wangc4595862014-06-10 12:04:56 -0700374# The default host library path.
375# It always points to the path where we build libraries in the default bitness.
Ying Wang5bac9622014-08-14 11:03:56 -0700376HOST_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES)
Ying Wang6feb6d52014-04-17 10:03:35 -0700377
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800378# Out for HOST_CROSS_2ND_ARCH
379HOST_CROSS_2ND_ARCH_VAR_PREFIX := 2ND_
380HOST_CROSS_2ND_ARCH_MODULE_SUFFIX := _64
381$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj64
382$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATE_LIBRARIES := $($(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATES)/lib
383$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib64
384$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT_EXECUTABLES)
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800385$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest64
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800386
The Android Open Source Project88b60792009-03-03 19:28:42 -0800387TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj
Ying Wangc6349742014-01-13 16:14:20 -0800388TARGET_OUT_HEADERS := $(TARGET_OUT_INTERMEDIATES)/include
The Android Open Source Project88b60792009-03-03 19:28:42 -0800389TARGET_OUT_INTERMEDIATE_LIBRARIES := $(TARGET_OUT_INTERMEDIATES)/lib
390TARGET_OUT_COMMON_INTERMEDIATES := $(TARGET_COMMON_OUT_ROOT)/obj
391
Colin Crossd8262642014-01-24 23:17:21 -0800392TARGET_OUT_GEN := $(PRODUCT_OUT)/gen
393TARGET_OUT_COMMON_GEN := $(TARGET_COMMON_OUT_ROOT)/gen
394
Ying Wang2b6aaa32011-10-27 15:18:39 -0700395TARGET_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM)
Ivan Krasin74b32b82015-09-18 11:54:43 -0700396ifneq ($(filter address,$(SANITIZE_TARGET)),)
Vishwath Mohanb285c462017-03-29 15:32:04 -0700397target_out_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/system
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700398else
399target_out_shared_libraries_base := $(TARGET_OUT)
400endif
401
Ying Wangc6349742014-01-13 16:14:20 -0800402TARGET_OUT_EXECUTABLES := $(TARGET_OUT)/bin
403TARGET_OUT_OPTIONAL_EXECUTABLES := $(TARGET_OUT)/xbin
Ying Wang4b1c95d2014-07-08 17:07:36 -0700404ifeq ($(TARGET_IS_64_BIT),true)
Ying Wangc6349742014-01-13 16:14:20 -0800405# /system/lib always contains 32-bit libraries,
406# and /system/lib64 (if present) always contains 64-bit libraries.
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700407TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800408else
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700409TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800410endif
Dan Willemsenc6e194f2016-02-13 00:19:40 -0800411TARGET_OUT_RENDERSCRIPT_BITCODE := $(TARGET_OUT_SHARED_LIBRARIES)
Ying Wangc6349742014-01-13 16:14:20 -0800412TARGET_OUT_JAVA_LIBRARIES := $(TARGET_OUT)/framework
413TARGET_OUT_APPS := $(TARGET_OUT)/app
Ying Wang5338fbf2013-05-08 15:49:08 -0700414TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT)/priv-app
The Android Open Source Project88b60792009-03-03 19:28:42 -0800415TARGET_OUT_KEYLAYOUT := $(TARGET_OUT)/usr/keylayout
416TARGET_OUT_KEYCHARS := $(TARGET_OUT)/usr/keychars
417TARGET_OUT_ETC := $(TARGET_OUT)/etc
Ying Wangc6349742014-01-13 16:14:20 -0800418TARGET_OUT_NOTICE_FILES := $(TARGET_OUT_INTERMEDIATES)/NOTICE_FILES
Dima Zavin531f5242010-09-27 17:37:17 -0700419TARGET_OUT_FAKE := $(PRODUCT_OUT)/fake_packages
Simran Basi7166d1f2017-01-25 15:11:55 -0800420TARGET_OUT_TESTCASES := $(PRODUCT_OUT)/testcases
The Android Open Source Project88b60792009-03-03 19:28:42 -0800421
Alex Light4e358ab2016-06-16 14:47:10 -0700422TARGET_OUT_SYSTEM_OTHER := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM_OTHER)
423
Ying Wange1d44c32013-12-27 11:09:36 -0800424# Out for TARGET_2ND_ARCH
Ying Wangc4595862014-06-10 12:04:56 -0700425TARGET_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
Ying Wang87538e42016-03-16 19:53:19 -0700426ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
427# With this you can reference the arm binary translation library with libfoo_arm in PRODUCT_PACKAGES.
428TARGET_2ND_ARCH_MODULE_SUFFIX := _$(TARGET_2ND_ARCH)
429else
Ying Wangc4595862014-06-10 12:04:56 -0700430TARGET_2ND_ARCH_MODULE_SUFFIX := $(HOST_2ND_ARCH_MODULE_SUFFIX)
Ying Wang87538e42016-03-16 19:53:19 -0700431endif
Ying Wange1d44c32013-12-27 11:09:36 -0800432$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)
433$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700434ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
435$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
436else
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700437$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700438endif
Dan Willemsenc6e194f2016-02-13 00:19:40 -0800439$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_RENDERSCRIPT_BITCODE := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES)
Ying Wang72b01d62014-01-17 16:17:28 -0800440$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
Colin Crossd9574462014-01-24 13:37:07 -0800441$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS := $(TARGET_OUT_APPS)
442$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT_APPS_PRIVILEGED)
Simran Basi7166d1f2017-01-25 15:11:55 -0800443$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_TESTCASES := $(TARGET_OUT_TESTCASES)
Ying Wange1d44c32013-12-27 11:09:36 -0800444
Ying Wang2b6aaa32011-10-27 15:18:39 -0700445TARGET_OUT_DATA := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
Ying Wangc6349742014-01-13 16:14:20 -0800446TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
447TARGET_OUT_DATA_SHARED_LIBRARIES := $(TARGET_OUT_SHARED_LIBRARIES)
448TARGET_OUT_DATA_JAVA_LIBRARIES := $(TARGET_OUT_DATA)/framework
449TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA)/app
The Android Open Source Project88b60792009-03-03 19:28:42 -0800450TARGET_OUT_DATA_KEYLAYOUT := $(TARGET_OUT_KEYLAYOUT)
451TARGET_OUT_DATA_KEYCHARS := $(TARGET_OUT_KEYCHARS)
452TARGET_OUT_DATA_ETC := $(TARGET_OUT_ETC)
Ying Wang4b1c95d2014-07-08 17:07:36 -0700453ifeq ($(TARGET_IS_64_BIT),true)
454TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest64
Julien Desprez188a1dd2016-04-12 10:22:06 +0100455TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest64
Ying Wang4b1c95d2014-07-08 17:07:36 -0700456else
Ying Wang4c681742010-07-20 11:08:47 -0700457TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
Julien Desprez188a1dd2016-04-12 10:22:06 +0100458TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest
Ying Wang4b1c95d2014-07-08 17:07:36 -0700459endif
Tsu Chiang Chuang40da8832012-07-13 13:47:09 -0700460TARGET_OUT_DATA_FAKE := $(TARGET_OUT_DATA)/fake_packages
The Android Open Source Project88b60792009-03-03 19:28:42 -0800461
Ying Wange3d06792014-01-23 15:09:04 -0800462$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_DATA_EXECUTABLES)
463$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_SHARED_LIBRARIES := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES)
Colin Crossd9574462014-01-24 13:37:07 -0800464$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA_APPS)
Ying Wang87538e42016-03-16 19:53:19 -0700465ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
466$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest/$(TARGET_2ND_ARCH)
Guang Zhu97069b02016-04-12 13:06:20 -0700467$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest/$(TARGET_2ND_ARCH)
Ying Wang87538e42016-03-16 19:53:19 -0700468else
Ying Wang4b1c95d2014-07-08 17:07:36 -0700469$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
Julien Desprez188a1dd2016-04-12 10:22:06 +0100470$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest
Ying Wang87538e42016-03-16 19:53:19 -0700471endif
Ying Wange3d06792014-01-23 15:09:04 -0800472
Ying Wang9f8e8db2011-11-04 11:37:01 -0700473TARGET_OUT_CACHE := $(PRODUCT_OUT)/cache
474
Ying Wang2b6aaa32011-10-27 15:18:39 -0700475TARGET_OUT_VENDOR := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR)
Ivan Krasin74b32b82015-09-18 11:54:43 -0700476ifneq ($(filter address,$(SANITIZE_TARGET)),)
Vishwath Mohanb285c462017-03-29 15:32:04 -0700477target_out_vendor_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/vendor
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700478else
479target_out_vendor_shared_libraries_base := $(TARGET_OUT_VENDOR)
480endif
481
Ying Wangc6349742014-01-13 16:14:20 -0800482TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR)/bin
483TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES := $(TARGET_OUT_VENDOR)/xbin
Ying Wang4b1c95d2014-07-08 17:07:36 -0700484ifeq ($(TARGET_IS_64_BIT),true)
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700485TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800486else
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700487TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800488endif
Miao Wang57be5642017-03-01 19:39:19 -0800489TARGET_OUT_VENDOR_RENDERSCRIPT_BITCODE := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)
Ying Wangc6349742014-01-13 16:14:20 -0800490TARGET_OUT_VENDOR_JAVA_LIBRARIES := $(TARGET_OUT_VENDOR)/framework
491TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR)/app
Benjamin Pujole68a2772015-08-17 07:31:21 +0200492TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(TARGET_OUT_VENDOR)/priv-app
Ying Wang8f779362011-09-13 13:57:26 -0700493TARGET_OUT_VENDOR_ETC := $(TARGET_OUT_VENDOR)/etc
494
Ying Wange3d06792014-01-23 15:09:04 -0800495$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR_EXECUTABLES)
Ying Wang87538e42016-03-16 19:53:19 -0700496ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
Andreas Gampecf6268f2016-06-30 20:20:38 -0700497$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
Ying Wang87538e42016-03-16 19:53:19 -0700498else
Andreas Gampecf6268f2016-06-30 20:20:38 -0700499$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700500endif
Miao Wang57be5642017-03-01 19:39:19 -0800501$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_RENDERSCRIPT_BITCODE := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES)
Colin Crossd9574462014-01-24 13:37:07 -0800502$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR_APPS)
Hung-ying Tyan665e7402016-07-20 17:51:56 +0800503$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(TARGET_OUT_VENDOR_APPS_PRIVILEGED)
Ying Wang61d499b2014-01-15 16:02:16 -0800504
Ying Wangb8888432014-03-11 17:13:27 -0700505TARGET_OUT_OEM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_OEM)
Ying Wangf15250e2014-06-26 14:12:35 -0700506TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM)/bin
Ying Wang4540a852015-03-12 18:30:39 -0700507ifeq ($(TARGET_IS_64_BIT),true)
Ying Wangf15250e2014-06-26 14:12:35 -0700508TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib64
509else
510TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
511endif
Ying Wangb8888432014-03-11 17:13:27 -0700512# We don't expect Java libraries in the oem.img.
513# TARGET_OUT_OEM_JAVA_LIBRARIES:= $(TARGET_OUT_OEM)/framework
Ying Wangf15250e2014-06-26 14:12:35 -0700514TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM)/app
Ying Wangb8888432014-03-11 17:13:27 -0700515TARGET_OUT_OEM_ETC := $(TARGET_OUT_OEM)/etc
516
Ying Wangf15250e2014-06-26 14:12:35 -0700517$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM_EXECUTABLES)
Ying Wang87538e42016-03-16 19:53:19 -0700518ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
519$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib/$(TARGET_2ND_ARCH)
520else
Ying Wangf15250e2014-06-26 14:12:35 -0700521$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700522endif
Ying Wangf15250e2014-06-26 14:12:35 -0700523$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM_APPS)
524
Ying Wang4540a852015-03-12 18:30:39 -0700525TARGET_OUT_ODM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ODM)
526TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM)/bin
527ifeq ($(TARGET_IS_64_BIT),true)
528TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib64
529else
530TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib
531endif
532TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM)/app
533TARGET_OUT_ODM_ETC := $(TARGET_OUT_ODM)/etc
534
535$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM_EXECUTABLES)
Ying Wang87538e42016-03-16 19:53:19 -0700536ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
537$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib/$(TARGET_2ND_ARCH)
538else
Ying Wang4540a852015-03-12 18:30:39 -0700539$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700540endif
Ying Wang4540a852015-03-12 18:30:39 -0700541$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM_APPS)
542
Steve Fungdfbab492015-09-24 18:12:33 -0700543TARGET_OUT_BREAKPAD := $(PRODUCT_OUT)/breakpad
544
The Android Open Source Project88b60792009-03-03 19:28:42 -0800545TARGET_OUT_UNSTRIPPED := $(PRODUCT_OUT)/symbols
546TARGET_OUT_EXECUTABLES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/bin
547TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/lib
Colin Crossa58f8e02014-06-20 13:33:36 -0700548TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/$(TARGET_COPY_OUT_VENDOR)/lib
The Android Open Source Project88b60792009-03-03 19:28:42 -0800549TARGET_ROOT_OUT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)
550TARGET_ROOT_OUT_SBIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/sbin
551TARGET_ROOT_OUT_BIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/bin
Ryan Campbell737bc022016-09-15 17:32:13 -0700552TARGET_OUT_COVERAGE := $(PRODUCT_OUT)/coverage
The Android Open Source Project88b60792009-03-03 19:28:42 -0800553
Ying Wang2b6aaa32011-10-27 15:18:39 -0700554TARGET_ROOT_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ROOT)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800555TARGET_ROOT_OUT_BIN := $(TARGET_ROOT_OUT)/bin
556TARGET_ROOT_OUT_SBIN := $(TARGET_ROOT_OUT)/sbin
557TARGET_ROOT_OUT_ETC := $(TARGET_ROOT_OUT)/etc
558TARGET_ROOT_OUT_USR := $(TARGET_ROOT_OUT)/usr
559
Ying Wang2b6aaa32011-10-27 15:18:39 -0700560TARGET_RECOVERY_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_RECOVERY)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800561TARGET_RECOVERY_ROOT_OUT := $(TARGET_RECOVERY_OUT)/root
562
563TARGET_SYSLOADER_OUT := $(PRODUCT_OUT)/sysloader
564TARGET_SYSLOADER_ROOT_OUT := $(TARGET_SYSLOADER_OUT)/root
565TARGET_SYSLOADER_SYSTEM_OUT := $(TARGET_SYSLOADER_OUT)/root/system
566
567TARGET_INSTALLER_OUT := $(PRODUCT_OUT)/installer
568TARGET_INSTALLER_DATA_OUT := $(TARGET_INSTALLER_OUT)/data
569TARGET_INSTALLER_ROOT_OUT := $(TARGET_INSTALLER_OUT)/root
570TARGET_INSTALLER_SYSTEM_OUT := $(TARGET_INSTALLER_OUT)/root/system
571
Ying Wanga83940f2010-09-24 18:09:04 -0700572COMMON_MODULE_CLASSES := TARGET-NOTICE_FILES HOST-NOTICE_FILES HOST-JAVA_LIBRARIES
Dan Willemsen8dae49c2017-02-15 15:48:11 -0800573PER_ARCH_MODULE_CLASSES := SHARED_LIBRARIES STATIC_LIBRARIES EXECUTABLES GYP RENDERSCRIPT_BITCODE NATIVE_TESTS HEADER_LIBRARIES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800574
575ifeq (,$(strip $(DIST_DIR)))
576 DIST_DIR := $(OUT_DIR)/dist
577endif
578
Dan Willemsen0d255292017-02-18 10:32:13 -0800579ifndef KATI
580PRINT_BUILD_CONFIG ?= true
The Android Open Source Project88b60792009-03-03 19:28:42 -0800581endif
Chih-Hung Hsieh8dd69d92016-01-19 11:43:44 -0800582
583ifeq ($(USE_CLANG_PLATFORM_BUILD),)
584USE_CLANG_PLATFORM_BUILD := true
585endif
Colin Crossb267cba2016-05-19 12:59:54 -0700586
587ifneq ($(USE_CLANG_PLATFORM_BUILD),true)
588ifneq ($(USE_CLANG_PLATFORM_BUILD),false)
589$(error USE_CLANG_PLATFORM_BUILD must be true or false)
590endif
591endif