/home/student/Makefile:
a = $(shell pwd)
export a
all:
@echo $(a)
@make -C tt
/home/student/tt/Makefile:
b = $(shell pwd)
all:
@echo $(a)
@echo $(b)
在/home/student下make 。结果是什么呢?
/home/student
make[1]: 进入目录“/home/student/tt”
/home/student
/home/student/tt
make[1]: 离开目录“/home/student/tt”
通过结果说明了,a向下导的时候,不是以这种$(shell pwd)形式的(不像宏那样的替换),而是在上层makefile中得到它的”真体“/home/student,然后将其下导