初学makefile 编写脚本如下:
var1 =
var2 = hello
all:
ifndef $var1
$var1 = hello
endif
ifeq ($var1,$var2)
echo "equal"
else
echo "not equal"
endif
.PHONY: all
运行错误:
testmf:11: *** commands commence before first target. Stop.
第11行echo "not equal" 与第9行 echo "not equal" 前面均有tab建,
不知道到底哪里出错了。求大家指点一下
求助:makefile错误 : commands commence before first target. Stop
-
- 帖子: 4
- 注册时间: 2009-03-26 14:06
-
- 帖子: 4
- 注册时间: 2009-03-26 14:06
Re: 求助:makefile错误 : commands commence before first target.
经过几次实验发现错误处在echo命令行处。
如果echo语句开始前未输入[Tab]建 则提示
testsubst:9: *** missing separator. Stop.
如果echo语句以[Tab]建开始 则提示
testsubst:9: *** commands commence before first target. Stop.
我又测试了教程上的几个不同的例子,发现都是如此。在条件判断语句中,一使用echo语句就出错*** commands commence before first target. Stop.。
继续纳闷中............
如果echo语句开始前未输入[Tab]建 则提示
testsubst:9: *** missing separator. Stop.
如果echo语句以[Tab]建开始 则提示
testsubst:9: *** commands commence before first target. Stop.
我又测试了教程上的几个不同的例子,发现都是如此。在条件判断语句中,一使用echo语句就出错*** commands commence before first target. Stop.。
继续纳闷中............
-
- 帖子: 3
- 注册时间: 2008-07-23 8:22
Re: 求助:makefile错误 : commands commence before first target.
在第一个endif之后加入;\emmanule 写了:初学makefile 编写脚本如下:
var1 =
var2 = hello
all:
ifndef $var1
$var1 = hello
endif
ifeq ($var1,$var2)
echo "equal"
else
echo "not equal"
endif
.PHONY: all
运行错误:
testmf:11: *** commands commence before first target. Stop.
第11行echo "not equal" 与第9行 echo "not equal" 前面均有tab建,
不知道到底哪里出错了。求大家指点一下
testsubst:9: *** missing separator. Stop. 提示 2个if语句之间没有分隔符
-
- 帖子: 1
- 注册时间: 2013-06-08 10:54
- 系统: windows
Re: 求助:makefile错误 : commands commence before first target.
make[1]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src'
rm -f
rm -f
make[2]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
Makefile:1: *** missing separator. Stop.
make[2]: Leaving directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
make[2]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/io'
但是makefile 和Rules.make两个文件都只有一行
../makefile
../Rules.make
每一个行加了tab后出现错误:
make[2]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
Makefile:1: *** commands commence before first target. Stop.
make[2]: Leaving directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
不知道怎么改
rm -f
rm -f
make[2]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
Makefile:1: *** missing separator. Stop.
make[2]: Leaving directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
make[2]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/io'
但是makefile 和Rules.make两个文件都只有一行
../makefile
../Rules.make
每一个行加了tab后出现错误:
make[2]: Entering directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
Makefile:1: *** commands commence before first target. Stop.
make[2]: Leaving directory `/home/yanzhixue/桌面/BSR_full/BSR/grouping/source/gpb_src/src/concurrent'
不知道怎么改