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 override
directive:
override var += 4 5 6
Comments
Post a Comment