aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-12-27 02:15:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-12-27 02:15:26 +0000
commit4506b17dd3c28179f25b8689503e79149732d387 (patch)
tree4add75be7665a0ac27561244c9b53c922936aabd
parentf1ef5591f1ab069e204096faadee980e55fb60b6 (diff)
parent13cb165b91da3881081f9fead865c1e262943269 (diff)
downloadbuild-4506b17dd3c28179f25b8689503e79149732d387.tar.gz
Merge "Stop removing valid copy headers"
-rw-r--r--core/copy_headers.mk19
1 files changed, 13 insertions, 6 deletions
diff --git a/core/copy_headers.mk b/core/copy_headers.mk
index c26d51db68..054d271d8d 100644
--- a/core/copy_headers.mk
+++ b/core/copy_headers.mk
@@ -4,15 +4,13 @@ ifneq (,$(strip $(LOCAL_COPY_HEADERS)))
###########################################################
$(call record-module-type,COPY_HEADERS)
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),)
- $(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): LOCAL_COPY_HEADERS may not be used with host modules >&2)
- $(error done)
+ $(call pretty-error,LOCAL_COPY_HEADERS may not be used with host modules)
endif
# Modules linking against the SDK do not have the include path to use
# COPY_HEADERS, so prevent them from exporting any either.
ifdef LOCAL_SDK_VERSION
-$(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Modules using LOCAL_SDK_VERSION may not use LOCAL_COPY_HEADERS >&2)
-$(error done)
+ $(call pretty-error,Modules using LOCAL_SDK_VERSION may not use LOCAL_COPY_HEADERS)
endif
include $(BUILD_SYSTEM)/local_vndk.mk
@@ -22,11 +20,20 @@ include $(BUILD_SYSTEM)/local_vndk.mk
# present.
ifdef BOARD_VNDK_VERSION
ifndef LOCAL_USE_VNDK
-$(shell echo $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): Only vendor modules using LOCAL_USE_VNDK may use LOCAL_COPY_HEADERS >&2)
-$(error done)
+ $(call pretty-error,Only vendor modules using LOCAL_USE_VNDK may use LOCAL_COPY_HEADERS)
endif
endif
+# Clean up LOCAL_COPY_HEADERS_TO, since soong_ui will be comparing cleaned
+# paths to figure out which headers are obsolete and should be removed.
+LOCAL_COPY_HEADERS_TO := $(call clean-path,$(LOCAL_COPY_HEADERS_TO))
+ifneq ($(filter /% .. ../%,$(LOCAL_COPY_HEADERS_TO)),)
+ $(call pretty-error,LOCAL_COPY_HEADERS_TO may not start with / or ../ : $(LOCAL_COPY_HEADERS_TO))
+endif
+ifeq ($(LOCAL_COPY_HEADERS_TO),.)
+ LOCAL_COPY_HEADERS_TO :=
+endif
+
# Create a rule to copy each header, and make the
# all_copied_headers phony target depend on each
# destination header. copy-one-header defines the