在我们的Android项目中,我们有数十个C和CPP文件,我们通过一个容器文件#include了这些文件。容器文件在LOCAL_SRC_FILES中列出,因为这就是编译的内容。但是,当我编辑其中一个.cpp文件时,似乎没有触发构建。
如果我完全控制make文件,则只将所有这些文件作为相关编译步骤的依赖项包括在内。但是,android.mk通常会处理所有这些编译依赖项,因此我不知道将它们插入哪里。
我在此路径中有三个CPP文件
.. src \ main \ cpp
而且我在android.mk文件中包含这样的内容
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libjson-c
LOCAL_SRC_FILES := ../prebuild/libjson/$(TARGET_ARCH_ABI)/libjson-c.a
LOCAL_EXPORT_C_INCLUDES := ../prebuild/include
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libcurl
LOCAL_SRC_FILES := ../prebuild/libcurl/$(TARGET_ARCH_ABI)/libcurl.a
LOCAL_EXPORT_C_INCLUDES := ../prebuild/include
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Native
LOCAL_SRC_FILES := ../cpp/mainClass.cpp ../cpp/native-handler.cpp
LOCAL_C_INCLUDES := ../cpp/native-handler.h ../prebuild/include/json-c/json.h ../prebuild/include/curl/curl.h
LOCAL_LDLIBS := -lz -llog -ljnigraphics
LOCAL_STATIC_LIBRARIES := libjson-c libcurl
include $(BUILD_SHARED_LIBRARY)