blob: 4c774422013d36cf6a0afea6bb52c7e19712d658 [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
Joe Onoratoeefd0212009-05-13 00:45:23 -040014# Set up version information.
15include $(BUILD_SYSTEM)/version_defaults.mk
16
The Android Open Source Project88b60792009-03-03 19:28:42 -080017# ---------------------------------------------------------------
18# If you update the build system such that the environment setup
19# or buildspec.mk need to be updated, increment this number, and
20# people who haven't re-run those will have to do so before they
21# can build. Make sure to also update the corresponding value in
22# buildspec.mk.default and envsetup.sh.
Jeff Hamilton77dfeae2010-06-21 18:26:38 -050023CORRECT_BUILD_ENV_SEQUENCE_NUMBER := 10
The Android Open Source Project88b60792009-03-03 19:28:42 -080024
25# ---------------------------------------------------------------
Jeff Browne33ba4c2011-07-11 22:11:46 -070026# The product defaults to generic on hardware
The Android Open Source Project88b60792009-03-03 19:28:42 -080027# NOTE: This will be overridden in product_config.mk if make
28# was invoked with a PRODUCT-xxx-yyy goal.
29ifeq ($(TARGET_PRODUCT),)
Ying Wang0a76df52015-06-08 11:57:26 -070030TARGET_PRODUCT := aosp_arm
The Android Open Source Project88b60792009-03-03 19:28:42 -080031endif
The Android Open Source Project88b60792009-03-03 19:28:42 -080032
33
34# the variant -- the set of files that are included for a build
35ifeq ($(strip $(TARGET_BUILD_VARIANT)),)
36TARGET_BUILD_VARIANT := eng
37endif
38
The Android Open Source Project88b60792009-03-03 19:28:42 -080039# ---------------------------------------------------------------
40# Set up configuration for host machine. We don't do cross-
Raghu Gandham8da43102012-07-25 19:57:22 -070041# compiles except for arm/mips, so the HOST is whatever we are
The Android Open Source Project88b60792009-03-03 19:28:42 -080042# running on
43
44UNAME := $(shell uname -sm)
45
46# HOST_OS
47ifneq (,$(findstring Linux,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -070048 HOST_OS := linux
The Android Open Source Project88b60792009-03-03 19:28:42 -080049endif
50ifneq (,$(findstring Darwin,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -070051 HOST_OS := darwin
The Android Open Source Project88b60792009-03-03 19:28:42 -080052endif
53ifneq (,$(findstring Macintosh,$(UNAME)))
Ying Wang6feb6d52014-04-17 10:03:35 -070054 HOST_OS := darwin
The Android Open Source Project88b60792009-03-03 19:28:42 -080055endif
Raphael9ca16282010-04-16 17:50:09 -070056
57# BUILD_OS is the real host doing the build.
58BUILD_OS := $(HOST_OS)
59
Dan Willemsen057aaea2015-08-14 12:59:50 -070060HOST_CROSS_OS :=
61# We can cross-build Windows binaries on Linux
Raphael9ca16282010-04-16 17:50:09 -070062ifeq ($(HOST_OS),linux)
Dan Willemsen057aaea2015-08-14 12:59:50 -070063HOST_CROSS_OS := windows
64HOST_CROSS_ARCH := x86
Raphael9ca16282010-04-16 17:50:09 -070065endif
The Android Open Source Project88b60792009-03-03 19:28:42 -080066
67ifeq ($(HOST_OS),)
68$(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
69endif
70
The Android Open Source Project88b60792009-03-03 19:28:42 -080071# HOST_ARCH
Ying Wang6feb6d52014-04-17 10:03:35 -070072ifneq (,$(findstring x86_64,$(UNAME)))
Ying Wang2713fce2014-06-09 12:31:12 -070073 HOST_ARCH := x86_64
74 HOST_2ND_ARCH := x86
Ying Wang4b1c95d2014-07-08 17:07:36 -070075 HOST_IS_64_BIT := true
Brian Carlstrom2cd8a742015-03-20 11:39:00 -070076else
77ifneq (,$(findstring x86,$(UNAME)))
78$(error Building on a 32-bit x86 host is not supported: $(UNAME)!)
79endif
The Android Open Source Project88b60792009-03-03 19:28:42 -080080endif
81
Raphael9ca16282010-04-16 17:50:09 -070082BUILD_ARCH := $(HOST_ARCH)
Ying Wang6feb6d52014-04-17 10:03:35 -070083BUILD_2ND_ARCH := $(HOST_2ND_ARCH)
Raphael9ca16282010-04-16 17:50:09 -070084
The Android Open Source Project88b60792009-03-03 19:28:42 -080085ifeq ($(HOST_ARCH),)
86$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
87endif
88
89# the host build defaults to release, and it must be release or debug
90ifeq ($(HOST_BUILD_TYPE),)
91HOST_BUILD_TYPE := release
92endif
93
94ifneq ($(HOST_BUILD_TYPE),release)
95ifneq ($(HOST_BUILD_TYPE),debug)
96$(error HOST_BUILD_TYPE must be either release or debug, not '$(HOST_BUILD_TYPE)')
97endif
98endif
99
Ying Wang6feb6d52014-04-17 10:03:35 -0700100# We don't want to move all the prebuilt host tools to a $(HOST_OS)-x86_64 dir.
101HOST_PREBUILT_ARCH := x86
The Android Open Source Project88b60792009-03-03 19:28:42 -0800102# This is the standard way to name a directory containing prebuilt host
103# objects. E.g., prebuilt/$(HOST_PREBUILT_TAG)/cc
Dan Albert216ecac2015-05-04 12:44:44 -0700104HOST_PREBUILT_TAG := $(BUILD_OS)-$(HOST_PREBUILT_ARCH)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800105
Ying Wang2b6aaa32011-10-27 15:18:39 -0700106# TARGET_COPY_OUT_* are all relative to the staging directory, ie PRODUCT_OUT.
107# Define them here so they can be used in product config files.
108TARGET_COPY_OUT_SYSTEM := system
109TARGET_COPY_OUT_DATA := data
Ying Wangb8888432014-03-11 17:13:27 -0700110TARGET_COPY_OUT_OEM := oem
Ying Wang4540a852015-03-12 18:30:39 -0700111TARGET_COPY_OUT_ODM := odm
Ying Wang2b6aaa32011-10-27 15:18:39 -0700112TARGET_COPY_OUT_ROOT := root
113TARGET_COPY_OUT_RECOVERY := recovery
Ying Wang6aef0472014-07-23 20:20:49 -0700114###########################################
115# Define TARGET_COPY_OUT_VENDOR to a placeholder, for at this point
116# we don't know if the device wants to build a separate vendor.img
117# or just build vendor stuff into system.img.
118# A device can set up TARGET_COPY_OUT_VENDOR to "vendor" in its
119# BoardConfig.mk.
120# We'll substitute with the real value after loading BoardConfig.mk.
121_vendor_path_placeholder := ||VENDOR-PATH-PH||
122TARGET_COPY_OUT_VENDOR := $(_vendor_path_placeholder)
123###########################################
Ying Wang2b6aaa32011-10-27 15:18:39 -0700124
Ying Wang6aef0472014-07-23 20:20:49 -0700125# Read the product specs so we can get TARGET_DEVICE and other
Ryo Fujiicbb32662011-06-16 16:58:11 -0700126# variables that we need in order to locate the output files.
127include $(BUILD_SYSTEM)/product_config.mk
Jesse Wilsonce7d5022010-09-22 10:59:10 -0700128
Ying Wangd0244b32011-11-17 14:51:12 -0800129build_variant := $(filter-out eng user userdebug,$(TARGET_BUILD_VARIANT))
Ryo Fujiicbb32662011-06-16 16:58:11 -0700130ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1)
131$(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT))
Ying Wangd0244b32011-11-17 14:51:12 -0800132$(error must be empty or one of: eng user userdebug)
Ryo Fujiicbb32662011-06-16 16:58:11 -0700133endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800134
Ying Wang7ba7d7f2014-09-02 15:11:20 -0700135SDK_HOST_ARCH := x86
136
Ying Wangc6349742014-01-13 16:14:20 -0800137# Boards may be defined under $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)
138# or under vendor/*/$(TARGET_DEVICE). Search in both places, but
139# make sure only one exists.
140# Real boards should always be associated with an OEM vendor.
141board_config_mk := \
Dan Willemsen7c3e3f82015-09-29 16:30:21 -0700142 $(strip $(sort $(wildcard \
Ying Wangc6349742014-01-13 16:14:20 -0800143 $(SRC_TARGET_DIR)/board/$(TARGET_DEVICE)/BoardConfig.mk \
144 $(shell test -d device && find device -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
145 $(shell test -d vendor && find vendor -maxdepth 4 -path '*/$(TARGET_DEVICE)/BoardConfig.mk') \
Dan Willemsen7c3e3f82015-09-29 16:30:21 -0700146 )))
Ying Wangc6349742014-01-13 16:14:20 -0800147ifeq ($(board_config_mk),)
148 $(error No config file found for TARGET_DEVICE $(TARGET_DEVICE))
149endif
150ifneq ($(words $(board_config_mk)),1)
151 $(error Multiple board config files for TARGET_DEVICE $(TARGET_DEVICE): $(board_config_mk))
152endif
153include $(board_config_mk)
154ifeq ($(TARGET_ARCH),)
155 $(error TARGET_ARCH not defined by board config: $(board_config_mk))
156endif
157TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk)))
158board_config_mk :=
159
Ying Wang6aef0472014-07-23 20:20:49 -0700160###########################################
161# Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR
162ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder))
163TARGET_COPY_OUT_VENDOR := system/vendor
164else ifeq ($(filter vendor system/vendor,$(TARGET_COPY_OUT_VENDOR)),)
165$(error TARGET_COPY_OUT_VENDOR must be either 'vendor' or 'system/vendor', seeing '$(TARGET_COPY_OUT_VENDOR)'.)
166endif
167PRODUCT_COPY_FILES := $(subst $(_vendor_path_placeholder),$(TARGET_COPY_OUT_VENDOR),$(PRODUCT_COPY_FILES))
168###########################################
169
170
The Android Open Source Project88b60792009-03-03 19:28:42 -0800171# ---------------------------------------------------------------
172# Set up configuration for target machine.
173# The following must be set:
174# TARGET_OS = { linux }
Raghu Gandham8da43102012-07-25 19:57:22 -0700175# TARGET_ARCH = { arm | x86 | mips }
The Android Open Source Project88b60792009-03-03 19:28:42 -0800176
The Android Open Source Project88b60792009-03-03 19:28:42 -0800177TARGET_OS := linux
Raghu Gandham8da43102012-07-25 19:57:22 -0700178# TARGET_ARCH should be set by BoardConfig.mk and will be checked later
Ying Wang4b1c95d2014-07-08 17:07:36 -0700179ifneq ($(filter %64,$(TARGET_ARCH)),)
180TARGET_IS_64_BIT := true
181endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800182
183# the target build type defaults to release
184ifneq ($(TARGET_BUILD_TYPE),debug)
185TARGET_BUILD_TYPE := release
186endif
187
The Android Open Source Project88b60792009-03-03 19:28:42 -0800188# ---------------------------------------------------------------
189# figure out the output directories
190
191ifeq (,$(strip $(OUT_DIR)))
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -0800192ifeq (,$(strip $(OUT_DIR_COMMON_BASE)))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800193OUT_DIR := $(TOPDIR)out
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -0800194else
195OUT_DIR := $(OUT_DIR_COMMON_BASE)/$(notdir $(PWD))
196endif
The Android Open Source Project88b60792009-03-03 19:28:42 -0800197endif
198
199DEBUG_OUT_DIR := $(OUT_DIR)/debug
200
201# Move the host or target under the debug/ directory
202# if necessary.
203TARGET_OUT_ROOT_release := $(OUT_DIR)/target
204TARGET_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/target
205TARGET_OUT_ROOT := $(TARGET_OUT_ROOT_$(TARGET_BUILD_TYPE))
206
207HOST_OUT_ROOT_release := $(OUT_DIR)/host
208HOST_OUT_ROOT_debug := $(DEBUG_OUT_DIR)/host
209HOST_OUT_ROOT := $(HOST_OUT_ROOT_$(HOST_BUILD_TYPE))
210
Ying Wang6feb6d52014-04-17 10:03:35 -0700211# We want to avoid two host bin directories in multilib build.
212HOST_OUT_release := $(HOST_OUT_ROOT_release)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
213HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_PREBUILT_ARCH)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800214HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
Dan Willemsen057aaea2015-08-14 12:59:50 -0700215# TODO: remove
216BUILD_OUT := $(HOST_OUT)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800217
Dan Willemsen057aaea2015-08-14 12:59:50 -0700218HOST_CROSS_OUT_release := $(HOST_OUT_ROOT_release)/windows-$(HOST_PREBUILT_ARCH)
219HOST_CROSS_OUT_debug := $(HOST_OUT_ROOT_debug)/windows-$(HOST_PREBUILT_ARCH)
220HOST_CROSS_OUT := $(HOST_CROSS_OUT_$(HOST_BUILD_TYPE))
Raphael9ca16282010-04-16 17:50:09 -0700221
Jeff Browne33ba4c2011-07-11 22:11:46 -0700222TARGET_PRODUCT_OUT_ROOT := $(TARGET_OUT_ROOT)/product
The Android Open Source Project88b60792009-03-03 19:28:42 -0800223
224TARGET_COMMON_OUT_ROOT := $(TARGET_OUT_ROOT)/common
225HOST_COMMON_OUT_ROOT := $(HOST_OUT_ROOT)/common
226
227PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_DEVICE)
228
229OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
230
Ying Wangc6349742014-01-13 16:14:20 -0800231BUILD_OUT_EXECUTABLES := $(BUILD_OUT)/bin
Raphael9ca16282010-04-16 17:50:09 -0700232
Ying Wangc6349742014-01-13 16:14:20 -0800233HOST_OUT_EXECUTABLES := $(HOST_OUT)/bin
Ying Wang36ef50f2014-06-30 17:06:21 -0700234HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800235HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT)/framework
Joe Onorato64d85d02009-04-09 19:31:12 -0700236HOST_OUT_SDK_ADDON := $(HOST_OUT)/sdk_addon
The Android Open Source Project88b60792009-03-03 19:28:42 -0800237
Dan Willemsen057aaea2015-08-14 12:59:50 -0700238HOST_CROSS_OUT_EXECUTABLES := $(HOST_CROSS_OUT)/bin
239HOST_CROSS_OUT_SHARED_LIBRARIES := $(HOST_CROSS_OUT)/lib
240
The Android Open Source Project88b60792009-03-03 19:28:42 -0800241HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj
Ying Wangc6349742014-01-13 16:14:20 -0800242HOST_OUT_HEADERS := $(HOST_OUT_INTERMEDIATES)/include
The Android Open Source Project88b60792009-03-03 19:28:42 -0800243HOST_OUT_INTERMEDIATE_LIBRARIES := $(HOST_OUT_INTERMEDIATES)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800244HOST_OUT_NOTICE_FILES := $(HOST_OUT_INTERMEDIATES)/NOTICE_FILES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800245HOST_OUT_COMMON_INTERMEDIATES := $(HOST_COMMON_OUT_ROOT)/obj
Ying Wangec900ac2013-11-13 15:56:18 -0800246HOST_OUT_FAKE := $(HOST_OUT)/fake_packages
The Android Open Source Project88b60792009-03-03 19:28:42 -0800247
Dan Willemsen057aaea2015-08-14 12:59:50 -0700248HOST_CROSS_OUT_INTERMEDIATES := $(HOST_CROSS_OUT)/obj
249HOST_CROSS_OUT_HEADERS := $(HOST_CROSS_OUT_INTERMEDIATES)/include
250HOST_CROSS_OUT_INTERMEDIATE_LIBRARIES := $(HOST_CROSS_OUT_INTERMEDIATES)/lib
251HOST_CROSS_OUT_NOTICE_FILES := $(HOST_CROSS_OUT_INTERMEDIATES)/NOTICE_FILES
252
Colin Crossd8262642014-01-24 23:17:21 -0800253HOST_OUT_GEN := $(HOST_OUT)/gen
254HOST_OUT_COMMON_GEN := $(HOST_COMMON_OUT_ROOT)/gen
255
Dan Willemsen057aaea2015-08-14 12:59:50 -0700256HOST_CROSS_OUT_GEN := $(HOST_CROSS_OUT)/gen
257
Ying Wang6feb6d52014-04-17 10:03:35 -0700258# Out for HOST_2ND_ARCH
259HOST_2ND_ARCH_VAR_PREFIX := 2ND_
260HOST_2ND_ARCH_MODULE_SUFFIX := _32
261$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATES := $(HOST_OUT)/obj32
262$(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 -0700263$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT)/lib
Ying Wang6feb6d52014-04-17 10:03:35 -0700264$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_EXECUTABLES := $(HOST_OUT_EXECUTABLES)
Dan Albertdc941372015-05-04 18:17:52 -0700265$(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_JAVA_LIBRARIES := $(HOST_OUT_JAVA_LIBRARIES)
Ying Wang6feb6d52014-04-17 10:03:35 -0700266
Ying Wangc4595862014-06-10 12:04:56 -0700267# The default host library path.
268# It always points to the path where we build libraries in the default bitness.
Ying Wang5bac9622014-08-14 11:03:56 -0700269ifeq ($(HOST_PREFER_32_BIT),true)
270HOST_LIBRARY_PATH := $($(HOST_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)
271else
272HOST_LIBRARY_PATH := $(HOST_OUT_SHARED_LIBRARIES)
273endif
Ying Wang6feb6d52014-04-17 10:03:35 -0700274
The Android Open Source Project88b60792009-03-03 19:28:42 -0800275TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj
Ying Wangc6349742014-01-13 16:14:20 -0800276TARGET_OUT_HEADERS := $(TARGET_OUT_INTERMEDIATES)/include
The Android Open Source Project88b60792009-03-03 19:28:42 -0800277TARGET_OUT_INTERMEDIATE_LIBRARIES := $(TARGET_OUT_INTERMEDIATES)/lib
278TARGET_OUT_COMMON_INTERMEDIATES := $(TARGET_COMMON_OUT_ROOT)/obj
279
Colin Crossd8262642014-01-24 23:17:21 -0800280TARGET_OUT_GEN := $(PRODUCT_OUT)/gen
281TARGET_OUT_COMMON_GEN := $(TARGET_COMMON_OUT_ROOT)/gen
282
Ying Wang2b6aaa32011-10-27 15:18:39 -0700283TARGET_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_SYSTEM)
Ivan Krasin74b32b82015-09-18 11:54:43 -0700284ifneq ($(filter address,$(SANITIZE_TARGET)),)
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700285target_out_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
286else
287target_out_shared_libraries_base := $(TARGET_OUT)
288endif
289
Ying Wangc6349742014-01-13 16:14:20 -0800290TARGET_OUT_EXECUTABLES := $(TARGET_OUT)/bin
291TARGET_OUT_OPTIONAL_EXECUTABLES := $(TARGET_OUT)/xbin
Ying Wang4b1c95d2014-07-08 17:07:36 -0700292ifeq ($(TARGET_IS_64_BIT),true)
Ying Wangc6349742014-01-13 16:14:20 -0800293# /system/lib always contains 32-bit libraries,
294# and /system/lib64 (if present) always contains 64-bit libraries.
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700295TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800296else
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700297TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800298endif
299TARGET_OUT_JAVA_LIBRARIES := $(TARGET_OUT)/framework
300TARGET_OUT_APPS := $(TARGET_OUT)/app
Ying Wang5338fbf2013-05-08 15:49:08 -0700301TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT)/priv-app
The Android Open Source Project88b60792009-03-03 19:28:42 -0800302TARGET_OUT_KEYLAYOUT := $(TARGET_OUT)/usr/keylayout
303TARGET_OUT_KEYCHARS := $(TARGET_OUT)/usr/keychars
304TARGET_OUT_ETC := $(TARGET_OUT)/etc
Ying Wangc6349742014-01-13 16:14:20 -0800305TARGET_OUT_NOTICE_FILES := $(TARGET_OUT_INTERMEDIATES)/NOTICE_FILES
Dima Zavin531f5242010-09-27 17:37:17 -0700306TARGET_OUT_FAKE := $(PRODUCT_OUT)/fake_packages
The Android Open Source Project88b60792009-03-03 19:28:42 -0800307
Ying Wange1d44c32013-12-27 11:09:36 -0800308# Out for TARGET_2ND_ARCH
Ying Wangc4595862014-06-10 12:04:56 -0700309TARGET_2ND_ARCH_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
310TARGET_2ND_ARCH_MODULE_SUFFIX := $(HOST_2ND_ARCH_MODULE_SUFFIX)
Ying Wange1d44c32013-12-27 11:09:36 -0800311$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES := $(PRODUCT_OUT)/obj_$(TARGET_2ND_ARCH)
312$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATE_LIBRARIES := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES)/lib
Evgenii Stepanov4d3d4142015-06-11 17:32:31 -0700313$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES := $(target_out_shared_libraries_base)/lib
Ying Wang72b01d62014-01-17 16:17:28 -0800314$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
Colin Crossd9574462014-01-24 13:37:07 -0800315$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS := $(TARGET_OUT_APPS)
316$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_APPS_PRIVILEGED := $(TARGET_OUT_APPS_PRIVILEGED)
Ying Wange1d44c32013-12-27 11:09:36 -0800317
Ying Wang2b6aaa32011-10-27 15:18:39 -0700318TARGET_OUT_DATA := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)
Ying Wangc6349742014-01-13 16:14:20 -0800319TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_EXECUTABLES)
320TARGET_OUT_DATA_SHARED_LIBRARIES := $(TARGET_OUT_SHARED_LIBRARIES)
321TARGET_OUT_DATA_JAVA_LIBRARIES := $(TARGET_OUT_DATA)/framework
322TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA)/app
The Android Open Source Project88b60792009-03-03 19:28:42 -0800323TARGET_OUT_DATA_KEYLAYOUT := $(TARGET_OUT_KEYLAYOUT)
324TARGET_OUT_DATA_KEYCHARS := $(TARGET_OUT_KEYCHARS)
325TARGET_OUT_DATA_ETC := $(TARGET_OUT_ETC)
Ying Wang4b1c95d2014-07-08 17:07:36 -0700326ifeq ($(TARGET_IS_64_BIT),true)
327TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest64
328else
Ying Wang4c681742010-07-20 11:08:47 -0700329TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
Ying Wang4b1c95d2014-07-08 17:07:36 -0700330endif
Tsu Chiang Chuang40da8832012-07-13 13:47:09 -0700331TARGET_OUT_DATA_FAKE := $(TARGET_OUT_DATA)/fake_packages
The Android Open Source Project88b60792009-03-03 19:28:42 -0800332
Ying Wange3d06792014-01-23 15:09:04 -0800333$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_EXECUTABLES := $(TARGET_OUT_DATA_EXECUTABLES)
334$(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 -0800335$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_APPS := $(TARGET_OUT_DATA_APPS)
Ying Wang4b1c95d2014-07-08 17:07:36 -0700336$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS := $(TARGET_OUT_DATA)/nativetest
Ying Wange3d06792014-01-23 15:09:04 -0800337
Ying Wang9f8e8db2011-11-04 11:37:01 -0700338TARGET_OUT_CACHE := $(PRODUCT_OUT)/cache
339
Ying Wang2b6aaa32011-10-27 15:18:39 -0700340TARGET_OUT_VENDOR := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_VENDOR)
Ivan Krasin74b32b82015-09-18 11:54:43 -0700341ifneq ($(filter address,$(SANITIZE_TARGET)),)
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700342target_out_vendor_shared_libraries_base := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_DATA)/vendor
343else
344target_out_vendor_shared_libraries_base := $(TARGET_OUT_VENDOR)
345endif
346
Ying Wangc6349742014-01-13 16:14:20 -0800347TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR)/bin
348TARGET_OUT_VENDOR_OPTIONAL_EXECUTABLES := $(TARGET_OUT_VENDOR)/xbin
Ying Wang4b1c95d2014-07-08 17:07:36 -0700349ifeq ($(TARGET_IS_64_BIT),true)
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700350TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib64
Ying Wangc6349742014-01-13 16:14:20 -0800351else
Evgenii Stepanovbf140972015-06-30 14:02:02 -0700352TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(target_out_vendor_shared_libraries_base)/lib
Ying Wangc6349742014-01-13 16:14:20 -0800353endif
354TARGET_OUT_VENDOR_JAVA_LIBRARIES := $(TARGET_OUT_VENDOR)/framework
355TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR)/app
Benjamin Pujole68a2772015-08-17 07:31:21 +0200356TARGET_OUT_VENDOR_APPS_PRIVILEGED := $(TARGET_OUT_VENDOR)/priv-app
Ying Wang8f779362011-09-13 13:57:26 -0700357TARGET_OUT_VENDOR_ETC := $(TARGET_OUT_VENDOR)/etc
358
Ying Wange3d06792014-01-23 15:09:04 -0800359$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_EXECUTABLES := $(TARGET_OUT_VENDOR_EXECUTABLES)
Ying Wang61d499b2014-01-15 16:02:16 -0800360$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES := $(TARGET_OUT_VENDOR)/lib
Colin Crossd9574462014-01-24 13:37:07 -0800361$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_APPS := $(TARGET_OUT_VENDOR_APPS)
Ying Wang61d499b2014-01-15 16:02:16 -0800362
Ying Wangb8888432014-03-11 17:13:27 -0700363TARGET_OUT_OEM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_OEM)
Ying Wangf15250e2014-06-26 14:12:35 -0700364TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM)/bin
Ying Wang4540a852015-03-12 18:30:39 -0700365ifeq ($(TARGET_IS_64_BIT),true)
Ying Wangf15250e2014-06-26 14:12:35 -0700366TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib64
367else
368TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
369endif
Ying Wangb8888432014-03-11 17:13:27 -0700370# We don't expect Java libraries in the oem.img.
371# TARGET_OUT_OEM_JAVA_LIBRARIES:= $(TARGET_OUT_OEM)/framework
Ying Wangf15250e2014-06-26 14:12:35 -0700372TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM)/app
Ying Wangb8888432014-03-11 17:13:27 -0700373TARGET_OUT_OEM_ETC := $(TARGET_OUT_OEM)/etc
374
Ying Wangf15250e2014-06-26 14:12:35 -0700375$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_EXECUTABLES := $(TARGET_OUT_OEM_EXECUTABLES)
376$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_SHARED_LIBRARIES := $(TARGET_OUT_OEM)/lib
377$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_OEM_APPS := $(TARGET_OUT_OEM_APPS)
378
Ying Wang4540a852015-03-12 18:30:39 -0700379TARGET_OUT_ODM := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ODM)
380TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM)/bin
381ifeq ($(TARGET_IS_64_BIT),true)
382TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib64
383else
384TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib
385endif
386TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM)/app
387TARGET_OUT_ODM_ETC := $(TARGET_OUT_ODM)/etc
388
389$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_EXECUTABLES := $(TARGET_OUT_ODM_EXECUTABLES)
390$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_SHARED_LIBRARIES := $(TARGET_OUT_ODM)/lib
391$(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_ODM_APPS := $(TARGET_OUT_ODM_APPS)
392
Steve Fungdfbab492015-09-24 18:12:33 -0700393TARGET_OUT_BREAKPAD := $(PRODUCT_OUT)/breakpad
394
The Android Open Source Project88b60792009-03-03 19:28:42 -0800395TARGET_OUT_UNSTRIPPED := $(PRODUCT_OUT)/symbols
396TARGET_OUT_EXECUTABLES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/bin
397TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/system/lib
Colin Crossa58f8e02014-06-20 13:33:36 -0700398TARGET_OUT_VENDOR_SHARED_LIBRARIES_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/$(TARGET_COPY_OUT_VENDOR)/lib
The Android Open Source Project88b60792009-03-03 19:28:42 -0800399TARGET_ROOT_OUT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)
400TARGET_ROOT_OUT_SBIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/sbin
401TARGET_ROOT_OUT_BIN_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)/bin
402
Ying Wang2b6aaa32011-10-27 15:18:39 -0700403TARGET_ROOT_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_ROOT)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800404TARGET_ROOT_OUT_BIN := $(TARGET_ROOT_OUT)/bin
405TARGET_ROOT_OUT_SBIN := $(TARGET_ROOT_OUT)/sbin
406TARGET_ROOT_OUT_ETC := $(TARGET_ROOT_OUT)/etc
407TARGET_ROOT_OUT_USR := $(TARGET_ROOT_OUT)/usr
408
Ying Wang2b6aaa32011-10-27 15:18:39 -0700409TARGET_RECOVERY_OUT := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_RECOVERY)
The Android Open Source Project88b60792009-03-03 19:28:42 -0800410TARGET_RECOVERY_ROOT_OUT := $(TARGET_RECOVERY_OUT)/root
411
412TARGET_SYSLOADER_OUT := $(PRODUCT_OUT)/sysloader
413TARGET_SYSLOADER_ROOT_OUT := $(TARGET_SYSLOADER_OUT)/root
414TARGET_SYSLOADER_SYSTEM_OUT := $(TARGET_SYSLOADER_OUT)/root/system
415
416TARGET_INSTALLER_OUT := $(PRODUCT_OUT)/installer
417TARGET_INSTALLER_DATA_OUT := $(TARGET_INSTALLER_OUT)/data
418TARGET_INSTALLER_ROOT_OUT := $(TARGET_INSTALLER_OUT)/root
419TARGET_INSTALLER_SYSTEM_OUT := $(TARGET_INSTALLER_OUT)/root/system
420
Ying Wanga83940f2010-09-24 18:09:04 -0700421COMMON_MODULE_CLASSES := TARGET-NOTICE_FILES HOST-NOTICE_FILES HOST-JAVA_LIBRARIES
The Android Open Source Project88b60792009-03-03 19:28:42 -0800422
423ifeq (,$(strip $(DIST_DIR)))
424 DIST_DIR := $(OUT_DIR)/dist
425endif
426
427ifeq ($(PRINT_BUILD_CONFIG),)
428PRINT_BUILD_CONFIG := true
429endif