0
我正在编写一个用于在Android中编译jni代码的make文件。 我希望能够递归地编译驻留在特定文件夹下的所有cpp文件。在递归下编译目录下的所有cpp文件
我该怎么做? 我试图玩通配符命令,但没有得到我需要的结果。
我正在编写一个用于在Android中编译jni代码的make文件。 我希望能够递归地编译驻留在特定文件夹下的所有cpp文件。在递归下编译目录下的所有cpp文件
我该怎么做? 我试图玩通配符命令,但没有得到我需要的结果。
Android make系统有一个gmake宏来处理这个问题。请参阅NDK中的文档doc\ANDROID-MK.html
。这里是摘录:
all-subdir-makefiles
Returns a list of Android.mk located in all sub-directories of
the current 'my-dir' path. For example, consider the following
hierarchy:
sources/foo/Android.mk
sources/foo/lib1/Android.mk
sources/foo/lib2/Android.mk
If sources/foo/Android.mk contains the single line:
include $(call all-subdir-makefiles)
Then it will include automatically sources/foo/lib1/Android.mk and
sources/foo/lib2/Android.mk
This function can be used to provide deep-nested source directory
hierarchies to the build system. Note that by default, the NDK
will only look for files in sources/*/Android.mk
你对'find'熟悉吗? – Beta 2012-08-14 21:19:41