Reputation: 499
I have a structure like this:
folder1
|--subfolder1
|--.cpp files .h files
|--other .cpp files
folder1 contains cpp files and 1 subfolder which also contains cpp files and head files
How will I write my Android.mk file so that all the source files, including those inside subfolder1 will be included during compilation?
i tried
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/\*/\*.*) $(wildcard *.*)
but it does not work, it didnt include the source files which are inside the subdirectories
Upvotes: 5
Views: 4723
Reputation: 647
this may help. quote:
If you want to define Android.mk files in sub-directories, you should include them explicitly in your top-level Android.mk. There is even a helper function to do that, i.e. use:
include $(call all-subdir-makefiles)
This will include all Android.mk files in sub-directories of the current build file's path.
copied from android-ndk-r8d doc.
that means you should write a Android.mk file to describe your .cpp in each of your subdir, and write a top-level Android.mk to include them by "include $(call all-subdir-makefiles)"
now it may like this:
|-jni
|----Android.mk (top level one)
|--------subfolder1
|------------Android.mk (to describe your a.cpp)
|------------a.cpp/a.h
|----other .cpp/.h files
Upvotes: 4