blob: 417a76cc2376d0d21d297a836e155ca7e9ffa8e6 [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001###########################################################
2## Copy headers to the install tree
3###########################################################
Dan Willemsen3bf15e72016-07-25 16:03:53 -07004$(call record-module-type,COPY_HEADERS)
The Android Open Source Project88b60792009-03-03 19:28:42 -08005ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),)
6 my_prefix := HOST_
7else
8 my_prefix := TARGET_
9endif
10
11# Create a rule to copy each header, and make the
12# all_copied_headers phony target depend on each
13# destination header. copy-one-header defines the
14# actual rule.
15#
16$(foreach header,$(LOCAL_COPY_HEADERS), \
17 $(eval _chFrom := $(LOCAL_PATH)/$(header)) \
18 $(eval _chTo := \
Colin Crossa6c4ebd2013-10-22 12:24:21 -070019 $(if $(LOCAL_COPY_HEADERS_TO),\
20 $($(my_prefix)OUT_HEADERS)/$(LOCAL_COPY_HEADERS_TO)/$(notdir $(header)),\
21 $($(my_prefix)OUT_HEADERS)/$(notdir $(header)))) \
Dan Willemsen6f60f022016-02-23 13:40:07 -080022 $(eval ALL_COPIED_HEADERS.$(_chTo).MAKEFILE += $(LOCAL_MODULE_MAKEFILE)) \
23 $(eval ALL_COPIED_HEADERS.$(_chTo).SRC += $(_chFrom)) \
24 $(if $(filter $(_chTo),$(ALL_COPIED_HEADERS)),, \
25 $(eval ALL_COPIED_HEADERS += $(_chTo))) \
The Android Open Source Project88b60792009-03-03 19:28:42 -080026 )
27_chFrom :=
28_chTo :=