I have an Android JNI project I'd like to compile with ndk-build. The project contains of multiple third-party sub projects.
+- jni
+- Android.mk
+- my-proj.mk
+- other-proj.mk
+- my-proj
+- a.cpp
+- b.cpp
+- other-proj (third-party)
+- c.cpp
+- d.cpp
The idea now is to include/import the makefiles of all sub projects in Android.mk, like this:
LOCAL_PATH := $(call my-dir)
include $(LOCAL_PATH)/my-proj.mk
include $(LOCAL_PATH)/other-proj.mk
other-proj is built as static library. my-proj.mk depends on other-proj and is built as shared library.
Building this project works. However, modifying either my-proj.mk or other-proj.mk doesn't trigger a rebuild of the respective project. Is there a way to do this?
I though I could list the makefiles as dependencies of Android.mk but I couldn't figure out a way. (Listing them under LOCAL_SRC_FILES doesn't work.)
I also read about $(call import-module,foo/bar) which seems to do exactly what I want. However, in this case I had to place the makefiles in a directory adjacent to the project directories (e.g. jni/makefiles/other-proj/Android.mk) but I couldn't figure out how to specify the LOCAL_SRC_FILES. They don't seem to like to be specified with an absolute path or with a .. inside the path. (I can't place the makefiles directly in the sub project directories as they're third-party projects.)