all:$(SUBDIR)
echo $(SUBDIR)
$(SUBDIR):: //请问这个冒号是什么意思呀。
make -C $@
就能成功执行:
Z:\test>make
make -C xx1d
make[1]: Entering directory `Z:/test/xx1d'
echo "11111111"
"11111111"
make[1]: Leaving directory `Z:/test/xx1d'
make -C xx2d
make[1]: Entering directory `Z:/test/xx2d'
echo "22222222"
"22222222"
make[1]: Leaving directory `Z:/test/xx2d'
echo xx1d xx2d
xx1d xx2d
2 个解决方案
#1
其实就是上一次程序或脚本的退出码,主要是用来判断程序或脚本的执行是否成功,检查出错的原因之类的。
#2
那是Makefile的double colon规则。
Double-colon rules are somewhat obscure and not often very useful; they provide a mechanism for cases in which the method used to update a target differs depending on which prerequisite files caused the update, and such cases are rare.
#1
其实就是上一次程序或脚本的退出码,主要是用来判断程序或脚本的执行是否成功,检查出错的原因之类的。
#2
那是Makefile的double colon规则。
Double-colon rules are somewhat obscure and not often very useful; they provide a mechanism for cases in which the method used to update a target differs depending on which prerequisite files caused the update, and such cases are rare.