"Turn" Update:Android.mk in the Local_src_files, local_c_includes

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.