1# 2# Copyright (C) 2011 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17# NOTE: Following rules are extracted from base_rules.mk and binary.mk. 18# We must ensure that they are synchronized. 19 20LOCAL_IS_HOST_MODULE := $(strip $(LOCAL_IS_HOST_MODULE)) 21ifdef LOCAL_IS_HOST_MODULE 22 ifneq ($(LOCAL_IS_HOST_MODULE),true) 23 $(error $(LOCAL_PATH): LOCAL_IS_HOST_MODULE must be "true" or empty, not "$(LOCAL_IS_HOST_MODULE)") 24 endif 25 my_prefix:=HOST_ 26else 27 my_prefix:=TARGET_ 28endif 29 30so_suffix := $($(my_prefix)SHLIB_SUFFIX) 31a_suffix := $($(my_prefix)STATIC_LIB_SUFFIX) 32 33# Extract Depended Libraries 34LOCAL_LIBBCC_LIB_DEPS := \ 35 $(foreach lib,$(LOCAL_STATIC_LIBRARIES), \ 36 $(call intermediates-dir-for, \ 37 STATIC_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE))/$(lib)$(a_suffix)) \ 38 $(foreach lib,$(LOCAL_WHOLE_STATIC_LIBRARIES), \ 39 $(call intermediates-dir-for, \ 40 STATIC_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE))/$(lib)$(a_suffix)) \ 41 $(addprefix $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)/, \ 42 $(addsuffix $(so_suffix), $(LOCAL_SHARED_LIBRARIES))) \ 43 $(LIBBCC_ROOT_PATH)/lib/ExecutionEngine/bcc.cpp 44 45 46# Build Rules for Automatically Generated Build Stamp 47GEN := $(local-intermediates-dir)/libbcc-stamp.c 48 49$(GEN): PRIVATE_PATH := $(LOCAL_PATH) 50$(GEN): PRIVATE_DEPS := $(LOCAL_LIBBCC_LIB_DEPS) 51$(GEN): PRIVATE_CUSTOM_TOOL = $(PRIVATE_PATH)/tools/build/gen-build-stamp.py \ 52 $(PRIVATE_PATH) $(PRIVATE_DEPS) > $@ 53$(GEN): $(LOCAL_PATH)/tools/build/gen-build-stamp.py $(LOCAL_LIBBCC_LIB_DEPS) \ 54 $(wildcard $(LOCAL_PATH)/.git/COMMIT_EDITMSG) 55 $(transform-generated-source) 56 57LOCAL_GENERATED_SOURCES += $(GEN) 58