Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 1 | # |
| 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 | # |
| 16 | LOCAL_PATH := $(call my-dir) |
| 17 | |
Colin Cross | cf3a0b5 | 2017-11-16 00:15:28 -0800 | [diff] [blame] | 18 | # Load framework-specific path mappings used later in the build. |
| 19 | include $(LOCAL_PATH)/pathmap.mk |
Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 20 | |
| 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 |
| 28 | ifneq ($(ANDROID_BUILD_EMBEDDED),true) |
| 29 | |
Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 30 | # Copy AIDL files to be preprocessed and included in the SDK, |
| 31 | # specified relative to the root of the build tree. |
| 32 | # ============================================================ |
| 33 | include $(CLEAR_VARS) |
| 34 | |
Colin Cross | 77ebd08 | 2017-12-15 17:30:33 -0800 | [diff] [blame] | 35 | aidl_parcelables := |
| 36 | define stubs-to-aidl-parcelables |
| 37 | gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/$1.aidl |
| 38 | aidl_parcelables += $$(gen) |
Colin Cross | fdbe7d1 | 2018-02-09 11:24:14 -0800 | [diff] [blame] | 39 | $$(gen): $(call java-lib-header-files,$1) $(HOST_OUT_EXECUTABLES)/sdkparcelables |
Colin Cross | 77ebd08 | 2017-12-15 17:30:33 -0800 | [diff] [blame] | 40 | @echo Extract SDK parcelables: $$@ |
| 41 | rm -f $$@ |
| 42 | $(HOST_OUT_EXECUTABLES)/sdkparcelables $$< $$@ |
| 43 | endef |
| 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 Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 48 | gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl |
Colin Cross | 77ebd08 | 2017-12-15 17:30:33 -0800 | [diff] [blame] | 49 | .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 Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 55 | |
Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 56 | # This is used by ide.mk as the list of source files that are |
| 57 | # always included. |
| 58 | INTERNAL_SDK_SOURCE_DIRS := $(addprefix $(LOCAL_PATH)/,$(dirs_to_document)) |
| 59 | |
Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 60 | $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE)) |
Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 61 | $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE)) |
Michael Wright | b2b2c0e | 2015-11-06 15:21:13 +0000 | [diff] [blame] | 62 | $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE)) |
Sundong Ahn | c21f78e | 2018-08-31 18:19:12 +0900 | [diff] [blame] | 63 | $(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 Wright | b2b2c0e | 2015-11-06 15:21:13 +0000 | [diff] [blame] | 66 | |
Nan Zhang | e9a76f7 | 2018-07-11 15:19:22 -0700 | [diff] [blame] | 67 | # 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 Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 74 | |
David Brazdil | 0649c8d | 2018-01-22 22:23:13 +0000 | [diff] [blame] | 75 | # ==== hiddenapi lists ======================================= |
David Brazdil | 89bf0f2 | 2018-10-30 18:21:24 +0000 | [diff] [blame] | 76 | .KATI_RESTAT: $(INTERNAL_PLATFORM_HIDDENAPI_FLAGS) |
| 77 | $(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): \ |
David Brazdil | 8503b90 | 2018-08-30 13:35:03 +0100 | [diff] [blame] | 78 | frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py \ |
David Brazdil | 3eae313 | 2018-12-04 19:07:00 +0000 | [diff] [blame] | 79 | frameworks/base/config/hiddenapi-greylist.txt \ |
| 80 | frameworks/base/config/hiddenapi-greylist-max-p.txt \ |
David Brazdil | 89bf0f2 | 2018-10-30 18:21:24 +0000 | [diff] [blame] | 81 | frameworks/base/config/hiddenapi-greylist-max-o.txt \ |
David Brazdil | 8503b90 | 2018-08-30 13:35:03 +0100 | [diff] [blame] | 82 | frameworks/base/config/hiddenapi-force-blacklist.txt \ |
| 83 | $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) \ |
| 84 | $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \ |
| 85 | $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) |
| 86 | frameworks/base/tools/hiddenapi/generate_hiddenapi_lists.py \ |
David Brazdil | 89bf0f2 | 2018-10-30 18:21:24 +0000 | [diff] [blame] | 87 | --public $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) \ |
| 88 | --private $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \ |
| 89 | --csv $(PRIVATE_FLAGS_INPUTS) \ |
David Brazdil | 3eae313 | 2018-12-04 19:07:00 +0000 | [diff] [blame] | 90 | --greylist frameworks/base/config/hiddenapi-greylist.txt \ |
David Brazdil | 89bf0f2 | 2018-10-30 18:21:24 +0000 | [diff] [blame] | 91 | --greylist-ignore-conflicts $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) \ |
David Brazdil | 3eae313 | 2018-12-04 19:07:00 +0000 | [diff] [blame] | 92 | --greylist-max-p frameworks/base/config/hiddenapi-greylist-max-p.txt \ |
David Brazdil | 89bf0f2 | 2018-10-30 18:21:24 +0000 | [diff] [blame] | 93 | --greylist-max-o-ignore-conflicts \ |
| 94 | frameworks/base/config/hiddenapi-greylist-max-o.txt \ |
| 95 | --blacklist frameworks/base/config/hiddenapi-force-blacklist.txt \ |
| 96 | --output $@.tmp |
| 97 | $(call commit-change-for-toc,$@) |
David Brazdil | 0649c8d | 2018-01-22 22:23:13 +0000 | [diff] [blame] | 98 | |
Mathew Inwood | ea14c0c | 2018-10-05 14:41:03 +0100 | [diff] [blame] | 99 | $(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA): \ |
| 100 | frameworks/base/tools/hiddenapi/merge_csv.py \ |
| 101 | $(PRIVATE_METADATA_INPUTS) |
| 102 | frameworks/base/tools/hiddenapi/merge_csv.py $(PRIVATE_METADATA_INPUTS) > $@ |
| 103 | |
David Brazdil | 89bf0f2 | 2018-10-30 18:21:24 +0000 | [diff] [blame] | 104 | $(call dist-for-goals,droidcore,$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS)) |
Mathew Inwood | ea14c0c | 2018-10-05 14:41:03 +0100 | [diff] [blame] | 105 | $(call dist-for-goals,droidcore,$(INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA)) |
| 106 | |
Bart Sears | a8cc058 | 2015-05-07 03:23:20 +0000 | [diff] [blame] | 107 | # Include subdirectory makefiles |
| 108 | # ============================================================ |
| 109 | |
| 110 | # If we're building with ONE_SHOT_MAKEFILE (mm, mmm), then what the framework |
| 111 | # team really wants is to build the stuff defined by this makefile. |
| 112 | ifeq (,$(ONE_SHOT_MAKEFILE)) |
| 113 | include $(call first-makefiles-under,$(LOCAL_PATH)) |
| 114 | endif |
| 115 | |
Holly Jiuyu Sun | bbc8580 | 2017-12-21 18:44:59 -0800 | [diff] [blame] | 116 | endif # ANDROID_BUILD_EMBEDDED |