Ying Wang | 4def697 | 2014-07-11 12:43:33 -0700 | [diff] [blame] | 1 | # Copyright (C) 2014 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | LOCAL_PATH:= $(call my-dir) |
| 16 | # Don't include in unbundled build. |
| 17 | ifeq ($(TARGET_BUILD_APPS),) |
Chris Banes | f62fcde | 2015-02-25 10:42:47 +0000 | [diff] [blame] | 18 | |
Chris Banes | 82b5549 | 2016-01-22 11:11:47 +0000 | [diff] [blame] | 19 | SUPPORT_CURRENT_SDK_VERSION := current |
Chris Banes | f62fcde | 2015-02-25 10:42:47 +0000 | [diff] [blame] | 20 | SUPPORT_API_CHECK := $(LOCAL_PATH)/apicheck.mk |
| 21 | api_check_current_msg_file := $(LOCAL_PATH)/apicheck_msg_current.txt |
| 22 | api_check_last_msg_file := $(LOCAL_PATH)/apicheck_msg_last.txt |
| 23 | |
Alan Viverette | 5fa0050 | 2016-04-05 14:17:22 -0400 | [diff] [blame^] | 24 | ########################################################### |
| 25 | # Find all of the files in the given subdirs that match the |
| 26 | # specified pattern but do not match another pattern. This |
| 27 | # function uses $(1) instead of LOCAL_PATH as the base. |
| 28 | # $(1): the base dir, relative to the root of the source tree. |
| 29 | # $(2): the file name pattern to match. |
| 30 | # $(3): the file name pattern to exclude. |
| 31 | # $(4): a list of subdirs of the base dir. |
| 32 | # Returns: a list of paths relative to the base dir. |
| 33 | ########################################################### |
| 34 | |
| 35 | define find-files-in-subdirs-exclude |
| 36 | $(sort $(patsubst ./%,%, \ |
| 37 | $(shell cd $(1) ; \ |
| 38 | find -L $(4) -name $(2) -and -not -name $(3) -and -not -name ".*") \ |
| 39 | )) |
| 40 | endef |
| 41 | |
| 42 | ########################################################### |
| 43 | ## Find all of the files under the named directories where |
| 44 | ## the file name matches the specified pattern but does not |
| 45 | ## match another pattern. Meant to be used like: |
| 46 | ## SRC_FILES := $(call all-named-files-under,.*\.h,src tests) |
| 47 | ########################################################### |
| 48 | |
| 49 | define all-named-files-under-exclude |
| 50 | $(call find-files-in-subdirs-exclude,$(LOCAL_PATH),"$(1)","$(2)",$(3)) |
| 51 | endef |
| 52 | |
| 53 | ########################################################### |
| 54 | ## Find all of the files under the current directory where |
| 55 | ## the file name matches the specified pattern but does not |
| 56 | ## match another pattern. |
| 57 | ########################################################### |
| 58 | |
| 59 | define all-subdir-named-files-exclude |
| 60 | $(call all-named-files-under-exclude,$(1),$(2),.) |
| 61 | endef |
| 62 | |
| 63 | |
| 64 | # Pre-process support library AIDLs |
| 65 | aidl_files := $(addprefix $(LOCAL_PATH)/, $(call all-subdir-named-files-exclude,*.aidl,I*.aidl)) |
| 66 | support-aidl := $(TARGET_OUT_COMMON_INTERMEDIATES)/support.aidl |
| 67 | $(support-aidl): $(aidl_files) | $(AIDL) |
| 68 | $(AIDL) --preprocess $@ $(aidl_files) |
| 69 | |
Chris Banes | f62fcde | 2015-02-25 10:42:47 +0000 | [diff] [blame] | 70 | .PHONY: update-support-api |
| 71 | .PHONY: check-support-api |
| 72 | |
| 73 | # Run the check-support-api task on a SDK build |
Alan Viverette | 5fa0050 | 2016-04-05 14:17:22 -0400 | [diff] [blame^] | 74 | sdk: check-support-api $(support-aidl) |
Chris Banes | f62fcde | 2015-02-25 10:42:47 +0000 | [diff] [blame] | 75 | |
| 76 | # Build all support libraries |
Ying Wang | 4def697 | 2014-07-11 12:43:33 -0700 | [diff] [blame] | 77 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
Chris Banes | f62fcde | 2015-02-25 10:42:47 +0000 | [diff] [blame] | 78 | |
| 79 | # Clear out variables |
Chris Banes | 82b5549 | 2016-01-22 11:11:47 +0000 | [diff] [blame] | 80 | SUPPORT_CURRENT_SDK_VERSION := |
Chris Banes | f62fcde | 2015-02-25 10:42:47 +0000 | [diff] [blame] | 81 | SUPPORT_API_CHECK := |
| 82 | api_check_current_msg_file := |
| 83 | api_check_last_msg_file := |
| 84 | |
Ying Wang | 4def697 | 2014-07-11 12:43:33 -0700 | [diff] [blame] | 85 | endif |