blob: bd632bf1378eecc52b07712abd3a8ce0b2c2c8b4 [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
The Android Open Source Project88b60792009-03-03 19:28:42 -0800100# HOST_OS
101ifneq (,$(findstring Linux,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -0700102 HOST_OS := linux
The Android Open Source Project88b60792009-03-03 19:28:42 -0800103endif
104ifneq (,$(findstring Darwin,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -0700105 HOST_OS := darwin
The Android Open Source Project88b60792009-03-03 19:28:42 -0800106endif
107ifneq (,$(findstring Macintosh,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -0700108 HOST_OS := darwin
The Android Open Source Project88b60792009-03-03 19:28:42 -0800109endif
Raphael9ca16282010-04-16 17:50:09 -0700110
Dan Willemsence7f8dd2017-07-25 00:57:38 -0700111HOST_OS_EXTRA := $(shell uname -rsm)
112ifeq ($(HOST_OS),linux)
113 ifneq ($(wildcard /etc/os-release),)
114 HOST_OS_EXTRA += $(shell source /etc/os-release; echo $$PRETTY_NAME)
115 endif
116else ifeq ($(HOST_OS),darwin)
117 HOST_OS_EXTRA += $(shell sw_vers -productVersion)
118endif
119HOST_OS_EXTRA := $(subst $(space),-,$(HOST_OS_EXTRA))
Ying Wang08800fd2016-03-03 20:57:21 -0800120
Raphael9ca16282010-04-16 17:50:09 -0700121# BUILD_OS is the real host doing the build.
122BUILD_OS := $(HOST_OS)
123
Dan Willemsen057aaea2015-08-14 12:59:50 -0700124HOST_CROSS_OS :=
125# We can cross-build Windows binaries on Linux
Raphael9ca16282010-04-16 17:50:09 -0700126ifeq ($(HOST_OS),linux)
Dan Willemsen2a6e3b02017-11-06 11:03:28 -0800127ifeq ($(BUILD_HOST_static),)
Dan Willemsen057aaea2015-08-14 12:59:50 -0700128HOST_CROSS_OS := windows
129HOST_CROSS_ARCH := x86
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800130HOST_CROSS_2ND_ARCH := x86_64
Dan Willemsen056609c2016-05-16 22:07:31 -07001312ND_HOST_CROSS_IS_64_BIT := true
Raphael9ca16282010-04-16 17:50:09 -0700132endif
Dan Willemsen2a6e3b02017-11-06 11:03:28 -0800133endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800134
135ifeq ($(HOST_OS),)
136$(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
137endif
138
The Android Open Source Project88b60792009-03-03 19:28:42 -0800139# HOST_ARCH
Ying Wang6feb6d52014-04-17 10:03:35 -0700140ifneq (,$(findstring x86_64,$(UNAME)))
Ying Wang2713fce2014-06-09 12:31:12 -0700141 HOST_ARCH := x86_64
142 HOST_2ND_ARCH := x86
Ying Wang4b1c95d2014-07-08 17:07:36 -0700143 HOST_IS_64_BIT := true
Brian Carlstrom2cd8a742015-03-20 11:39:00 -0700144else
Dan Willemsen88225fd2016-06-29 12:26:53 -0700145ifneq (,$(findstring i686,$(UNAME))$(findstring x86,$(UNAME)))
Brian Carlstrom2cd8a742015-03-20 11:39:00 -0700146$(error Building on a 32-bit x86 host is not supported: $(UNAME)!)
147endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800148endif
149
Dan Willemsen1d090fc2018-08-28 01:51:25 -0700150ifeq ($(HOST_OS),darwin)
151 # Mac no longer supports 32-bit executables
152 HOST_2ND_ARCH :=
153endif
154
Raphael9ca16282010-04-16 17:50:09 -0700155BUILD_ARCH := $(HOST_ARCH)
Ying Wang6feb6d52014-04-17 10:03:35 -0700156BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
Raphael9ca16282010-04-16 17:50:09 -0700157
The Android Open Source Project88b60792009-03-03 19:28:42 -0800158ifeq ($(HOST_ARCH),)
159$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
160endif
161
162# the host build defaults to release, and it must be release or debug
163ifeq ($(HOST_BUILD_TYPE),)
164HOST_BUILD_TYPE := release
165endif
166
167ifneq ($(HOST_BUILD_TYPE),release)
168ifneq ($(HOST_BUILD_TYPE),debug)
169$(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)')
170endif
171endif
172
Ying Wang6feb6d52014-04-17 10:03:35 -0700173# We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
174HOST_PREBUILT_ARCH := x86
The Android Open Source Project88b60792009-03-03 19:28:42 -0800175# This is the standard way to name a directory containing prebuilt host
176# objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
Dan Albert216ecac2015-05-04 12:44:44 -0700177HOST_PREBUILT_TAG := $(BUILD_OS)-$(HOST_PREBUILT_ARCH)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800178
Ying Wang2b6aaa32011-10-27 15:18:39 -0700179# TARGET_COPY_OUT_* are all relative to the staging directory, ie PRODUCT_OUT.
180# Define them here so they can be used in product config files.
181TARGET_COPY_OUT_SYSTEM := system
Alex Light4e358ab2016-06-16 14:47:10 -0700182TARGET_COPY_OUT_SYSTEM_OTHER := system_other
Ying Wang2b6aaa32011-10-27 15:18:39 -0700183TARGET_COPY_OUT_DATA := data
Vishwath Mohanb285c462017-03-29 15:32:04 -0700184TARGET_COPY_OUT_ASAN := $(TARGET_COPY_OUT_DATA)/asan
Ying Wangb8888432014-03-11 17:13:27 -0700185TARGET_COPY_OUT_OEM := oem
Tom Cherryd14b8952018-08-09 14:26:00 -0700186TARGET_COPY_OUT_RAMDISK := ramdisk
Ying Wang2b6aaa32011-10-27 15:18:39 -0700187TARGET_COPY_OUT_ROOT := root
188TARGET_COPY_OUT_RECOVERY := recovery
Anton Hansson379b2ba2018-10-02 14:10:16 +0100189# The directory used for optional partitions depend on the BoardConfig, so
190# they're defined to placeholder values here and swapped after reading the
191# BoardConfig, to be either the partition dir, or a subdir within 'system'.
192_vendor_path_placeholder := ||VENDOR-PATH-PH||
193_product_path_placeholder := ||PRODUCT-PATH-PH||
194_product_services_path_placeholder := ||PRODUCT_SERVICES-PATH-PH||
195_odm_path_placeholder := ||ODM-PATH-PH||
196TARGET_COPY_OUT_VENDOR := $(_vendor_path_placeholder)
197TARGET_COPY_OUT_PRODUCT := $(_product_path_placeholder)
198TARGET_COPY_OUT_PRODUCT_SERVICES := $(_product_services_path_placeholder)
199TARGET_COPY_OUT_ODM := $(_odm_path_placeholder)
Vishwath Mohand4dbf792017-05-16 14:27:34 -0700200
201# Returns the non-sanitized version of the path provided in $1.
202define get_non_asan_path
203$(patsubst $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/%,$(PRODUCT_OUT)/%,$1)
204endef
205
Igor Murashkin9d4639c2017-06-15 10:41:02 -0700206#################################################################
207# Set up minimal BOOTCLASSPATH list of jars to build/execute
208# java code with dalvikvm/art.
Neil Fullerc69129b2018-11-09 15:57:35 +0000209TARGET_CORE_JARS := core-oj core-libart conscrypt okhttp bouncycastle apache-xml
Colin Cross69b7f3f2017-09-14 14:58:02 -0700210ifeq ($(EMMA_INSTRUMENT),true)
211 ifneq ($(EMMA_INSTRUMENT_STATIC),true)
212 # For instrumented build, if Jacoco is not being included statically
213 # in instrumented packages then include Jacoco classes into the
214 # bootclasspath.
215 TARGET_CORE_JARS += jacocoagent
216 endif # EMMA_INSTRUMENT_STATIC
217endif # EMMA_INSTRUMENT
Igor Murashkin9d4639c2017-06-15 10:41:02 -0700218HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS))
219#################################################################
220
Ying Wang6aef0472014-07-23 20:20:49 -0700221# Read the product specs so we can get TARGET_DEVICE and other
Ryo Fujiicbb32662011-06-16 16:58:11 -0700222# variables that we need in order to locate the output files.
223include $(BUILD_SYSTEM)/product_config.mk
Jesse Wilsonce7d5022010-09-22 10:59:10 -0700224
Ying Wangd0244b32011-11-17 14:51:12 -0800225build_variant := $(filter-out eng user userdebug,$(TARGET_BUILD_VARIANT))
Ryo Fujiicbb32662011-06-16 16:58:11 -0700226ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
227$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
Ying Wangd0244b32011-11-17 14:51:12 -0800228$(error must be empty or one of: eng user userdebug)
Ryo Fujiicbb32662011-06-16 16:58:11 -0700229endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800230
Ying Wang7ba7d7f2014-09-02 15:11:20 -0700231SDK_HOST_ARCH := x86
232
Ying Wangc6349742014-01-13 16:14:20 -0800233# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
234# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
235# make sure only one exists.
236# Real boards should always be associated with an OEM vendor.
Dan Willemsen92afd7d2018-05-02 00:15:41 -0700237ifdef TARGET_DEVICE_DIR
238 ifneq ($(origin TARGET_DEVICE_DIR),command line)
239 $(error TARGET_DEVICE_DIR may not be set manually)
240 endif
241 board_config_mk := $(TARGET_DEVICE_DIR)/BoardConfig.mk
242else
243 board_config_mk := \
244 $(strip $(sort $(wildcard \
245 $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
246 $(shell test -d device && find -L device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
247 $(shell test -d vendor && find -L vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
248 )))
249 ifeq ($(board_config_mk),)
250 $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
251 endif
252 ifneq ($(words $(board_config_mk)),1)
253 $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
254 endif
255 TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
256 .KATI_READONLY := TARGET_DEVICE_DIR
Ying Wangc6349742014-01-13 16:14:20 -0800257endif
258include $(board_config_mk)
259ifeq ($(TARGET_ARCH),)
260 $(error TARGET_ARCH not defined by board config: $(board_config_mk))
261endif
Josh Gaof3e72042016-01-22 11:24:59 -0800262ifneq ($(MALLOC_IMPL),)
263 $(warning *** Unsupported option MALLOC_IMPL defined by board config: $(board_config_mk).)
264 $(error Use `MALLOC_SVELTE := true` to configure jemalloc for low-memory)
265endif
Ying Wangc6349742014-01-13 16:14:20 -0800266board_config_mk :=
267
Ying Wang6aef0472014-07-23 20:20:49 -0700268###########################################
Dan Willemsen94bff7a2018-06-21 09:46:01 -0700269# Handle BUILD_BROKEN_* settings
270vars := \
271 BUILD_BROKEN_ANDROIDMK_EXPORTS \
272 BUILD_BROKEN_DUP_COPY_HEADERS \
273 BUILD_BROKEN_DUP_RULES \
274 BUILD_BROKEN_PHONY_TARGETS
275
276$(foreach var,$(vars),$(eval $(var) := $$(strip $$($(var)))))
277
278$(foreach var,$(vars), \
279 $(if $(filter-out true false,$($(var))), \
280 $(error Valid values of $(var) are "true", "false", and "". Not "$($(var))")))
281
282.KATI_READONLY := $(vars)
283
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -0800284CHANGES_URL := https://android.googlesource.com/platform/build/+/master/Changes.md
285
Dan Willemsen738368d2018-07-23 22:19:40 -0700286ifneq ($(BUILD_BROKEN_ANDROIDMK_EXPORTS),true)
Dan Willemsen8b9c3cc2018-02-27 02:15:32 -0800287$(KATI_obsolete_export It is a global setting. See $(CHANGES_URL)#export_keyword)
288endif
289
290CHANGES_URL :=
Dan Willemsen94bff7a2018-06-21 09:46:01 -0700291
292###########################################
Tom Cherryd14b8952018-08-09 14:26:00 -0700293# Now we can substitute with the real value of TARGET_COPY_OUT_RAMDISK
294ifeq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)
295TARGET_COPY_OUT_RAMDISK := $(TARGET_COPY_OUT_ROOT)
296endif
297
298###########################################
Dan Willemsen67495202019-01-16 12:42:05 -0800299# Configure whether we're building the system image
300BUILDING_SYSTEM_IMAGE := true
301ifeq ($(PRODUCT_BUILD_SYSTEM_IMAGE),)
302 ifndef PRODUCT_USE_DYNAMIC_PARTITION_SIZE
303 ifndef BOARD_SYSTEMIMAGE_PARTITION_SIZE
304 BUILDING_SYSTEM_IMAGE :=
305 endif
306 endif
307else ifeq ($(PRODUCT_BUILD_SYSTEM_IMAGE),false)
308 BUILDING_SYSTEM_IMAGE :=
309endif
310.KATI_READONLY := BUILDING_SYSTEM_IMAGE
311
312# Are we building a system_other image
313BUILDING_SYSTEM_OTHER_IMAGE :=
314ifeq ($(PRODUCT_BUILD_SYSTEM_OTHER_IMAGE),)
315 ifdef BUILDING_SYSTEM_IMAGE
316 ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true)
317 BUILDING_SYSTEM_OTHER_IMAGE := true
318 endif
319 endif
320else ifeq ($(PRODUCT_BUILD_SYSTEM_OTHER_IMAGE),true)
321 BUILDING_SYSTEM_OTHER_IMAGE := true
322 ifndef BUILDING_SYSTEM_IMAGE
323 $(error PRODUCT_BUILD_SYSTEM_OTHER_IMAGE = true requires building the system image)
324 endif
325endif
326.KATI_READONLY := BUILDING_SYSTEM_OTHER_IMAGE
327
328# Are we building a cache image
329BUILDING_CACHE_IMAGE :=
330ifeq ($(PRODUCT_BUILD_CACHE_IMAGE),)
331 ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
332 BUILDING_CACHE_IMAGE := true
333 endif
334else ifeq ($(PRODUCT_BUILD_CACHE_IMAGE),true)
335 BUILDING_CACHE_IMAGE := true
336 ifndef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
337 $(error PRODUCT_BUILD_CACHE_IMAGE set to true, but BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE not defined)
338 endif
339endif
340.KATI_READONLY := BUILDING_CACHE_IMAGE
341
342# TODO: Add BUILDING_BOOT_IMAGE / BUILDING_RECOVERY_IMAGE
343# This gets complicated with BOARD_USES_RECOVERY_AS_BOOT, so skipping for now.
344
345# Are we building a ramdisk image
346BUILDING_RAMDISK_IMAGE := true
347ifeq ($(PRODUCT_BUILD_RAMDISK_IMAGE),)
348 # TODO: Be smarter about this. This probably only needs to happen when one of the follow is true:
349 # BUILDING_BOOT_IMAGE
350 # BUILDING_RECOVERY_IMAGE
351else ifeq ($(PRODUCT_BUILD_RAMDISK_IMAGE),false)
352 BUILDING_RAMDISK_IMAGE :=
353endif
354.KATI_READONLY := BUILDING_RAMDISK_IMAGE
355
356# Are we building a userdata image
357BUILDING_USERDATA_IMAGE :=
358ifeq ($(PRODUCT_BUILD_USERDATA_IMAGE),)
359 ifdef BOARD_USERDATAIMAGE_PARTITION_SIZE
360 BUILDING_USERDATA_IMAGE := true
361 endif
362else ifeq ($(PRODUCT_BUILD_USERDATA_IMAGE),true)
363 BUILDING_USERDATA_IMAGE := true
364endif
365.KATI_READONLY := BUILDING_USERDATA_IMAGE
366
367###########################################
Ying Wang6aef0472014-07-23 20:20:49 -0700368# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
369ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder))
Dan Willemsen67495202019-01-16 12:42:05 -0800370 TARGET_COPY_OUT_VENDOR := system/vendor
Ying Wang6aef0472014-07-23 20:20:49 -0700371else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),)
Dan Willemsen67495202019-01-16 12:42:05 -0800372 $(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
Ying Wang6aef0472014-07-23 20:20:49 -0700373endif
374PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES))
Dan Willemsen6c3e79b2016-06-17 14:07:37 -0700375
376BOARD_USES_VENDORIMAGE :=
377ifdef BOARD_PREBUILT_VENDORIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800378 BOARD_USES_VENDORIMAGE := true
Dan Willemsen6c3e79b2016-06-17 14:07:37 -0700379endif
380ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
Dan Willemsen67495202019-01-16 12:42:05 -0800381 BOARD_USES_VENDORIMAGE := true
Dan Willemsen6c3e79b2016-06-17 14:07:37 -0700382endif
383ifeq ($(TARGET_COPY_OUT_VENDOR),vendor)
Dan Willemsen67495202019-01-16 12:42:05 -0800384 BOARD_USES_VENDORIMAGE := true
Dan Willemsen6c3e79b2016-06-17 14:07:37 -0700385else ifdef BOARD_USES_VENDORIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800386 $(error TARGET_COPY_OUT_VENDOR must be set to 'vendor' to use a vendor image)
Dan Willemsen6c3e79b2016-06-17 14:07:37 -0700387endif
Dan Willemsen67495202019-01-16 12:42:05 -0800388.KATI_READONLY := BOARD_USES_VENDORIMAGE
389
390BUILDING_VENDOR_IMAGE :=
391ifeq ($(PRODUCT_BUILD_VENDOR_IMAGE),)
392 ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
393 BUILDING_VENDOR_IMAGE := true
394 endif
395else ifeq ($(PRODUCT_BUILD_VENDOR_IMAGE),true)
396 BUILDING_VENDOR_IMAGE := true
397 ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
398 $(error PRODUCT_BUILD_VENDOR_IMAGE set to true, but BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE not defined)
399 endif
400endif
401ifdef BOARD_PREBUILT_VENDORIMAGE
402 BUILDING_VENDOR_IMAGE :=
403endif
404.KATI_READONLY := BUILDING_VENDOR_IMAGE
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900405
406###########################################
407# Now we can substitute with the real value of TARGET_COPY_OUT_PRODUCT
408ifeq ($(TARGET_COPY_OUT_PRODUCT),$(_product_path_placeholder))
409TARGET_COPY_OUT_PRODUCT := system/product
410else ifeq ($(filter product system/product,$(TARGET_COPY_OUT_PRODUCT)),)
411$(error TARGET_COPY_OUT_PRODUCT must be either 'product' or 'system/product', seeing '$(TARGET_COPY_OUT_PRODUCT)'.)
412endif
413PRODUCT_COPY_FILES := $(subst $(_product_path_placeholder),$(TARGET_COPY_OUT_PRODUCT),$(PRODUCT_COPY_FILES))
414
415BOARD_USES_PRODUCTIMAGE :=
416ifdef BOARD_PREBUILT_PRODUCTIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800417 BOARD_USES_PRODUCTIMAGE := true
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900418endif
419ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
Dan Willemsen67495202019-01-16 12:42:05 -0800420 BOARD_USES_PRODUCTIMAGE := true
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900421endif
422ifeq ($(TARGET_COPY_OUT_PRODUCT),product)
Dan Willemsen67495202019-01-16 12:42:05 -0800423 BOARD_USES_PRODUCTIMAGE := true
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900424else ifdef BOARD_USES_PRODUCTIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800425 $(error TARGET_COPY_OUT_PRODUCT must be set to 'product' to use a product image)
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900426endif
Dan Willemsen67495202019-01-16 12:42:05 -0800427.KATI_READONLY := BOARD_USES_PRODUCTIMAGE
428
429BUILDING_PRODUCT_IMAGE :=
430ifeq ($(PRODUCT_BUILD_PRODUCT_IMAGE),)
431 ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
432 BUILDING_PRODUCT_IMAGE := true
433 endif
434else ifeq ($(PRODUCT_BUILD_PRODUCT_IMAGE),true)
435 BUILDING_PRODUCT_IMAGE := true
436 ifndef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
437 $(error PRODUCT_BUILD_PRODUCT_IMAGE set to true, but BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE not defined)
438 endif
439endif
440ifdef BOARD_PREBUILT_PRODUCTIMAGE
441 BUILDING_PRODUCT_IMAGE :=
442endif
443.KATI_READONLY := BUILDING_PRODUCT_IMAGE
Jaekyun Seokb7735d82017-11-27 17:04:47 +0900444
Ying Wang6aef0472014-07-23 20:20:49 -0700445###########################################
Dario Freni5f681e12018-05-29 13:09:01 +0100446# Now we can substitute with the real value of TARGET_COPY_OUT_PRODUCT_SERVICES
Yifan Hongebc041a2018-07-26 16:02:52 -0700447ifeq ($(TARGET_COPY_OUT_PRODUCT_SERVICES),$(_product_services_path_placeholder))
Dan Willemsen67495202019-01-16 12:42:05 -0800448 TARGET_COPY_OUT_PRODUCT_SERVICES := system/product_services
Dario Freni924af7d2018-08-17 00:56:14 +0100449else ifeq ($(filter product_services system/product_services,$(TARGET_COPY_OUT_PRODUCT_SERVICES)),)
Dan Willemsen67495202019-01-16 12:42:05 -0800450 $(error TARGET_COPY_OUT_PRODUCT_SERVICES must be either 'product_services' or 'system/product_services', seeing '$(TARGET_COPY_OUT_PRODUCT_SERVICES)'.)
Dario Freni5f681e12018-05-29 13:09:01 +0100451endif
Bowgo Tsaid2412262018-08-23 15:54:34 +0800452PRODUCT_COPY_FILES := $(subst $(_product_services_path_placeholder),$(TARGET_COPY_OUT_PRODUCT_SERVICES),$(PRODUCT_COPY_FILES))
Dario Freni5f681e12018-05-29 13:09:01 +0100453
454BOARD_USES_PRODUCT_SERVICESIMAGE :=
455ifdef BOARD_PREBUILT_PRODUCT_SERVICESIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800456 BOARD_USES_PRODUCT_SERVICESIMAGE := true
Dario Freni5f681e12018-05-29 13:09:01 +0100457endif
458ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
Dan Willemsen67495202019-01-16 12:42:05 -0800459 BOARD_USES_PRODUCT_SERVICESIMAGE := true
Dario Freni5f681e12018-05-29 13:09:01 +0100460endif
Dario Freni924af7d2018-08-17 00:56:14 +0100461ifeq ($(TARGET_COPY_OUT_PRODUCT_SERVICES),product_services)
Dan Willemsen67495202019-01-16 12:42:05 -0800462 BOARD_USES_PRODUCT_SERVICESIMAGE := true
Dario Freni5f681e12018-05-29 13:09:01 +0100463else ifdef BOARD_USES_PRODUCT_SERVICESIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800464 $(error TARGET_COPY_OUT_PRODUCT_SERVICES must be set to 'product_services' to use a product_services image)
Dario Freni5f681e12018-05-29 13:09:01 +0100465endif
466
Dan Willemsen67495202019-01-16 12:42:05 -0800467BUILDING_PRODUCT_SERVICES_IMAGE :=
Anton Hansson9bab4c22019-01-25 10:15:22 +0000468ifeq ($(PRODUCT_BUILD_PRODUCT_SERVICES_IMAGE),)
Dan Willemsen67495202019-01-16 12:42:05 -0800469 ifdef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
470 BUILDING_PRODUCT_SERVICES_IMAGE := true
471 endif
472else ifeq ($(PRODUCT_BUILD_PRODUCT_SERVICES_IMAGE),true)
473 BUILDING_PRODUCT_SERVICES_IMAGE := true
474 ifndef BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE
475 $(error PRODUCT_BUILD_PRODUCT_SERVICES_IMAGE set to true, but BOARD_PRODUCT_SERVICESIMAGE_FILE_SYSTEM_TYPE not defined)
476 endif
477endif
478ifdef BOARD_PREBUILT_PRODUCT_SERVICESIMAGE
479 BUILDING_PRODUCT_SERVICES_IMAGE :=
480endif
481.KATI_READONLY := BUILDING_PRODUCT_SERVICES_IMAGE
482
Dario Freni5f681e12018-05-29 13:09:01 +0100483###########################################
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800484# Now we can substitute with the real value of TARGET_COPY_OUT_ODM
485ifeq ($(TARGET_COPY_OUT_ODM),$(_odm_path_placeholder))
Dan Willemsen67495202019-01-16 12:42:05 -0800486 TARGET_COPY_OUT_ODM := vendor/odm
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800487else ifeq ($(filter odm vendor/odm,$(TARGET_COPY_OUT_ODM)),)
Dan Willemsen67495202019-01-16 12:42:05 -0800488 $(error TARGET_COPY_OUT_ODM must be either 'odm' or 'vendor/odm', seeing '$(TARGET_COPY_OUT_ODM)'.)
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800489endif
490PRODUCT_COPY_FILES := $(subst $(_odm_path_placeholder),$(TARGET_COPY_OUT_ODM),$(PRODUCT_COPY_FILES))
491
492BOARD_USES_ODMIMAGE :=
493ifdef BOARD_PREBUILT_ODMIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800494 BOARD_USES_ODMIMAGE := true
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800495endif
496ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
Dan Willemsen67495202019-01-16 12:42:05 -0800497 BOARD_USES_ODMIMAGE := true
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800498endif
499ifeq ($(TARGET_COPY_OUT_ODM),odm)
Dan Willemsen67495202019-01-16 12:42:05 -0800500 BOARD_USES_ODMIMAGE := true
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800501else ifdef BOARD_USES_ODMIMAGE
Dan Willemsen67495202019-01-16 12:42:05 -0800502 $(error TARGET_COPY_OUT_ODM must be set to 'odm' to use an odm image)
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800503endif
504
Dan Willemsen67495202019-01-16 12:42:05 -0800505BUILDING_ODM_IMAGE :=
506ifeq ($(ODM_BUILD_ODM_IMAGE),)
507 ifdef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
508 BUILDING_ODM_IMAGE := true
509 endif
510else ifeq ($(PRODUCT_BUILD_ODM_IMAGE),true)
511 BUILDING_ODM_IMAGE := true
512 ifndef BOARD_ODMIMAGE_FILE_SYSTEM_TYPE
513 $(error PRODUCT_BUILD_ODM_IMAGE set to true, but BOARD_ODMIMAGE_FILE_SYSTEM_TYPE not defined)
514 endif
515endif
516ifdef BOARD_PREBUILT_ODMIMAGE
517 BUILDING_ODM_IMAGE :=
518endif
519.KATI_READONLY := BUILDING_ODM_IMAGE
520
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800521###########################################
Dan Willemsen00cf7672017-01-04 17:16:09 -0800522# Ensure that only TARGET_RECOVERY_UPDATER_LIBS *or* AB_OTA_UPDATER is set.
523TARGET_RECOVERY_UPDATER_LIBS ?=
524AB_OTA_UPDATER ?=
525.KATI_READONLY := TARGET_RECOVERY_UPDATER_LIBS AB_OTA_UPDATER
526ifeq ($(AB_OTA_UPDATER),true)
527 ifneq ($(strip $(TARGET_RECOVERY_UPDATER_LIBS)),)
528 $(error Do not use TARGET_RECOVERY_UPDATER_LIBS when using AB_OTA_UPDATER)
529 endif
530endif
Ying Wang6aef0472014-07-23 20:20:49 -0700531
Dan Willemsen2c3289b2017-03-19 13:22:45 -0700532# Check BOARD_VNDK_VERSION
Justin Yun9272ef82017-11-17 16:09:17 +0900533define check_vndk_version
534 $(eval vndk_path := prebuilts/vndk/v$(1)) \
Jae Shin240d97a2017-12-29 15:21:14 +0900535 $(if $(wildcard $(vndk_path)/*/Android.bp),,$(error VNDK version $(1) not found))
Justin Yun9272ef82017-11-17 16:09:17 +0900536endef
537
Dan Willemsen2c3289b2017-03-19 13:22:45 -0700538ifdef BOARD_VNDK_VERSION
539 ifneq ($(BOARD_VNDK_VERSION),current)
Justin Yun2a233b32017-12-07 17:08:19 +0900540 $(error BOARD_VNDK_VERSION: Only "current" is implemented)
Dan Willemsen2c3289b2017-03-19 13:22:45 -0700541 endif
Steven Morelandcbfba702017-07-11 14:59:30 -0700542
543 TARGET_VENDOR_TEST_SUFFIX := /vendor
544else
545 TARGET_VENDOR_TEST_SUFFIX :=
Dan Willemsen2c3289b2017-03-19 13:22:45 -0700546endif
547
Hung-ying Tyan924d2d92018-09-19 16:52:58 +0800548ifeq (,$(TARGET_BUILD_APPS))
Justin Yun9272ef82017-11-17 16:09:17 +0900549ifdef PRODUCT_EXTRA_VNDK_VERSIONS
550 $(foreach v,$(PRODUCT_EXTRA_VNDK_VERSIONS),$(call check_vndk_version,$(v)))
551endif
Hung-ying Tyan924d2d92018-09-19 16:52:58 +0800552endif
Justin Yun9272ef82017-11-17 16:09:17 +0900553
Jiyong Park641b6cc2018-01-15 14:48:40 +0900554# Ensure that BOARD_SYSTEMSDK_VERSIONS are all within PLATFORM_SYSTEMSDK_VERSIONS
555_unsupported_systemsdk_versions := $(filter-out $(PLATFORM_SYSTEMSDK_VERSIONS),$(BOARD_SYSTEMSDK_VERSIONS))
556ifneq (,$(_unsupported_systemsdk_versions))
557 $(error System SDK versions '$(_unsupported_systemsdk_versions)' in BOARD_SYSTEMSDK_VERSIONS are not supported.\
558 Supported versions are $(PLATFORM_SYSTEMSDK_VERSIONS))
559endif
560
The Android Open Source Project88b60792009-03-03 19:28:42 -0800561# ---------------------------------------------------------------
562# Set up configuration for target machine.
563# The following must be set:
564# TARGET_OS = { linux }
Raghu Gandham8da43102012-07-25 19:57:22 -0700565# TARGET_ARCH = { arm | x86 | mips }
The Android Open Source Project88b60792009-03-03 19:28:42 -0800566
The Android Open Source Project88b60792009-03-03 19:28:42 -0800567TARGET_OS := linux
Raghu Gandham8da43102012-07-25 19:57:22 -0700568# TARGET_ARCH should be set by BoardConfig.mk and will be checked later
Ying Wang4b1c95d2014-07-08 17:07:36 -0700569ifneq ($(filter %64,$(TARGET_ARCH)),)
570TARGET_IS_64_BIT := true
571endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800572
573# the target build type defaults to release
574ifneq ($(TARGET_BUILD_TYPE),debug)
575TARGET_BUILD_TYPE := release
576endif
577
The Android Open Source Project88b60792009-03-03 19:28:42 -0800578# ---------------------------------------------------------------
579# figure out the output directories
580
Dan Willemsen60d9c672016-05-27 15:15:47 -0700581SOONG_OUT_DIR := $(OUT_DIR)/soong
582
Dan Willemsend6ed3682017-09-08 14:29:51 -0700583TARGET_OUT_ROOT := $(OUT_DIR)/target
The Android Open Source Project88b60792009-03-03 19:28:42 -0800584
Dan Willemsend6ed3682017-09-08 14:29:51 -0700585HOST_OUT_ROOT := $(OUT_DIR)/host
The Android Open Source Project88b60792009-03-03 19:28:42 -0800586
Dan Willemsen11677ed2018-03-28 14:33:10 -0700587.KATI_READONLY := SOONG_OUT_DIR TARGET_OUT_ROOT HOST_OUT_ROOT
588
Ying Wang6feb6d52014-04-17 10:03:35 -0700589# We want to avoid two host bin directories in multilib build.
Dan Willemsend6ed3682017-09-08 14:29:51 -0700590HOST_OUT := $(HOST_OUT_ROOT)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
Dan Willemsen60d9c672016-05-27 15:15:47 -0700591SOONG_HOST_OUT := $(SOONG_OUT_DIR)/host/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800592
Dan Willemsend6ed3682017-09-08 14:29:51 -0700593HOST_CROSS_OUT := $(HOST_OUT_ROOT)/windows-$(HOST_PREBUILT_ARCH)
Raphael9ca16282010-04-16 17:50:09 -0700594
Dan Willemsen11677ed2018-03-28 14:33:10 -0700595.KATI_READONLY := HOST_OUT SOONG_HOST_OUT HOST_CROSS_OUT
596
Jeff Browne33ba4c2011-07-11 22:11:46 -0700597TARGET_PRODUCT_OUT_ROOT := $(TARGET_OUT_ROOT)/product
The Android Open Source Project88b60792009-03-03 19:28:42 -0800598
599TARGET_COMMON_OUT_ROOT := $(TARGET_OUT_ROOT)/common
600HOST_COMMON_OUT_ROOT := $(HOST_OUT_ROOT)/common
601
602PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_DEVICE)
603
Dan Willemsen11677ed2018-03-28 14:33:10 -0700604.KATI_READONLY := TARGET_PRODUCT_OUT_ROOT TARGET_COMMON_OUT_ROOT HOST_COMMON_OUT_ROOT PRODUCT_OUT
605
The Android Open Source Project88b60792009-03-03 19:28:42 -0800606OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
Dan Albert303e6032017-10-04 10:20:20 -0700607OUT_NDK_DOCS := $(TARGET_COMMON_OUT_ROOT)/ndk-docs
Dan Willemsen11677ed2018-03-28 14:33:10 -0700608.KATI_READONLY := OUT_DOCS OUT_NDK_DOCS
The Android Open Source Project88b60792009-03-03 19:28:42 -0800609
Dan Willemsen11677ed2018-03-28 14:33:10 -0700610$(call KATI_obsolete,BUILD_OUT,Use HOST_OUT instead)
611
612BUILD_OUT_EXECUTABLES := $(HOST_OUT)/bin
Dan Willemsen60d9c672016-05-27 15:15:47 -0700613SOONG_HOST_OUT_EXECUTABLES := $(SOONG_HOST_OUT)/bin
Dan Willemsen11677ed2018-03-28 14:33:10 -0700614.KATI_READONLY := BUILD_OUT_EXECUTABLES SOONG_HOST_OUT_EXECUTABLES
Raphael9ca16282010-04-16 17:50:09 -0700615
Ying Wangc6349742014-01-13 16:14:20 -0800616HOST_OUT_EXECUTABLES := $(HOST_OUT)/bin
Ying Wang36ef50f2014-06-30 17:06:21 -0700617HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib64
Dan Willemsenc6e194f2016-02-13 00:19:40 -0800618HOST_OUT_RENDERSCRIPT_BITCODE := $(HOST_OUT_SHARED_LIBRARIES)
Ying Wangc6349742014-01-13 16:14:20 -0800619HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT)/framework
Joe Onorato64d85d02009-04-09 19:31:12 -0700620HOST_OUT_SDK_ADDON := $(HOST_OUT)/sdk_addon
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800621HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest64
Ryan Campbell81c9d292016-09-12 13:56:50 -0700622HOST_OUT_COVERAGE := $(HOST_OUT)/coverage
Colin Crosse887ccb2018-03-16 22:09:50 -0700623HOST_OUT_TESTCASES := $(HOST_OUT)/testcases
Dan Willemsen11677ed2018-03-28 14:33:10 -0700624.KATI_READONLY := \
625 HOST_OUT_EXECUTABLES \
626 HOST_OUT_SHARED_LIBRARIES \
627 HOST_OUT_RENDERSCRIPT_BITCODE \
628 HOST_OUT_JAVA_LIBRARIES \
629 HOST_OUT_SDK_ADDON \
630 HOST_OUT_NATIVE_TESTS \
631 HOST_OUT_COVERAGE \
632 HOST_OUT_TESTCASES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800633
Dan Willemsen057aaea2015-08-14 12:59:50 -0700634HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT)/bin
635HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800636HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest
Ryan Campbell81c9d292016-09-12 13:56:50 -0700637HOST_CROSS_OUT_COVERAGE := $(HOST_CROSS_OUT)/coverage
Colin Crosse887ccb2018-03-16 22:09:50 -0700638HOST_CROSS_OUT_TESTCASES := $(HOST_CROSS_OUT)/testcases
Dan Willemsen11677ed2018-03-28 14:33:10 -0700639.KATI_READONLY := \
640 HOST_CROSS_OUT_EXECUTABLES \
641 HOST_CROSS_OUT_SHARED_LIBRARIES \
642 HOST_CROSS_OUT_NATIVE_TESTS \
643 HOST_CROSS_OUT_COVERAGE \
644 HOST_CROSS_OUT_TESTCASES
Dan Willemsen057aaea2015-08-14 12:59:50 -0700645
The Android Open Source Project88b60792009-03-03 19:28:42 -0800646HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj
Ying Wangc6349742014-01-13 16:14:20 -0800647HOST_OUT_NOTICE_FILES := $(HOST_OUT_INTERMEDIATES)/NOTICE_FILES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800648HOST_OUT_COMMON_INTERMEDIATES := $(HOST_COMMON_OUT_ROOT)/obj
Ying Wangec900ac2013-11-13 15:56:18 -0800649HOST_OUT_FAKE := $(HOST_OUT)/fake_packages
Dan Willemsen11677ed2018-03-28 14:33:10 -0700650.KATI_READONLY := \
651 HOST_OUT_INTERMEDIATES \
Dan Willemsen11677ed2018-03-28 14:33:10 -0700652 HOST_OUT_NOTICE_FILES \
653 HOST_OUT_COMMON_INTERMEDIATES \
654 HOST_OUT_FAKE
The Android Open Source Project88b60792009-03-03 19:28:42 -0800655
Alexey Polyudovccdc3112016-08-01 17:41:49 -0700656# Nano environment config
657include $(BUILD_SYSTEM)/aux_config.mk
658
Dan Willemsen057aaea2015-08-14 12:59:50 -0700659HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj
Dan Willemsen057aaea2015-08-14 12:59:50 -0700660HOST_CROSS_OUT_NOTICE_FILES := $(HOST_CROSS_OUT_INTERMEDIATES)/NOTICE_FILES
Dan Willemsen11677ed2018-03-28 14:33:10 -0700661.KATI_READONLY := \
662 HOST_CROSS_OUT_INTERMEDIATES \
Dan Willemsen11677ed2018-03-28 14:33:10 -0700663 HOST_CROSS_OUT_NOTICE_FILES
Dan Willemsen057aaea2015-08-14 12:59:50 -0700664
Colin Crossd8262642014-01-24 23:17:21 -0800665HOST_OUT_GEN := $(HOST_OUT)/gen
666HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
Dan Willemsen11677ed2018-03-28 14:33:10 -0700667.KATI_READONLY := \
668 HOST_OUT_GEN \
669 HOST_OUT_COMMON_GEN
Colin Crossd8262642014-01-24 23:17:21 -0800670
Dan Willemsen057aaea2015-08-14 12:59:50 -0700671HOST_CROSS_OUT_GEN := $(HOST_CROSS_OUT)/gen
Dan Willemsen11677ed2018-03-28 14:33:10 -0700672.KATI_READONLY := HOST_CROSS_OUT_GEN
Dan Willemsen057aaea2015-08-14 12:59:50 -0700673
Dan Shi26efd3a2017-11-13 13:38:17 -0800674HOST_OUT_TEST_CONFIG := $(HOST_OUT)/test_config
Dan Willemsen11677ed2018-03-28 14:33:10 -0700675.KATI_READONLY := HOST_OUT_TEST_CONFIG
Dan Shi26efd3a2017-11-13 13:38:17 -0800676
Ying Wang6feb6d52014-04-17 10:03:35 -0700677# Out for HOST_2ND_ARCH
678HOST_2ND_ARCH_VAR_PREFIX := 2ND_
679HOST_2ND_ARCH_MODULE_SUFFIX := _32
680$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj32
Ying Wang966c1e02014-05-20 14:43:51 -0700681$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib
Ying Wang6feb6d52014-04-17 10:03:35 -0700682$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES)
Dan Albertdc941372015-05-04 18:17:52 -0700683$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT_JAVA_LIBRARIES)
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800684$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_NATIVE_TESTS := $(HOST_OUT)/nativetest
Simran Basi7166d1f2017-01-25 15:11:55 -0800685$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_TESTCASES := $(HOST_OUT_TESTCASES)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700686.KATI_READONLY := \
687 HOST_2ND_ARCH_VAR_PREFIX \
688 HOST_2ND_ARCH_MODULE_SUFFIX \
689 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES \
Dan Willemsen11677ed2018-03-28 14:33:10 -0700690 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES \
691 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES \
692 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_JAVA_LIBRARIES \
693 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_NATIVE_TESTS \
694 $(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_TESTCASES
Ying Wang6feb6d52014-04-17 10:03:35 -0700695
Ying Wangc4595862014-06-10 12:04:56 -0700696# The default host library path.
697# It always points to the path where we build libraries in the default bitness.
Ying Wang5bac9622014-08-14 11:03:56 -0700698HOST_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700699.KATI_READONLY := HOST_LIBRARY_PATH
Ying Wang6feb6d52014-04-17 10:03:35 -0700700
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800701# Out for HOST_CROSS_2ND_ARCH
702HOST_CROSS_2ND_ARCH_VAR_PREFIX := 2ND_
703HOST_CROSS_2ND_ARCH_MODULE_SUFFIX := _64
704$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj64
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800705$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib64
706$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT_EXECUTABLES)
Dan Willemsen7fe992c2016-03-02 13:54:51 -0800707$(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_NATIVE_TESTS := $(HOST_CROSS_OUT)/nativetest64
Dan Willemsen11677ed2018-03-28 14:33:10 -0700708.KATI_READONLY := \
709 HOST_CROSS_2ND_ARCH_VAR_PREFIX \
710 HOST_CROSS_2ND_ARCH_MODULE_SUFFIX \
711 $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_INTERMEDIATES \
Dan Willemsen11677ed2018-03-28 14:33:10 -0700712 $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_SHARED_LIBRARIES \
713 $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_EXECUTABLES \
714 $(HOST_CROSS_2ND_ARCH_VAR_PREFIX)HOST_CROSS_OUT_NATIVE_TESTS
Dan Willemsen9ecbf832016-02-05 16:20:19 -0800715
Vishwath Mohand8eabaa2017-05-09 19:36:54 -0700716ifneq ($(filter address,$(SANITIZE_TARGET)),)
717 TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj_asan
718else
719 TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj
720endif
Ying Wangc6349742014-01-13 16:14:20 -0800721TARGET_OUT_HEADERS := $(TARGET_OUT_INTERMEDIATES)/include
Dan Willemsen8cf6b652018-09-05 11:01:12 -0700722.KATI_READONLY := TARGET_OUT_INTERMEDIATES TARGET_OUT_HEADERS
Vishwath Mohand8eabaa2017-05-09 19:36:54 -0700723
724ifneq ($(filter address,$(SANITIZE_TARGET)),)
725 TARGET_OUT_COMMON_INTERMEDIATES := $(TARGET_COMMON_OUT_ROOT)/obj_asan
726else
727 TARGET_OUT_COMMON_INTERMEDIATES := $(TARGET_COMMON_OUT_ROOT)/obj
728endif
Dan Willemsen11677ed2018-03-28 14:33:10 -0700729.KATI_READONLY := TARGET_OUT_COMMON_INTERMEDIATES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800730
Colin Crossd8262642014-01-24 23:17:21 -0800731TARGET_OUT_GEN := $(PRODUCT_OUT)/gen
732TARGET_OUT_COMMON_GEN := $(TARGET_COMMON_OUT_ROOT)/gen
Dan Willemsen11677ed2018-03-28 14:33:10 -0700733.KATI_READONLY := TARGET_OUT_GEN TARGET_OUT_COMMON_GEN
Colin Crossd8262642014-01-24 23:17:21 -0800734
Ying Wang2b6aaa32011-10-27 15:18:39 -0700735TARGET_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700736.KATI_READONLY := TARGET_OUT
Ivan Krasin74b32b82015-09-18 11:54:43 -0700737ifneq ($(filter address,$(SANITIZE_TARGET)),)
Vishwath Mohanb285c462017-03-29 15:32:04 -0700738target_out_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/system
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700739ifeq ($(SANITIZE_LITE),true)
740# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
741# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
742target_out_app_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/system
743else
744target_out_app_base := $(TARGET_OUT)
745endif
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700746else
747target_out_shared_libraries_base := $(TARGET_OUT)
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700748target_out_app_base := $(TARGET_OUT)
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700749endif
750
Ying Wangc6349742014-01-13 16:14:20 -0800751TARGET_OUT_EXECUTABLES := $(TARGET_OUT)/bin
752TARGET_OUT_OPTIONAL_EXECUTABLES := $(TARGET_OUT)/xbin
Ying Wang4b1c95d2014-07-08 17:07:36 -0700753ifeq ($(TARGET_IS_64_BIT),true)
Ying Wangc6349742014-01-13 16:14:20 -0800754# /system/lib always contains 32-bit libraries,
755# and /system/lib64 (if present) always contains 64-bit libraries.
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700756TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800757else
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700758TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800759endif
Dan Willemsenc6e194f2016-02-13 00:19:40 -0800760TARGET_OUT_RENDERSCRIPT_BITCODE := $(TARGET_OUT_SHARED_LIBRARIES)
Ying Wangc6349742014-01-13 16:14:20 -0800761TARGET_OUT_JAVA_LIBRARIES := $(TARGET_OUT)/framework
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700762TARGET_OUT_APPS := $(target_out_app_base)/app
763TARGET_OUT_APPS_PRIVILEGED := $(target_out_app_base)/priv-app
The Android Open Source Project88b60792009-03-03 19:28:42 -0800764TARGET_OUT_KEYLAYOUT := $(TARGET_OUT)/usr/keylayout
765TARGET_OUT_KEYCHARS := $(TARGET_OUT)/usr/keychars
766TARGET_OUT_ETC := $(TARGET_OUT)/etc
Ying Wangc6349742014-01-13 16:14:20 -0800767TARGET_OUT_NOTICE_FILES := $(TARGET_OUT_INTERMEDIATES)/NOTICE_FILES
Dima Zavin531f5242010-09-27 17:37:17 -0700768TARGET_OUT_FAKE := $(PRODUCT_OUT)/fake_packages
Simran Basi7166d1f2017-01-25 15:11:55 -0800769TARGET_OUT_TESTCASES := $(PRODUCT_OUT)/testcases
Dan Shi26efd3a2017-11-13 13:38:17 -0800770TARGET_OUT_TEST_CONFIG := $(PRODUCT_OUT)/test_config
Dan Willemsen11677ed2018-03-28 14:33:10 -0700771.KATI_READONLY := \
772 TARGET_OUT_EXECUTABLES \
773 TARGET_OUT_OPTIONAL_EXECUTABLES \
774 TARGET_OUT_SHARED_LIBRARIES \
775 TARGET_OUT_RENDERSCRIPT_BITCODE \
776 TARGET_OUT_JAVA_LIBRARIES \
777 TARGET_OUT_APPS \
778 TARGET_OUT_APPS_PRIVILEGED \
779 TARGET_OUT_KEYLAYOUT \
780 TARGET_OUT_KEYCHARS \
781 TARGET_OUT_ETC \
782 TARGET_OUT_NOTICE_FILES \
783 TARGET_OUT_FAKE \
784 TARGET_OUT_TESTCASES \
785 TARGET_OUT_TEST_CONFIG
The Android Open Source Project88b60792009-03-03 19:28:42 -0800786
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700787ifeq ($(SANITIZE_LITE),true)
788# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
789# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
790TARGET_OUT_SYSTEM_OTHER := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_SYSTEM_OTHER)
791else
Alex Light4e358ab2016-06-16 14:47:10 -0700792TARGET_OUT_SYSTEM_OTHER := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM_OTHER)
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700793endif
Dan Willemsen11677ed2018-03-28 14:33:10 -0700794.KATI_READONLY := TARGET_OUT_SYSTEM_OTHER
Alex Light4e358ab2016-06-16 14:47:10 -0700795
Ying Wange1d44c32013-12-27 11:09:36 -0800796# Out for TARGET_2ND_ARCH
Ying Wangc4595862014-06-10 12:04:56 -0700797TARGET_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
Ying Wang87538e42016-03-16 19:53:19 -0700798ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
799# With this you can reference the arm binary translation library with libfoo_arm in PRODUCT_PACKAGES.
800TARGET_2ND_ARCH_MODULE_SUFFIX := _$(TARGET_2ND_ARCH)
801else
Ying Wangc4595862014-06-10 12:04:56 -0700802TARGET_2ND_ARCH_MODULE_SUFFIX := $(HOST_2ND_ARCH_MODULE_SUFFIX)
Ying Wang87538e42016-03-16 19:53:19 -0700803endif
Dan Willemsen11677ed2018-03-28 14:33:10 -0700804.KATI_READONLY := TARGET_2ND_ARCH_VAR_PREFIX TARGET_2ND_ARCH_MODULE_SUFFIX
Vishwath Mohand8eabaa2017-05-09 19:36:54 -0700805
806ifneq ($(filter address,$(SANITIZE_TARGET)),)
807 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)_asan
808else
809 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)
810endif
Ying Wang87538e42016-03-16 19:53:19 -0700811ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
812$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
813else
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700814$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700815endif
Dan Willemsenc6e194f2016-02-13 00:19:40 -0800816$(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 -0800817$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
Colin Crossd9574462014-01-24 13:37:07 -0800818$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS := $(TARGET_OUT_APPS)
819$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT_APPS_PRIVILEGED)
Simran Basi7166d1f2017-01-25 15:11:55 -0800820$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_TESTCASES := $(TARGET_OUT_TESTCASES)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700821.KATI_READONLY := \
822 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES \
Dan Willemsen11677ed2018-03-28 14:33:10 -0700823 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES \
824 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_RENDERSCRIPT_BITCODE \
825 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_EXECUTABLES \
826 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS \
827 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS_PRIVILEGED \
828 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_TESTCASES
Ying Wange1d44c32013-12-27 11:09:36 -0800829
Ying Wang2b6aaa32011-10-27 15:18:39 -0700830TARGET_OUT_DATA := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
Ying Wangc6349742014-01-13 16:14:20 -0800831TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
832TARGET_OUT_DATA_SHARED_LIBRARIES := $(TARGET_OUT_SHARED_LIBRARIES)
833TARGET_OUT_DATA_JAVA_LIBRARIES := $(TARGET_OUT_DATA)/framework
834TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA)/app
The Android Open Source Project88b60792009-03-03 19:28:42 -0800835TARGET_OUT_DATA_KEYLAYOUT := $(TARGET_OUT_KEYLAYOUT)
836TARGET_OUT_DATA_KEYCHARS := $(TARGET_OUT_KEYCHARS)
837TARGET_OUT_DATA_ETC := $(TARGET_OUT_ETC)
Ying Wang4b1c95d2014-07-08 17:07:36 -0700838ifeq ($(TARGET_IS_64_BIT),true)
839TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest64
Julien Desprez188a1dd2016-04-12 10:22:06 +0100840TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest64
Steven Morelandcbfba702017-07-11 14:59:30 -0700841TARGET_OUT_VENDOR_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest64$(TARGET_VENDOR_TEST_SUFFIX)
842TARGET_OUT_VENDOR_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest64$(TARGET_VENDOR_TEST_SUFFIX)
Ying Wang4b1c95d2014-07-08 17:07:36 -0700843else
Ying Wang4c681742010-07-20 11:08:47 -0700844TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
Julien Desprez188a1dd2016-04-12 10:22:06 +0100845TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest
Steven Morelandcbfba702017-07-11 14:59:30 -0700846TARGET_OUT_VENDOR_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest$(TARGET_VENDOR_TEST_SUFFIX)
847TARGET_OUT_VENDOR_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest$(TARGET_VENDOR_TEST_SUFFIX)
Ying Wang4b1c95d2014-07-08 17:07:36 -0700848endif
Tsu Chiang Chuang40da8832012-07-13 13:47:09 -0700849TARGET_OUT_DATA_FAKE := $(TARGET_OUT_DATA)/fake_packages
Dan Willemsen11677ed2018-03-28 14:33:10 -0700850.KATI_READONLY := \
851 TARGET_OUT_DATA \
852 TARGET_OUT_DATA_EXECUTABLES \
853 TARGET_OUT_DATA_SHARED_LIBRARIES \
854 TARGET_OUT_DATA_JAVA_LIBRARIES \
855 TARGET_OUT_DATA_APPS \
856 TARGET_OUT_DATA_KEYLAYOUT \
857 TARGET_OUT_DATA_KEYCHARS \
858 TARGET_OUT_DATA_ETC \
859 TARGET_OUT_DATA_NATIVE_TESTS \
860 TARGET_OUT_DATA_METRIC_TESTS \
861 TARGET_OUT_VENDOR_NATIVE_TESTS \
862 TARGET_OUT_VENDOR_METRIC_TESTS \
863 TARGET_OUT_DATA_FAKE
The Android Open Source Project88b60792009-03-03 19:28:42 -0800864
Ying Wange3d06792014-01-23 15:09:04 -0800865$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_DATA_EXECUTABLES)
866$(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 -0800867$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA_APPS)
Ying Wang87538e42016-03-16 19:53:19 -0700868ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
869$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest/$(TARGET_2ND_ARCH)
Guang Zhu97069b02016-04-12 13:06:20 -0700870$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest/$(TARGET_2ND_ARCH)
Steven Morelandcbfba702017-07-11 14:59:30 -0700871$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest/$(TARGET_2ND_ARCH)$(TARGET_VENDOR_TEST_SUFFIX)
872$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest/$(TARGET_2ND_ARCH)$(TARGET_VENDOR_TEST_SUFFIX)
Ying Wang87538e42016-03-16 19:53:19 -0700873else
Ying Wang4b1c95d2014-07-08 17:07:36 -0700874$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
Julien Desprez188a1dd2016-04-12 10:22:06 +0100875$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest
Steven Morelandcbfba702017-07-11 14:59:30 -0700876$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest$(TARGET_VENDOR_TEST_SUFFIX)
877$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_METRIC_TESTS := $(TARGET_OUT_DATA)/benchmarktest$(TARGET_VENDOR_TEST_SUFFIX)
Ying Wang87538e42016-03-16 19:53:19 -0700878endif
Dan Willemsen11677ed2018-03-28 14:33:10 -0700879.KATI_READONLY := \
880 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_EXECUTABLES \
881 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_SHARED_LIBRARIES \
882 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_APPS \
883 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS \
884 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_METRIC_TESTS \
885 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_NATIVE_TESTS \
886 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_METRIC_TESTS \
Ying Wange3d06792014-01-23 15:09:04 -0800887
Ying Wang9f8e8db2011-11-04 11:37:01 -0700888TARGET_OUT_CACHE := $(PRODUCT_OUT)/cache
Dan Willemsen11677ed2018-03-28 14:33:10 -0700889.KATI_READONLY := TARGET_OUT_CACHE
Ying Wang9f8e8db2011-11-04 11:37:01 -0700890
Ying Wang2b6aaa32011-10-27 15:18:39 -0700891TARGET_OUT_VENDOR := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700892.KATI_READONLY := TARGET_OUT_VENDOR
Ivan Krasin74b32b82015-09-18 11:54:43 -0700893ifneq ($(filter address,$(SANITIZE_TARGET)),)
Anton Hanssonae9f1052018-10-02 13:16:05 +0100894target_out_vendor_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_VENDOR)
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700895ifeq ($(SANITIZE_LITE),true)
896# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
897# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
Anton Hanssonae9f1052018-10-02 13:16:05 +0100898target_out_vendor_app_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_VENDOR)
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700899else
900target_out_vendor_app_base := $(TARGET_OUT_VENDOR)
901endif
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700902else
903target_out_vendor_shared_libraries_base := $(TARGET_OUT_VENDOR)
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700904target_out_vendor_app_base := $(TARGET_OUT_VENDOR)
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700905endif
906
Ying Wangc6349742014-01-13 16:14:20 -0800907TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR)/bin
908TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES := $(TARGET_OUT_VENDOR)/xbin
Ying Wang4b1c95d2014-07-08 17:07:36 -0700909ifeq ($(TARGET_IS_64_BIT),true)
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700910TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800911else
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700912TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800913endif
Miao Wang57be5642017-03-01 19:39:19 -0800914TARGET_OUT_VENDOR_RENDERSCRIPT_BITCODE := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)
Ying Wangc6349742014-01-13 16:14:20 -0800915TARGET_OUT_VENDOR_JAVA_LIBRARIES := $(TARGET_OUT_VENDOR)/framework
Andreas Gampe4ed21d12017-06-16 10:24:54 -0700916TARGET_OUT_VENDOR_APPS := $(target_out_vendor_app_base)/app
917TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(target_out_vendor_app_base)/priv-app
Ying Wang8f779362011-09-13 13:57:26 -0700918TARGET_OUT_VENDOR_ETC := $(TARGET_OUT_VENDOR)/etc
Dan Willemsen11677ed2018-03-28 14:33:10 -0700919.KATI_READONLY := \
920 TARGET_OUT_VENDOR_EXECUTABLES \
921 TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES \
922 TARGET_OUT_VENDOR_SHARED_LIBRARIES \
923 TARGET_OUT_VENDOR_RENDERSCRIPT_BITCODE \
924 TARGET_OUT_VENDOR_JAVA_LIBRARIES \
925 TARGET_OUT_VENDOR_APPS \
926 TARGET_OUT_VENDOR_APPS_PRIVILEGED \
927 TARGET_OUT_VENDOR_ETC
Ying Wang8f779362011-09-13 13:57:26 -0700928
Ying Wange3d06792014-01-23 15:09:04 -0800929$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR_EXECUTABLES)
Ying Wang87538e42016-03-16 19:53:19 -0700930ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
Andreas Gampecf6268f2016-06-30 20:20:38 -0700931$(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 -0700932else
Andreas Gampecf6268f2016-06-30 20:20:38 -0700933$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700934endif
Miao Wang57be5642017-03-01 19:39:19 -0800935$(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 -0800936$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR_APPS)
Hung-ying Tyan665e7402016-07-20 17:51:56 +0800937$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(TARGET_OUT_VENDOR_APPS_PRIVILEGED)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700938.KATI_READONLY := \
939 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_EXECUTABLES \
940 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES \
941 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_RENDERSCRIPT_BITCODE \
942 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS \
943 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS_PRIVILEGED
Ying Wang61d499b2014-01-15 16:02:16 -0800944
Ying Wangb8888432014-03-11 17:13:27 -0700945TARGET_OUT_OEM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_OEM)
Ying Wangf15250e2014-06-26 14:12:35 -0700946TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM)/bin
Ying Wang4540a852015-03-12 18:30:39 -0700947ifeq ($(TARGET_IS_64_BIT),true)
Ying Wangf15250e2014-06-26 14:12:35 -0700948TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib64
949else
950TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
951endif
Ying Wangb8888432014-03-11 17:13:27 -0700952# We don't expect Java libraries in the oem.img.
953# TARGET_OUT_OEM_JAVA_LIBRARIES:= $(TARGET_OUT_OEM)/framework
Ying Wangf15250e2014-06-26 14:12:35 -0700954TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM)/app
Ying Wangb8888432014-03-11 17:13:27 -0700955TARGET_OUT_OEM_ETC := $(TARGET_OUT_OEM)/etc
Dan Willemsen11677ed2018-03-28 14:33:10 -0700956.KATI_READONLY := \
957 TARGET_OUT_OEM \
958 TARGET_OUT_OEM_EXECUTABLES \
959 TARGET_OUT_OEM_SHARED_LIBRARIES \
960 TARGET_OUT_OEM_APPS \
961 TARGET_OUT_OEM_ETC
Ying Wangb8888432014-03-11 17:13:27 -0700962
Ying Wangf15250e2014-06-26 14:12:35 -0700963$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM_EXECUTABLES)
Ying Wang87538e42016-03-16 19:53:19 -0700964ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
965$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib/$(TARGET_2ND_ARCH)
966else
Ying Wangf15250e2014-06-26 14:12:35 -0700967$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
Ying Wang87538e42016-03-16 19:53:19 -0700968endif
Ying Wangf15250e2014-06-26 14:12:35 -0700969$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM_APPS)
Dan Willemsen11677ed2018-03-28 14:33:10 -0700970.KATI_READONLY := \
971 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_EXECUTABLES \
972 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES \
973 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_APPS \
Ying Wangf15250e2014-06-26 14:12:35 -0700974
Ying Wang4540a852015-03-12 18:30:39 -0700975TARGET_OUT_ODM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ODM)
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800976ifneq ($(filter address,$(SANITIZE_TARGET)),)
Anton Hanssonae9f1052018-10-02 13:16:05 +0100977target_out_odm_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_OEM)
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800978ifeq ($(SANITIZE_LITE),true)
979# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
980# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
Anton Hanssonae9f1052018-10-02 13:16:05 +0100981target_out_odm_app_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_OEM)
Ying Wang4540a852015-03-12 18:30:39 -0700982else
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800983target_out_odm_app_base := $(TARGET_OUT_ODM)
Ying Wang4540a852015-03-12 18:30:39 -0700984endif
Bowgo Tsaid624fa62017-11-14 23:42:30 +0800985else
986target_out_odm_shared_libraries_base := $(TARGET_OUT_ODM)
987target_out_odm_app_base := $(TARGET_OUT_ODM)
988endif
989
990TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM)/bin
991TARGET_OUT_ODM_OPTIONAL_EXECUTABLES := $(TARGET_OUT_ODM)/xbin
992ifeq ($(TARGET_IS_64_BIT),true)
993TARGET_OUT_ODM_SHARED_LIBRARIES := $(target_out_odm_shared_libraries_base)/lib64
994else
995TARGET_OUT_ODM_SHARED_LIBRARIES := $(target_out_odm_shared_libraries_base)/lib
996endif
997TARGET_OUT_ODM_RENDERSCRIPT_BITCODE := $(TARGET_OUT_ODM_SHARED_LIBRARIES)
998TARGET_OUT_ODM_JAVA_LIBRARIES := $(TARGET_OUT_ODM)/framework
999TARGET_OUT_ODM_APPS := $(target_out_odm_app_base)/app
1000TARGET_OUT_ODM_APPS_PRIVILEGED := $(target_out_odm_app_base)/priv-app
Ying Wang4540a852015-03-12 18:30:39 -07001001TARGET_OUT_ODM_ETC := $(TARGET_OUT_ODM)/etc
Dan Willemsen11677ed2018-03-28 14:33:10 -07001002.KATI_READONLY := \
1003 TARGET_OUT_ODM \
1004 TARGET_OUT_ODM_EXECUTABLES \
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001005 TARGET_OUT_ODM_OPTIONAL_EXECUTABLES \
Dan Willemsen11677ed2018-03-28 14:33:10 -07001006 TARGET_OUT_ODM_SHARED_LIBRARIES \
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001007 TARGET_OUT_ODM_RENDERSCRIPT_BITCODE \
1008 TARGET_OUT_ODM_JAVA_LIBRARIES \
Dan Willemsen11677ed2018-03-28 14:33:10 -07001009 TARGET_OUT_ODM_APPS \
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001010 TARGET_OUT_ODM_APPS_PRIVILEGED \
Dan Willemsen11677ed2018-03-28 14:33:10 -07001011 TARGET_OUT_ODM_ETC
Ying Wang4540a852015-03-12 18:30:39 -07001012
1013$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM_EXECUTABLES)
Ying Wang87538e42016-03-16 19:53:19 -07001014ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001015$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(target_out_odm_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
Ying Wang87538e42016-03-16 19:53:19 -07001016else
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001017$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(target_out_odm_shared_libraries_base)/lib
Ying Wang87538e42016-03-16 19:53:19 -07001018endif
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001019$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_RENDERSCRIPT_BITCODE := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES)
Ying Wang4540a852015-03-12 18:30:39 -07001020$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM_APPS)
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001021$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS_PRIVILEGED := $(TARGET_OUT_ODM_APPS_PRIVILEGED)
Dan Willemsen11677ed2018-03-28 14:33:10 -07001022.KATI_READONLY := \
1023 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_EXECUTABLES \
1024 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES \
Bowgo Tsaid624fa62017-11-14 23:42:30 +08001025 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_RENDERSCRIPT_BITCODE \
1026 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS \
1027 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS_PRIVILEGED
Ying Wang4540a852015-03-12 18:30:39 -07001028
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001029TARGET_OUT_PRODUCT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_PRODUCT)
Doheon Lee09d9b902018-06-25 10:56:01 +09001030TARGET_OUT_PRODUCT_EXECUTABLES := $(TARGET_OUT_PRODUCT)/bin
Dan Willemsen11677ed2018-03-28 14:33:10 -07001031.KATI_READONLY := TARGET_OUT_PRODUCT
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001032ifneq ($(filter address,$(SANITIZE_TARGET)),)
Anton Hanssonae9f1052018-10-02 13:16:05 +01001033target_out_product_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_PRODUCT)
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001034ifeq ($(SANITIZE_LITE),true)
1035# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
1036# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
Anton Hanssonae9f1052018-10-02 13:16:05 +01001037target_out_product_app_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_PRODUCT)
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001038else
1039target_out_product_app_base := $(TARGET_OUT_PRODUCT)
1040endif
1041else
Inseob Kim47c13522018-05-04 11:20:43 +09001042target_out_product_shared_libraries_base := $(TARGET_OUT_PRODUCT)
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001043target_out_product_app_base := $(TARGET_OUT_PRODUCT)
1044endif
1045
1046ifeq ($(TARGET_IS_64_BIT),true)
1047TARGET_OUT_PRODUCT_SHARED_LIBRARIES := $(target_out_product_shared_libraries_base)/lib64
1048else
1049TARGET_OUT_PRODUCT_SHARED_LIBRARIES := $(target_out_product_shared_libraries_base)/lib
1050endif
Dan Willemsen11677ed2018-03-28 14:33:10 -07001051TARGET_OUT_PRODUCT_JAVA_LIBRARIES := $(TARGET_OUT_PRODUCT)/framework
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001052TARGET_OUT_PRODUCT_APPS := $(target_out_product_app_base)/app
1053TARGET_OUT_PRODUCT_APPS_PRIVILEGED := $(target_out_product_app_base)/priv-app
1054TARGET_OUT_PRODUCT_ETC := $(TARGET_OUT_PRODUCT)/etc
Dan Willemsen11677ed2018-03-28 14:33:10 -07001055.KATI_READONLY := \
Doheon Lee09d9b902018-06-25 10:56:01 +09001056 TARGET_OUT_PRODUCT_EXECUTABLES \
Dan Willemsen11677ed2018-03-28 14:33:10 -07001057 TARGET_OUT_PRODUCT_SHARED_LIBRARIES \
1058 TARGET_OUT_PRODUCT_JAVA_LIBRARIES \
1059 TARGET_OUT_PRODUCT_APPS \
1060 TARGET_OUT_PRODUCT_APPS_PRIVILEGED \
1061 TARGET_OUT_PRODUCT_ETC
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001062
Doheon Lee09d9b902018-06-25 10:56:01 +09001063$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_EXECUTABLES := $(TARGET_OUT_PRODUCT_EXECUTABLES)
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001064ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
1065$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SHARED_LIBRARIES := $(target_out_product_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
1066else
1067$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SHARED_LIBRARIES := $(target_out_product_shared_libraries_base)/lib
1068endif
1069$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_APPS := $(TARGET_OUT_PRODUCT_APPS)
1070$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_APPS_PRIVILEGED := $(TARGET_OUT_PRODUCT_APPS_PRIVILEGED)
Dan Willemsen11677ed2018-03-28 14:33:10 -07001071.KATI_READONLY := \
Doheon Lee09d9b902018-06-25 10:56:01 +09001072 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_EXECUTABLES \
Dan Willemsen11677ed2018-03-28 14:33:10 -07001073 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SHARED_LIBRARIES \
1074 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_APPS \
1075 $(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_APPS_PRIVILEGED
Jaekyun Seokb7735d82017-11-27 17:04:47 +09001076
Dario Freni5f681e12018-05-29 13:09:01 +01001077TARGET_OUT_PRODUCT_SERVICES := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_PRODUCT_SERVICES)
1078ifneq ($(filter address,$(SANITIZE_TARGET)),)
Anton Hanssonae9f1052018-10-02 13:16:05 +01001079target_out_product_services_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_PRODUCT_SERVICES)
Dario Freni5f681e12018-05-29 13:09:01 +01001080ifeq ($(SANITIZE_LITE),true)
1081# When using SANITIZE_LITE, APKs must not be packaged with sanitized libraries, as they will not
1082# work with unsanitized app_process. For simplicity, generate APKs into /data/asan/.
Anton Hanssonae9f1052018-10-02 13:16:05 +01001083target_out_product_services_app_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ASAN)/$(TARGET_COPY_OUT_PRODUCT_SERVICES)
Dario Freni5f681e12018-05-29 13:09:01 +01001084else
Yifan Hongebc041a2018-07-26 16:02:52 -07001085target_out_product_services_app_base := $(TARGET_OUT_PRODUCT_SERVICES)
Dario Freni5f681e12018-05-29 13:09:01 +01001086endif
1087else
Yifan Hongebc041a2018-07-26 16:02:52 -07001088target_out_product_services_shared_libraries_base := $(TARGET_OUT_PRODUCT_SERVICES)
1089target_out_product_services_app_base := $(TARGET_OUT_PRODUCT_SERVICES)
Dario Freni5f681e12018-05-29 13:09:01 +01001090endif
1091
1092ifeq ($(TARGET_IS_64_BIT),true)
Yifan Hongebc041a2018-07-26 16:02:52 -07001093TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib64
Dario Freni5f681e12018-05-29 13:09:01 +01001094else
Yifan Hongebc041a2018-07-26 16:02:52 -07001095TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib
Dario Freni5f681e12018-05-29 13:09:01 +01001096endif
1097TARGET_OUT_PRODUCT_SERVICES_JAVA_LIBRARIES:= $(TARGET_OUT_PRODUCT_SERVICES)/framework
Yifan Hongebc041a2018-07-26 16:02:52 -07001098TARGET_OUT_PRODUCT_SERVICES_APPS := $(target_out_product_services_app_base)/app
1099TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED := $(target_out_product_services_app_base)/priv-app
Dario Freni5f681e12018-05-29 13:09:01 +01001100TARGET_OUT_PRODUCT_SERVICES_ETC := $(TARGET_OUT_PRODUCT_SERVICES)/etc
1101
1102ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
Yifan Hongebc041a2018-07-26 16:02:52 -07001103$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib/$(TARGET_2ND_ARCH)
Dario Freni5f681e12018-05-29 13:09:01 +01001104else
Yifan Hongebc041a2018-07-26 16:02:52 -07001105$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_SHARED_LIBRARIES := $(target_out_product_services_shared_libraries_base)/lib
Dario Freni5f681e12018-05-29 13:09:01 +01001106endif
1107$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_APPS := $(TARGET_OUT_PRODUCT_SERVICES_APPS)
1108$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED := $(TARGET_OUT_PRODUCT_SERVICES_APPS_PRIVILEGED)
1109
Steve Fungdfbab492015-09-24 18:12:33 -07001110TARGET_OUT_BREAKPAD := $(PRODUCT_OUT)/breakpad
Dan Willemsen11677ed2018-03-28 14:33:10 -07001111.KATI_READONLY := TARGET_OUT_BREAKPAD
Steve Fungdfbab492015-09-24 18:12:33 -07001112
The Android Open Source Project88b60792009-03-03 19:28:42 -08001113TARGET_OUT_UNSTRIPPED := $(PRODUCT_OUT)/symbols
1114TARGET_OUT_EXECUTABLES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/bin
1115TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/lib
Colin Crossa58f8e02014-06-20 13:33:36 -07001116TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/$(TARGET_COPY_OUT_VENDOR)/lib
The Android Open Source Project88b60792009-03-03 19:28:42 -08001117TARGET_ROOT_OUT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)
1118TARGET_ROOT_OUT_SBIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/sbin
1119TARGET_ROOT_OUT_BIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/bin
Ryan Campbell737bc022016-09-15 17:32:13 -07001120TARGET_OUT_COVERAGE := $(PRODUCT_OUT)/coverage
Dan Willemsen11677ed2018-03-28 14:33:10 -07001121.KATI_READONLY := \
1122 TARGET_OUT_UNSTRIPPED \
1123 TARGET_OUT_EXECUTABLES_UNSTRIPPED \
1124 TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED \
1125 TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED \
1126 TARGET_ROOT_OUT_UNSTRIPPED \
1127 TARGET_ROOT_OUT_SBIN_UNSTRIPPED \
1128 TARGET_ROOT_OUT_BIN_UNSTRIPPED \
1129 TARGET_OUT_COVERAGE
The Android Open Source Project88b60792009-03-03 19:28:42 -08001130
Tom Cherryd14b8952018-08-09 14:26:00 -07001131TARGET_RAMDISK_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_RAMDISK)
1132TARGET_RAMDISK_OUT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)
1133
Ying Wang2b6aaa32011-10-27 15:18:39 -07001134TARGET_ROOT_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ROOT)
The Android Open Source Project88b60792009-03-03 19:28:42 -08001135TARGET_ROOT_OUT_BIN := $(TARGET_ROOT_OUT)/bin
1136TARGET_ROOT_OUT_SBIN := $(TARGET_ROOT_OUT)/sbin
1137TARGET_ROOT_OUT_ETC := $(TARGET_ROOT_OUT)/etc
1138TARGET_ROOT_OUT_USR := $(TARGET_ROOT_OUT)/usr
Dan Willemsen11677ed2018-03-28 14:33:10 -07001139.KATI_READONLY := \
1140 TARGET_ROOT_OUT \
1141 TARGET_ROOT_OUT_BIN \
1142 TARGET_ROOT_OUT_SBIN \
1143 TARGET_ROOT_OUT_ETC \
1144 TARGET_ROOT_OUT_USR
The Android Open Source Project88b60792009-03-03 19:28:42 -08001145
Ying Wang2b6aaa32011-10-27 15:18:39 -07001146TARGET_RECOVERY_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_RECOVERY)
The Android Open Source Project88b60792009-03-03 19:28:42 -08001147TARGET_RECOVERY_ROOT_OUT := $(TARGET_RECOVERY_OUT)/root
Dan Willemsen11677ed2018-03-28 14:33:10 -07001148.KATI_READONLY := \
1149 TARGET_RECOVERY_OUT \
1150 TARGET_RECOVERY_ROOT_OUT
The Android Open Source Project88b60792009-03-03 19:28:42 -08001151
1152TARGET_SYSLOADER_OUT := $(PRODUCT_OUT)/sysloader
1153TARGET_SYSLOADER_ROOT_OUT := $(TARGET_SYSLOADER_OUT)/root
1154TARGET_SYSLOADER_SYSTEM_OUT := $(TARGET_SYSLOADER_OUT)/root/system
Dan Willemsen11677ed2018-03-28 14:33:10 -07001155.KATI_READONLY := \
1156 TARGET_SYSLOADER_OUT \
1157 TARGET_SYSLOADER_ROOT_OUT \
1158 TARGET_SYSLOADER_SYSTEM_OUT
The Android Open Source Project88b60792009-03-03 19:28:42 -08001159
1160TARGET_INSTALLER_OUT := $(PRODUCT_OUT)/installer
1161TARGET_INSTALLER_DATA_OUT := $(TARGET_INSTALLER_OUT)/data
1162TARGET_INSTALLER_ROOT_OUT := $(TARGET_INSTALLER_OUT)/root
1163TARGET_INSTALLER_SYSTEM_OUT := $(TARGET_INSTALLER_OUT)/root/system
Dan Willemsen11677ed2018-03-28 14:33:10 -07001164.KATI_READONLY := \
1165 TARGET_INSTALLER_OUT \
1166 TARGET_INSTALLER_DATA_OUT \
1167 TARGET_INSTALLER_ROOT_OUT \
1168 TARGET_INSTALLER_SYSTEM_OUT
The Android Open Source Project88b60792009-03-03 19:28:42 -08001169
Ying Wanga83940f2010-09-24 18:09:04 -07001170COMMON_MODULE_CLASSES := TARGET-NOTICE_FILES HOST-NOTICE_FILES HOST-JAVA_LIBRARIES
Dan Willemsen8dae49c2017-02-15 15:48:11 -08001171PER_ARCH_MODULE_CLASSES := SHARED_LIBRARIES STATIC_LIBRARIES EXECUTABLES GYP RENDERSCRIPT_BITCODE NATIVE_TESTS HEADER_LIBRARIES
Dan Willemsen11677ed2018-03-28 14:33:10 -07001172.KATI_READONLY := COMMON_MODULE_CLASSES PER_ARCH_MODULE_CLASSES
The Android Open Source Project88b60792009-03-03 19:28:42 -08001173
Dan Willemsen20f99a62017-10-12 01:35:14 -07001174ifeq ($(CALLED_FROM_SETUP),true)
Dan Willemsen0d255292017-02-18 10:32:13 -08001175PRINT_BUILD_CONFIG ?= true
The Android Open Source Project88b60792009-03-03 19:28:42 -08001176endif