See the original: Update:Android.mk in the Local_src_files, local_c_includes
I wrote the ultimate tip of local_src_files in the previous two post writing android.mk
Tips for writing local_c_includes in Android.mk
Some of the tips for compiling android.mk files are mentioned, because they all involve shell commands, which can not work completely under Windows, I rewrite the script using pure makefile syntax
# Configure your own source file directory and source file suffix name My_files_path: = $ (Local_path) $ (local_path)/. /.. /classesmy_files_suffix: =%.cpp%.c# recursively iterates through all the files in the directory rwildcard=$ (wildcard $1$2) $ (foreach d,$ (wildcard $1*), $ (call Rwildcard, $d/,$2) # get the corresponding source file My_all_files: = $ (foreach src_path,$ (My_files_path), $ (call rwildcard,$ (Src_path), *. *)) My_all_files: = $ (my_all_files:$ (My_cpp_path)/./%=$ (my_cpp_path)%) My_src_list: = $ (Filter $ (my_files_suffix), $ (MY_ all_files)) My_src_list: = $ (my_src_list:$ (Local_path)/%=%) # Remove the repeating word of the string define Uniq = $ (eval seen: =) $ (foreach _,$1,$ (if $ (Filter $_,${seen}), $ (eval seen + = $_)) ${seen}endef# recursive traversal gets all directories my_all_dirs: = $ (dir $ (foreach src_path,$ (my_files_pa TH), $ (call rwildcard,$ (Src_path), */))) My_all_dirs: = $ (called uniq,$ (my_all_dirs)) # Assignment to the NDK compilation system Local_src_files: = $ (my_s rc_list) Local_c_includes: = $ (My_all_dirs)
fully written using the makefile syntax, you can work on all platforms
I have submitted a pull request https://github.com/cocos2d/cocos2d-x/pull/3921 in Cocos2d-x , hoping to be integrated into Cocos2d-x's code base, You do not need to modify it for later use.
"Turn" Update:Android.mk in the Local_src_files, local_c_includes