Local_path: = $ (call My-dir)
Local_mydir = $ (local_path)/. /.. /classes
Include $ (clear_vars)
$ (call import-add-path,$ (Local_path)/. /.. /COCOS2D)
$ (call import-add-path,$ (Local_path)/. /.. /cocos2d/external)
$ (call import-add-path,$ (Local_path)/. /.. /cocos2d/cocos)
$ (call import-add-path,$ (Local_path)/. /.. /cocos2d/cocos/editor-support)
Local_module: = cocos2dcpp_shared
Local_module_filename: = Libcocos2dcpp
#1 define macros to find all CPP files
Define All-cpp-files
$ (patsubst./%,%, $ (Shell find $ (local_mydir)-name "*.cpp"))
Endef
#2 define macros to find all C files, Android has a default definition, which can be omitted as appropriate here
Define All-c-files
$ (patsubst./%,%, $ (Shell find $ (local_mydir)-name "*.c"))
Endef
#3 get a list of all project files by looking up
Cpp_file_list: = $ (call all-cpp-files)
C_file_list: = $ (call all-c-files)
#4 to join the project file, the reason for not directly adding is the need for a Local_path replacement
$ (warning "prase begin")
Local_src_files: = $ (cpp_file_list:$ (Local_path)/%=%)
Local_src_files + = $ (c_file_list:$ (Local_path)/%=%)
Local_src_files + = Cpp_file_list
Local_src_files + = C_file_list
Local_src_files + = $ (local_path)/main.cpp
$ (warning "prase end")
Define All-include-dirs
$ (patsubst./%,%, $ (Shell find $ (local_mydir)-type D))
Endef
#5 Join header File
#LOCAL_C_INCLUDES: = $ (Local_path)/. /.. /classes
Local_c_includes: = $ (call all-include-dirs)
Local_c_includes + = $ (local_path)/. /.. /cocos2d
Local_c_includes + = $ (local_path)/. /.. /cocos2d/external
Local_c_includes + = $ (local_path)/. /.. /cocos2d/cocos/editor-support/
Local_c_includes + = $ (local_path)/. /.. /cocos2d/cocos/editor-support/cocostudio
Local_c_includes + = $ (local_path)/. /.. /cocos2d/cocos/editor-support/spine
Local_c_includes + = $ (local_path)/. /.. /cocos2d/cocos/ui
Local_c_includes + = $ (local_path)/. /.. /cocos2d/extensions
Local_c_includes + = $ (local_path)/. /.. /cocos2d/cocos/network
Local_c_includes + = $ (local_path)/. /.. /cocos2d/external/curl/include/ios
Local_c_includes + = $ (local_path)/. /.. /cocos2d/external/lua/lua
Local_c_includes + = $ (local_path)/. /.. /cocos2d/external/lua/tolua
#6 system default libraries that need to be linked
#7 add a static library, add local_whole_static_libraries to represent the compiler will fully link the static library without pruning optimization
Local_whole_static_libraries: = cocos2dx_static
Local_whole_static_libraries + = Cocosdenshion_static
# Local_whole_static_libraries + = Box2d_static
# Local_whole_static_libraries + = Cocosbuilder_static
Local_whole_static_libraries + = Spine_static
Local_whole_static_libraries + = Cocostudio_static
Local_whole_static_libraries + = Ui_static
Local_whole_static_libraries + = Cocos_network_static
Local_whole_static_libraries + = Cocos_extension_static
Local_whole_static_libraries + = Cocos_lua_static
#8 Precompiled macros
Local_cpp_features + = Exceptions
Local_cflags: =-duse_file32api
Local_export_cflags: =-duse_file32api
#9 declaration to generate a static library
Include $ (build_shared_library)
#10 add an external import library directory
#11 Add an import library (based on the import library directory added on the previous line)
$ (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,ui)
$ (call import-module,network)
$ (call import-module,extensions)
$ (call import-module,scripting/lua-bindings)
cocos2dx3.2 Transplant Android