I saw the question:
then I did as below:
HELLO='hello 1st'
HELLO_WORLD='$(HELLO) world!'
HELLO='hello 2nd'
all :
echo $(HELLO_WORLD)
HELLO='hello 3rd'
echo $(HELLO_WORLD)
HELLO='hello 4th'
echo $(HELLO_WORLD)
the result is that:
root@ubuntu:~# make all -s
hello 2nd world!
hello 2nd world!
hello 2nd world!
I confused, why the value of 'HELLO' was not set to hello 4th
but hello 2nd
update:
I update my code :
HELLO='hello 1st'
HELLO_WORLD='$(HELLO) world!'
HELLO='hello 2nd'
all :
HELLO='hello 3rd' && echo $(HELLO_WORLD)
HELLO='hello 4th' && echo $(HELLO_WORLD)
And the result:
root@ubuntu:~# make all -s
hello 2nd world!
hello 2nd world!
I have realized the sentences like HELLO='hello 3rd'
is not variable assignments finally.
You two help me a lot. Thanks the answers!