我有一个问题,包括另一个 Android.mk 并构建了依赖共享库。
生成文件:
LOCAL_PATH := $(call my-dir)
MY_CORE_PATH := $(abspath $(LOCAL_PATH)/../..)
include $(CLEAR_VARS)
LOCAL_MODULE := Phone
LOCAL_SRC_FILES := phone.cpp
LOCAL_SHARED_LIBRARIES := libCore
include $(BUILD_SHARED_LIBRARY)
include $(MY_CORE_PATH)/Android.mk
当我编译这个我得到一个错误,
make: *** No rule to make target 'libCore.so' needed by 'libPhone.so'. Stop.
然而,libCore.so 的构建没有任何问题,但这个 makefile 无法正确引用。请提供有关如何解决此问题的任何建议。
NDK 和 Android 版本:android-ndk-r6,为 Android ICS 构建的 API 级别 9。
我目前可以通过进行以下更改来解决。
# Modified Android.mk
LOCAL_PATH := $(call my-dir)
MY_CORE_PATH := $(abspath $(LOCAL_PATH)/../..)
# libCore
include $(CLEAR_VARS)
LOCAL_MODULE := Core
include $(MY_CORE_PATH)/Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := Phone
LOCAL_SRC_FILES := phone.cpp
LOCAL_SRC_FILES += libCore
include $(BUILD_SHARED_LIBRARY)