前景
Makefile
里面有配置文件,但是想要读取内容;通过预处理再获取对应的值;
里面存放相关的值;
脚本
shell
脚本
mkpath=./Makefile
result=$(make -s -f <(echo "include ${mkpath}"; echo '$(info $(SHOW):$(GOOD))'; echo "all:;"))
echo ${result}
Makefile
GOOD=show
SHOW=what the fuck
执行结果
$ ./test.sh
what the fuck:show