blob: c42446b47692675cee881510bd98e1ce6c9be7ca [file] [log] [blame]
Ying Wang4def6972014-07-11 12:43:33 -07001# 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
15LOCAL_PATH:= $(call my-dir)
Dolly Dhariwal9fc5fe92017-09-28 11:41:19 -070016
17# Disable the frameworks support for PDK builds instead
18# use prebuilts/sdk/current/
19ifneq ($(TARGET_BUILD_PDK),true)
Ying Wang4def6972014-07-11 12:43:33 -070020# Don't include in unbundled build.
21ifeq ($(TARGET_BUILD_APPS),)
Chris Banesf62fcde2015-02-25 10:42:47 +000022
Chris Banes82b55492016-01-22 11:11:47 +000023SUPPORT_CURRENT_SDK_VERSION := current
Chris Banesf62fcde2015-02-25 10:42:47 +000024
Alan Viverette5fa00502016-04-05 14:17:22 -040025###########################################################
26# Find all of the files in the given subdirs that match the
27# specified pattern but do not match another pattern. This
28# function uses $(1) instead of LOCAL_PATH as the base.
29# $(1): the base dir, relative to the root of the source tree.
30# $(2): the file name pattern to match.
31# $(3): the file name pattern to exclude.
32# $(4): a list of subdirs of the base dir.
33# Returns: a list of paths relative to the base dir.
34###########################################################
35
36define find-files-in-subdirs-exclude
37$(sort $(patsubst ./%,%, \
38 $(shell cd $(1) ; \
39 find -L $(4) -name $(2) -and -not -name $(3) -and -not -name ".*") \
40 ))
41endef
42
43###########################################################
44## Find all of the files under the named directories where
45## the file name matches the specified pattern but does not
46## match another pattern. Meant to be used like:
47## SRC_FILES := $(call all-named-files-under,.*\.h,src tests)
48###########################################################
49
50define all-named-files-under-exclude
51$(call find-files-in-subdirs-exclude,$(LOCAL_PATH),"$(1)","$(2)",$(3))
52endef
53
54###########################################################
55## Find all of the files under the current directory where
56## the file name matches the specified pattern but does not
57## match another pattern.
58###########################################################
59
60define all-subdir-named-files-exclude
61$(call all-named-files-under-exclude,$(1),$(2),.)
62endef
63
Alan Viverette5fa00502016-04-05 14:17:22 -040064# Pre-process support library AIDLs
65aidl_files := $(addprefix $(LOCAL_PATH)/, $(call all-subdir-named-files-exclude,*.aidl,I*.aidl))
66support-aidl := $(TARGET_OUT_COMMON_INTERMEDIATES)/support.aidl
67$(support-aidl): $(aidl_files) | $(AIDL)
68 $(AIDL) --preprocess $@ $(aidl_files)
69
Chris Banesf62fcde2015-02-25 10:42:47 +000070# Build all support libraries
Ying Wang4def6972014-07-11 12:43:33 -070071include $(call all-makefiles-under,$(LOCAL_PATH))
Chris Banesf62fcde2015-02-25 10:42:47 +000072
73# Clear out variables
Chris Banes82b55492016-01-22 11:11:47 +000074SUPPORT_CURRENT_SDK_VERSION :=
Chris Banesf62fcde2015-02-25 10:42:47 +000075
Ying Wang4def6972014-07-11 12:43:33 -070076endif
Dolly Dhariwal9fc5fe92017-09-28 11:41:19 -070077endif