build-shared-library.mk revision f5107032a58fc88cea9a2bb1211b1f7d9e9eeccb
1# Copyright (C) 2009 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16# this file is included from Android.mk files to build a target-specific
17# shared library
18#
19
20LOCAL_BUILD_SCRIPT := BUILD_SHARED_LIBRARY
21LOCAL_MODULE_CLASS := SHARED_LIBRARY
22LOCAL_MAKEFILE     := $(local-makefile)
23
24$(call check-defined-LOCAL_MODULE,$(LOCAL_BUILD_SCRIPT))
25$(call check-LOCAL_MODULE,$(LOCAL_MAKEFILE))
26
27# only adjust the build if this module is needed by the current app
28ifneq ($(filter $(LOCAL_MODULE),$(NDK_APP_MODULES)),)
29
30# we are building target objects
31my := TARGET_
32
33LOCAL_BUILT_MODULE := $(call shared-library-path,$(LOCAL_MODULE))
34LOCAL_OBJS_DIR     := $(TARGET_OBJS)/$(LOCAL_MODULE)
35
36include $(BUILD_SYSTEM)/build-binary.mk
37
38$(LOCAL_BUILT_MODULE): $(LOCAL_OBJECTS)
39	@ mkdir -p $(dir $@)
40	@ echo "SharedLibrary  : $(PRIVATE_NAME)"
41	$(hide) $(cmd-build-shared-library)
42
43ALL_SHARED_LIBRARIES += $(LOCAL_BUILT_MODULE)
44
45include $(BUILD_SYSTEM)/install-binary.mk
46
47endif # filter LOCAL_MODULE in NDK_APP_MODULES
48