2012-08-14 90 views
0

我正在編寫一個用於在Android中編譯jni代碼的make文件。 我希望能夠遞歸地編譯駐留在特定文件夾下的所有cpp文件。在遞歸下編譯目錄下的所有cpp文件

我該怎麼做? 我試圖玩通配符命令,但沒有得到我需要的結果。

+0

你對'find'熟悉嗎? – Beta 2012-08-14 21:19:41

回答

0

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 
相關問題