代码如下:
a = 1
b = 2
c = $(shell echo $$(($(a)+$(b))))
#采用expr进行运算时,必须在+的前后插入空格
d = $(shell expr $(a) + $(b))
e = $(shell expr $(a)+$(b))
f = $(a) + $(b)
ec:
echo $(c)
ed:
echo $(d)
ee:
echo $(e)
ef:
echo $(f)
#ec打印结果为:
echo 3
3
#ed打印结果为:
echo3
3
#ee打印结果为:
echo 1+2
1+2
#ef打印结果为:
echo 1 + 2
1 + 2