foxx149
January 18, 2012, 10:25am
1
I fix android.mk to create android.mk automatically~
It can find any subdirs and .cpp that u add in “Classes”
<pre>
LOCAL_PATH := $
include $
LOCAL_MODULE := game_logic
dirs := $ ~~type d)
cppfilestemp1 := $~~type d)
cppfilestemp2 := $ -name .cpp)
cppfilestemp3 := $(sort $(cppfilestemp2))
cppfiles := $(subst $(LOCAL_PATH)/,$(cppfilestemp3))
LOCAL_SRC_FILES := $(cppfiles)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/cocos2dx $(LOCAL_PATH)/…/…/cocos2dx/platform $(LOCAL_PATH)/…/…/cocos2dx/include $(LOCAL_PATH)/…/…/CocosDenshion/include $(LOCAL_PATH)/…/…/cocos2dx/lua_support $(dirs)
sue602
January 19, 2012, 3:20am
2
it’s very useful,thank u for ur sharing
FoXx WeLl,
Help me to understand it right.
Let me take HellowWorld as a sample.
It has the following Android.mk files:
.mk
.mk
.mk
Which of them should I replace?
And what about
.mk ?
Do I let it alone?
Regards.
—
Please,
@FoXx WeLl, thanks for helping.
Regards.
—
Please,
StErMi
March 7, 2012, 2:58pm
6
Thank you very much I’m trying it right now
You rock mate! Amazing idea! Just worried that must add all 20 files by hands and keep it updated in future.
Thanks!
gamier
November 30, 2012, 6:34am
8
hi, i m getting this error when i run my app on eclipse for android “make: * No rule to make target `jni_‘/testcpp/main.cpp’, needed by `obj/local/armeabi/objs-debug/testcpp_shared/testcpp/main.o’.”
what’s wrong with my mk file?
here is my mk file :
TOP_LOCAL_PATH :=$(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TOP_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_LDLIBS:=-llog
LOCAL_MODULE := testcpp_shared
LOCAL_MODULE_FILENAME := libtestcpp
LOCAL_SRC_FILES := testcpp/main.cpp carTest.cpp test.cpp ScreenLayer.cpp track1.cpp GameOverScene.cpp MyContactListener.cpp story.cpp AdvanceSprite.cpp Hello.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes
LOCAL_STATIC_LIBRARIES := curl_static_prebuilt
LOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_common
LOCAL_WHOLE_STATIC_LIBRARIES = cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES = cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES = box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES = chipmunk_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
include $(BUILD_SHARED_LIBRARY)
$(call import-module,samples/TestCpp)
$(call import-module,cocos2dx)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)
$(call import-module,CocosDenshion/android)
$(call import-module,extensions)
$(call import-module,external/Box2D)
$(call import-module,external/chipmunk)