Today, colleagues found a script that can automatically generate ANDROID.MK. Paste it here and keep it for later use. Scripts that were previously found on the web only recognize classes that end in. cpp and can be modified to recognize the. C End of the class.
Local_path: = $ (call My-dir) include $ (clear_vars) Local_module: = Cocos2dcpp_sharedlocal_module_filename: = Libcocos2dcpp#traverse all the directory and Subdirectorydefine walk $ (wildcard $ (1)) $ (foreach E, $ (wildcard $ (1)/*), $ ( Call Walk, $ (e))) endef #traverse Classes directoryallfiles = $ (call walk, $ (local_path)/. /.. /classes) File_list: = Hellocpp/main.cppfile_list + = $ (filter%.cpp, $ (allfiles)) File_list + = $ (filter%.c, $ (allfiles)) F Ile_includes: = $ (Shell find $ (local_path)/. /.. /classes-type d) #source file would be compiledlocal_src_files: = $ (file_list:$ (Local_path)/%=%) Local_c_includes: = $ (Local_path)/. /.. /.. /external/box2d/$ (file_includes) Local_whole_static_libraries: = cocos2dx_static cocosdenshion_static Cocos_ Extension_static Box2d_staticinclude $ (build_shared_library) $ (call Import-module,.) $ (call import-module,audio/android) # $ (call import-module,box2d) # $ (call Import-module,editor-support/cocosbuilder) # $ (Call Import-module,editor-support/spine# $ (call Import-module,editor-support/cocostudio) # $ (call Import-module,network) # $ (call import-module,extensions)
Original address: http://blog.csdn.net/qqmcy/article/details/39551979
Cocos2d-x android.mk automatically generates. cpp and. Class C paths