blob: e3cc2754fed3ae7662e766ef90ac6417d37ead79 [file] [log] [blame]
Bart Searsa8cc0582015-05-07 03:23:20 +00001#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16LOCAL_PATH := $(call my-dir)
17
Colin Crosscf3a0b52017-11-16 00:15:28 -080018# Load framework-specific path mappings used later in the build.
19include $(LOCAL_PATH)/pathmap.mk
Bart Searsa8cc0582015-05-07 03:23:20 +000020
21# Build the master framework library.
22# The framework contains too many method references (>64K) for poor old DEX.
23# So we first build the framework as a monolithic static library then split it
24# up into smaller pieces.
25# ============================================================
26
27# embedded builds use nothing in frameworks/base
28ifneq ($(ANDROID_BUILD_EMBEDDED),true)
29
Bart Searsa8cc0582015-05-07 03:23:20 +000030# Copy AIDL files to be preprocessed and included in the SDK,
31# specified relative to the root of the build tree.
32# ============================================================
33include $(CLEAR_VARS)
34
Colin Cross77ebd082017-12-15 17:30:33 -080035aidl_parcelables :=
36define stubs-to-aidl-parcelables
37 gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl
38 aidl_parcelables += $$(gen)
Colin Crossfdbe7d12018-02-09 11:24:14 -080039 $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables
Colin Cross77ebd082017-12-15 17:30:33 -080040 @echo Extract SDK parcelables: $$@
41 rm -f $$@
42 $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@
43endef
44
45$(foreach stubs,android_stubs_current android_test_stubs_current android_system_stubs_current,\
46 $(eval $(call stubs-to-aidl-parcelables,$(stubs))))
47
Bart Searsa8cc0582015-05-07 03:23:20 +000048gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
Colin Cross77ebd082017-12-15 17:30:33 -080049.KATI_RESTAT: $(gen)
50$(gen): $(aidl_parcelables)
51 @echo Combining SDK parcelables: $@
52 rm -f $@.tmp
53 cat $^ | sort -u > $@.tmp
54 $(call commit-change-for-toc,$@)
Bart Searsa8cc0582015-05-07 03:23:20 +000055
Bart Searsa8cc0582015-05-07 03:23:20 +000056# This is used by ide.mk as the list of source files that are
57# always included.
58INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document))
59
Bart Searsa8cc0582015-05-07 03:23:20 +000060$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE))
Bart Searsa8cc0582015-05-07 03:23:20 +000061$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE))
Michael Wrightb2b2c0e2015-11-06 15:21:13 +000062$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
Sundong Ahnc21f78e2018-08-31 18:19:12 +090063$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE):apistubs/android/public/api/android.txt)
64$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE):apistubs/android/system/api/android.txt)
65$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE):apistubs/android/test/api/android.txt)
Michael Wrightb2b2c0e2015-11-06 15:21:13 +000066
Nan Zhange9a76f72018-07-11 15:19:22 -070067# sdk.atree needs to copy the whole dir: $(OUT_DOCS)/offline-sdk to the final zip.
68# So keep offline-sdk-timestamp target here, and unzip offline-sdk-docs.zip to
69# $(OUT_DOCS)/offline-sdk.
70$(OUT_DOCS)/offline-sdk-timestamp: $(OUT_DOCS)/offline-sdk-docs-docs.zip
71 $(hide) rm -rf $(OUT_DOCS)/offline-sdk
72 $(hide) mkdir -p $(OUT_DOCS)/offline-sdk
73 ( unzip -qo $< -d $(OUT_DOCS)/offline-sdk && touch -f $@ ) || exit 1
Bart Searsa8cc0582015-05-07 03:23:20 +000074
Nan Zhang96bb1ba2018-11-30 11:43:31 -080075# Run this for checkbuild
76checkbuild: doc-comment-check-docs
77# Check comment when you are updating the API
78update-api: doc-comment-check-docs
79
David Brazdil0649c8d2018-01-22 22:23:13 +000080# ==== hiddenapi lists =======================================
David Brazdil89bf0f22018-10-30 18:21:24 +000081.KATI_RESTAT: $(INTERNAL_PLATFORM_HIDDENAPI_FLAGS)
82$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): \
David Brazdil8503b902018-08-30 13:35:03 +010083 frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py \
David Brazdild719f512018-11-13 16:48:23 +000084 frameworks/base/config/hiddenapi-greylist.txt \
85 frameworks/base/config/hiddenapi-greylist-max-p.txt \
David Brazdil89bf0f22018-10-30 18:21:24 +000086 frameworks/base/config/hiddenapi-greylist-max-o.txt \
David Brazdil8503b902018-08-30 13:35:03 +010087 frameworks/base/config/hiddenapi-force-blacklist.txt \
88 $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) \
89 $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \
90 $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
91 frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py \
David Brazdil89bf0f22018-10-30 18:21:24 +000092 --public $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) \
93 --private $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \
94 --csv $(PRIVATE_FLAGS_INPUTS) \
David Brazdild719f512018-11-13 16:48:23 +000095 --greylist frameworks/base/config/hiddenapi-greylist.txt \
David Brazdil89bf0f22018-10-30 18:21:24 +000096 --greylist-ignore-conflicts $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) \
David Brazdild719f512018-11-13 16:48:23 +000097 --greylist-max-p frameworks/base/config/hiddenapi-greylist-max-p.txt \
David Brazdil89bf0f22018-10-30 18:21:24 +000098 --greylist-max-o-ignore-conflicts \
99 frameworks/base/config/hiddenapi-greylist-max-o.txt \
100 --blacklist frameworks/base/config/hiddenapi-force-blacklist.txt \
101 --output $@.tmp
102 $(call commit-change-for-toc,$@)
David Brazdil0649c8d2018-01-22 22:23:13 +0000103
Mathew Inwoodea14c0c2018-10-05 14:41:03 +0100104$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): \
105 frameworks/base/tools/hiddenapi/merge_csv.py \
106 $(PRIVATE_METADATA_INPUTS)
107 frameworks/base/tools/hiddenapi/merge_csv.py $(PRIVATE_METADATA_INPUTS) > $@
108
David Brazdil89bf0f22018-10-30 18:21:24 +0000109$(call dist-for-goals,droidcore,$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS))
Mathew Inwoodea14c0c2018-10-05 14:41:03 +0100110$(call dist-for-goals,droidcore,$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA))
111
Bart Searsa8cc0582015-05-07 03:23:20 +0000112# Include subdirectory makefiles
113# ============================================================
114
115# If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework
116# team really wants is to build the stuff defined by this makefile.
117ifeq (,$(ONE_SHOT_MAKEFILE))
118include $(call first-makefiles-under,$(LOCAL_PATH))
119endif
120
Holly Jiuyu Sunbbc85802017-12-21 18:44:59 -0800121endif # ANDROID_BUILD_EMBEDDED