Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 带有2个目标和if语句的makefile,错误原因是什么?_Linux_Makefile - Fatal编程技术网

Linux 带有2个目标和if语句的makefile,错误原因是什么?

Linux 带有2个目标和if语句的makefile,错误原因是什么?,linux,makefile,Linux,Makefile,生成文件: ab: if[-fs];然后 回声aaa fi 命令:生成b if[-fs];然后 /bin/sh:-c:第1行:语法错误:文件意外结束 制造:**[b]错误2 有人能告诉我为什么吗?你不应该把shell脚本和make脚本混为一谈。试试下面的方法 a b: @if test -f s; then \ echo "aaa";\ fi

生成文件:

ab:
if[-fs];然后
回声aaa
fi

命令:生成b

if[-fs];然后
/bin/sh:-c:第1行:语法错误:文件意外结束
制造:**[b]错误2


有人能告诉我为什么吗?

你不应该把shell脚本和make脚本混为一谈。试试下面的方法

a b:
        @if test -f s; then \
             echo "aaa";\
        fi