makefile - Variable assignment in recursive make call -


i have simple makefile below:

var += 4 5 6  default:     @echo "$(var)" a:     var="1 2 3" make b:     make var="1 2 3" 

make a works expected , print 1 2 3 4 5 6, make b print 1 2 3. thought 2 variants identical.

the question is: why so?

to quote gnu make manual:

if variable has been set command argument, ordinary assignments in makefile ignored.

you can change overridedirective:

 override var += 4 5 6 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -