1
我有一個問題,包括另一個Android.mk並構建相關的共享庫。如何在另一個makefile中包含Android.mk
的Makefile:
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建立沒有任何問題,但此生成的文件是不能正確地指這一點。請提供有關如何解決此問題的建議。
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)