2012-08-14 2 views
0

Android에서 jni 코드를 컴파일하기위한 make 파일을 작성하고 있습니다. 특정 폴더 아래에있는 모든 cpp 파일을 재귀 적으로 컴파일 할 수 있기를 원합니다.디렉토리의 모든 cpp 파일을 재귀 적으로 컴파일

어떻게 할 수 있습니까? 와일드 카드 명령을 사용해 보았지만 필요한 결과를 얻지 못했습니다.

+0

'find'에 익숙합니까? – Beta

답변

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 
관련 문제