platform_build/core/copy_headers.mk
Colin Cross a6c4ebdd11 avoid // in copy headers rule
If LOCAL_COPY_HEADERS_TO is not set, then the copy headers rule
target is set to out/target/product/../obj/include//header.h.
If another rule depends on the header without the //, it will
fail.  Don't insert LOCAL_COPY_HEADERS_TO if it is blank.

Change-Id: Ideac7f8e01288ab5cca98645b307945d6ae9e97c
2013-10-23 13:18:39 -07:00

25 lines
829 B
Makefile

###########################################################
## Copy headers to the install tree
###########################################################
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),)
my_prefix := HOST_
else
my_prefix := TARGET_
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
# actual rule.
#
$(foreach header,$(LOCAL_COPY_HEADERS), \
$(eval _chFrom := $(LOCAL_PATH)/$(header)) \
$(eval _chTo := \
$(if $(LOCAL_COPY_HEADERS_TO),\
$($(my_prefix)OUT_HEADERS)/$(LOCAL_COPY_HEADERS_TO)/$(notdir $(header)),\
$($(my_prefix)OUT_HEADERS)/$(notdir $(header)))) \
$(eval $(call copy-one-header,$(_chFrom),$(_chTo))) \
$(eval all_copied_headers: $(_chTo)) \
)
_chFrom :=
_chTo :=