Makefile 中::= 和 = 的区别
作为一名初学者,在学习Makefile 的过程中会有这样的不解, :=和= 到底有什么样区别
################################################
STR = hello_world
OUTPUT = $(STR) # =
STR = hello_dodolook
all:
@echo OUTPUT #调用外部命令,命令前加@
执行make 输出hello_dodolook
##################################################
STR = hello_world
OUTPUT := $(STR) # :=
STR = hello_dodolook
all:
@echo OUTPUT #调用外部命令,命令前加@
执行make 输出hello_world
总结:= 定义的变量如果值内容本身就是变量,他不会延伸。如果是=,会延伸。