=================================
=================================
=================================
출처: http://202psj.tistory.com/
JNI 을 할떄 코드들이 jni 한 폴더에 만 있어 정리하기 곤란할때가 있다.
그러면 아래 그림처럼 처리 해주면 도움이 된다.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LS_CPP=$(subst $(1)/,,$(wildcard $(1)/*.cpp))
LOCAL_MODULE := droidblaster
LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH)) \
./basea/TimeService.h \
./basea/TimeService.cpp \
LOCAL_LDLIBS := -landroid -llog -lEGL -lGLESv1_CM
LOCAL_STATIC_LIBRARIES := android_native_app_glue png
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
$(call import-module,libpng)
#-----------------------------------------------------------------------------------
LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH)) \
이부분은 기본 jni 폴더 기본 부분이고
./basea/TimeService.h \
./basea/TimeService.cpp \
이부분은 폴더 생성뒤 정리한 추가 부분이다.
더 효율적인 방법이 있는 것 같은데 자꾸 에러가 나서
더 연구해보구 더 올려야 겠다 ㅋㅋ
더 좋은 방법 아시는분 리플 부탁 드립니다~!
추가
-------------------------------------------------------------
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LS_CPP=$(subst $(1)/,,$(wildcard $(1)/*.cpp))
LS_CPP2=$(subst $(1)/,,$(wildcard $(1)/basea/*.cpp))
LOCAL_MODULE := droidblaster
LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH)) \
$(call LS_CPP2,$(LOCAL_PATH)) \
LOCAL_LDLIBS := -landroid -llog -lEGL -lGLESv1_CM
LOCAL_STATIC_LIBRARIES := android_native_app_glue png
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
$(call import-module,libpng)
----------------------------
./basea/TimeService.h \
./basea/TimeService.cpp
대신
LS_CPP2=$(subst $(1)/,,$(wildcard $(1)/basea/*.cpp))
여기에 폴더를 지정해주고
LOCAL_SRC_FILES := $(call LS_CPP,$(LOCAL_PATH)) \
$(call LS_CPP2,$(LOCAL_PATH)) \
이런식으로 불러오는 것도 됩니다 ^^
=================================
=================================
=================================
출처: http://www.cocos2d-x.org/boards/6/topics/5321
edisun dongis there are way to create android.mk automaticallyMinggo ZhangRE: is there are way to create android.mk automaticallyedisun dongRE: is there are way to create android.mk automaticallyVictor LavrentyevRE: is there are way to create android.mk automatically小 苏RE: is there are way to create android.mk automaticallyVictor LavrentyevRE: is there are way to create android.mk automaticallyFoXx WeLlRE: is there are way to create android.mk automaticallyaries sulitRE: is there are way to create android.mk automaticallyPipero ManRE: is there are way to create android.mk automaticallyVictor LavrentyevRE: is there are way to create android.mk automaticallyaries sulitRE: is there are way to create android.mk automatically
edisun dong이(가) 약 일년 전에 추가함 the file is look like : LOCAL_SRC_FILES := main.cpp \ ../../../Classes/AppDelegate.cpp \ ../../../Classes/GameMenu/GameMainMenu.cpp \ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \ $(LOCAL_PATH)/../../../../cocos2dx/platform \ $(LOCAL_PATH)/../../../../cocos2dx/include \ $(LOCAL_PATH)/../../../../CocosDenshion/include \ $(LOCAL_PATH)/../../../Classes \ $(LOCAL_PATH)/../../../Classes/GameMenu so any class i add ,i must modify the android.mk file,is any tool can fix that?? |
Minggo Zhang이(가) 약 일년 전에 추가함 No now, may be you can write a script to do it and share with the community. |
edisun dong이(가) 약 일년 전에 추가함 OK,i will ,but not today,and i am not so good at shell,may be i will use .exe(windows) or .app(mac os),sorry linux guys |
Victor Lavrentyev이(가) 11달 전에 추가함 Include all *.cpp files automatically in Android.mk:
|
小 苏이(가) 11달 전에 추가함 it's good.. |
Victor Lavrentyev이(가) 11달 전에 추가함 O! I found "../HelloWorld/android/jni/list.sh" with function list_alldir(). It look like useful for this issue, but don't used by default... strange. |
FoXx WeLl이(가) 11달 전에 추가함 OK~ I fix android.mk to create android.mk automatically~ It can find any subdirs and *.cpp that u add in "Classes" It's for cocos2d-1.0.1-x-0.10.0 !!! or u can download file and cover it Android.mk (994 Bytes) |
aries sulit이(가) 9일 전에 추가함 Hi! Is it okay for .mm classes? cause i have .mm classes on my iphone cocos2d-x project, and after i modified Android.mk file. I got this error. Compile++ thumb : game <= ClassicGameplay.mm fatal error: directory compilation terminated. make: *** [obj/local/armeabi/objs-debug/game/__/__/__/__/source/states/ClassicGameplay.o] Error 1 ERROR: NDK build failed. |
Pipero Man이(가) 9일 전에 추가함 My Android.mk looks like this: Compile all cpp in each folder. It is helpful if you add new cpps and don't want to add manually (but folders must be). All headers are relatives. |
Victor Lavrentyev이(가) 9일 전에 추가함 hm... 1. Android don't understands Obj C language 2. "-name *.cpp" - it takes cpp files only |
aries sulit이(가) 8일 전에 추가함 Hi! so.. I badly need to convert obj-c codes to c++ D: Thanks BTW! |
=================================
=================================
=================================
'스마트기기개발관련 > OpenGL (그래픽, 게임)' 카테고리의 다른 글
android 안드로이드 ndk jni 오픈지엘 OpenGL ES 관련 EGL_DEFAULT_DISPLAY, eglCreateWindowSurface,glDrawTexfOES 등 에러 관련 (0) | 2020.09.18 |
---|---|
android 안드로이드 NDK에서 C++ STL 사용 과련 (0) | 2020.09.18 |
android 안드로이드 오픈지엘 OpenGL ES 2.0 효과, api 등등 (1) | 2020.09.18 |
안드로이드 Android ndk 오픈지엘 OpenGL ES LoadTexture 관련 (0) | 2020.09.18 |
안드로이드 android ndk 디버그 하는법 관련 (0) | 2020.09.18 |