Call shell commands in Android. mk

Source: Internet
Author: User
Tags call shell echo b

In the past few days, when writing Android. mk, sometimes I always want to print some variables or something. If ECHO is not available, I can find a way to access the Internet.

Finally, I found such an article quite well.

Address: http://blog.csdn.net/michaelpp/article/details/6249989


There are many examples in the android compilation script, such as in the build/CORE/Main. mk file:

 

Ifeq ($ (build_ OS), Linux)

Build_arch: = $ (shell uname-m)

Ifneq (64, $ (findstring 64, $ (build_arch )))

$ (Warning ************************************* ***********************)

$ (Warning you are attempting to build on a 32-bit system .)

$ (Warning only 64-bit build environments are supported beyond froyo/2.2 .)

$ (Warning ************************************* ***********************)

$ (Error stop)

Endif

Endif

 

Ifneq ($ (host_ OS), Windows)

Ifneq ($ (host_ OS)-$ (host_arch), Darwin-PPC)

# Check for a Case Sensitive File System

Ifneq (A, $ (shell mkdir-p $ (out_dir );/

Echo A> $ (out_dir)/casecheck.txt ;/

Echo B> $ (out_dir)/casecheck.txt ;/

Cat $ (out_dir)/casecheck.txt ))

$ (Warning ************************************* ***********************)

$ (Warning you are building on a case-insensitive filesystem .)

$ (Warning please move your source tree to a case-sensitive filesystem .)

$ (Warning ************************************* ***********************)

$ (Error case-insensitive filesystems not supported)

Endif

Endif

Endif

 In this way, you can print any variable or call any other command.

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.