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.