我是 NDK 构建系统的新手,虽然我非常了解 GNU Make。
我正在尝试使用一个库和一个用于测试库的测试存根为我的项目定义构建系统。
我有以下设置,它可以工作,但我对它不满意。
--------------jni/Android.mk--------------
# A simple test for the minimal standard c library
LOCAL_PATH := $(call my-dir)
MY_LOCAL_PATH := $(LOCAL_PATH)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/library/Android.mk
---------------jni/Android.mk------------------
-------------jni/library/Android.mk----------------------
# A simple test for the minimal standard c library
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_CFLAGS := -g -DDEBUG
LOCAL_C_INCLUDES := $(LOCAL_PATH)/inc
LOCAL_MODULE := lteDiag
LOCAL_SRC_FILES := $(wildcard src/*.c)
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
#LOCAL_CFLAGS := -g -DDEBUG
LOCAL_C_INCLUDES := $(LOCAL_PATH)/inc
LOCAL_MODULE := DiagAppf
LOCAL_SRC_FILES := ../test_stub/test.c
LOCAL_STATIC_LIBRARIES := lteDiag
include $(BUILD_EXECUTABLE)
----------------------jni/library/Android.mk-----------
如果我在 jni/library 下运行 ndk-build,则此设置有效,但不适用于 jni。从 jni 目录它不构建库,只是删除预先存在的库并创建一个新的空存档。
我实际上想做以下事情。
---------------------jni/Android.mk---------------
# A simple test for the minimal standard c library
LOCAL_PATH := $(call my-dir)
MY_LOCAL_PATH := $(LOCAL_PATH)
include $(CLEAR_VARS)
include $(LOCAL_PATH)/DM_Library/Android.mk
include $(CLEAR_VARS)
#LOCAL_CFLAGS := -g -DDEBUG
LOCAL_PATH := $(MY_LOCAL_PATH)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/DM_Library/inc
LOCAL_MODULE := DiagAppf
LOCAL_SRC_FILES := test_stub/test.c
LOCAL_STATIC_LIBRARIES := lteDiag
include $(BUILD_EXECUTABLE)
---------------jni/Android.mk---------------
-----------------jni/library/Android.mk-----------------
# A simple test for the minimal standard c library
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#LOCAL_CFLAGS := -g -DDEBUG
LOCAL_C_INCLUDES := $(LOCAL_PATH)/inc
LOCAL_MODULE := lteDiag
LOCAL_SRC_FILES := $(wildcard src/*.c)
include $(BUILD_STATIC_LIBRARY)
--------------------jni/library/Android.mk-----------
提前感谢您的帮助。有没有我可以通过的文件。我没有找到任何详细解释复杂的多子目录构建系统构建的东西。
谢谢,阿南德