Uboot Learning Two----The three----the master makefile to learn silently compile

Source: Internet
Author: User

第45-54 Line:

# Deal with colliding definitions from tcsh etc.
Vendor=
47
48 #########################################################################
# Allow for Silent builds
Ifeq (, $ (findstring s,$ (makeflags)))//Determine if the FindString function is empty

Wuyi Xecho = echo//If there is an echo
"Else"
Xecho =://NULL if not, that is, do not print
endif
55


This section is mainly about the content of silent compilation


Uboot allows for silent compilation, which turns on silent compilation primarily by judging Ifeq (, $ (findstring s,$ (makeflags))).

Usage: At compile time, use make-s-will be passed as makeflags to makefile.

About Makefile Knowledge points:

Conditional judgment: Main Makefile50 Line: Ifeq (, $ (findstring s,$ (makeflags)))

"Learn Makefile with Me" on page 42nd:

The syntax for a conditional expression is:

<conditional-directive>

<text-if-true>

endif

And

<conditional-directiv>

<text-if-ture>

Else

<text-if-false>

endif

where <conditional-directiv> represents a conditional keyword, such as "ifeq".

The First keyword ifeq:

Ifeq (<ARG1>, <arg2>)

Ifeq ' arg1 ' arg2 '
Ifeq "Arg1" ' arg2 '

Ifeq ' arg1 ' "arg2"

Ifeq "Arg1" "Arg2"

Compare the values of the parameter "Arg1" and "arg2". The same is true.

The Second keyword IFNEQ:

Ifneq (<ARG1>, <arg2>)

Ifneq ' arg1 ' arg2 '

Ifneq "Arg1" ' arg2 '

Ifneq ' arg1 ' "arg2"

Ifneq "Arg1" "Arg2"

Compare the values of the parameter "Arg1" and "arg2". The difference is true.

The Third keyword ifdef:

Ifdef <variable-name>

If the value of the variable is not NULL, then the expression is true, otherwise false.

findstring function

Function call Syntax:

$ (<funciton> <arguments>)

Or

${<function> <arguments>}

$ (findstring <find>, <in>)

Function: Find <find> string in string <in>.

Returns: Returns <FIND> if found, otherwise returns an empty string.

So here Ifeq (, $ (findstring s,$ (makeflags)))

This means that if the return value of the FindString function is empty. If it is empty, then the two parameters of the ifeq function are equal and the condition is judged true. Execution <text-if-true>.

Uboot Learning Two----The three----the master makefile to learn silently compile

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.