In the mk file, the difference between = , := , ?= , +=

= is the most basic assignment
: = is to overwrite the previous value
? = is to assign the value after the equal sign if it has not been assigned

+= is to add the value after the equal sign

The difference between = and := is that = will determine the value of the variable after the makefile is expanded, that is, the last specified value

eg:

            x = foo
            y = $(x) bar
            x = xyz

      In the example above, the value of y would be  xyz bar , not  foo bar .

And := indicates that the value of the variable is determined by its position in the makefile, not the final value after the expansion of the entire makefile.

In the above example, the value of y will be  foo bar, not  xyz bar 
 

Guess you like

Origin blog.csdn.net/xiaowang_lj/article/details/131768046