Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 1 | # |
Zonr Chang | 7a5d423 | 2012-04-12 15:39:06 +0800 | [diff] [blame] | 2 | # Copyright (C) 2012 The Android Open Source Project |
Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 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 | |
| 20 | LOCAL_IS_HOST_MODULE := $(strip $(LOCAL_IS_HOST_MODULE)) |
| 21 | ifdef 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_ |
| 26 | else |
| 27 | my_prefix:=TARGET_ |
| 28 | endif |
| 29 | |
| 30 | so_suffix := $($(my_prefix)SHLIB_SUFFIX) |
| 31 | a_suffix := $($(my_prefix)STATIC_LIB_SUFFIX) |
| 32 | |
| 33 | # Extract Depended Libraries |
| 34 | LOCAL_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)/, \ |
Logan Chien | f68882e | 2011-07-18 19:11:39 +0800 | [diff] [blame] | 42 | $(addsuffix $(so_suffix), $(LOCAL_SHARED_LIBRARIES))) \ |
Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 43 | |
Zonr Chang | 7a5d423 | 2012-04-12 15:39:06 +0800 | [diff] [blame] | 44 | # Build Rules for Automatically Generated Build Information |
| 45 | GEN := $(local-intermediates-dir)/BuildInfo.cpp |
| 46 | |
| 47 | gen_build_info := $(LOCAL_PATH)/tools/build/gen-build-info.py |
Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 48 | |
| 49 | $(GEN): PRIVATE_PATH := $(LOCAL_PATH) |
| 50 | $(GEN): PRIVATE_DEPS := $(LOCAL_LIBBCC_LIB_DEPS) |
Zonr Chang | 7a5d423 | 2012-04-12 15:39:06 +0800 | [diff] [blame] | 51 | $(GEN): PRIVATE_CUSTOM_TOOL = $(gen_build_info) $(PRIVATE_PATH) \ |
| 52 | $(PRIVATE_DEPS) > $@ |
| 53 | $(GEN): $(gen_build_info) $(LOCAL_LIBBCC_LIB_DEPS) \ |
Logan Chien | 3d60052 | 2011-07-15 11:10:54 +0800 | [diff] [blame] | 54 | $(wildcard $(LOCAL_PATH)/.git/COMMIT_EDITMSG) |
Logan Chien | 48dc01d | 2011-07-13 18:12:06 +0800 | [diff] [blame] | 55 | $(transform-generated-source) |
| 56 | |
| 57 | LOCAL_GENERATED_SOURCES += $(GEN) |