makefile:缺少分隔符
#kernel build system and can use its lanauge
ifneq($(KERNELRELEASE),)
obj-m:=helloworld.o
else
KDIR:= /lib/modules/2.6.33.3-85.fc13.i686/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
rm -f *.ko *.o *.mod.o *.mod.c *.symvers
endif
错误是:
makefile:2:*** 缺少分隔符。停止
,但是对于 ifneq($(KERNELRELEASE),)
,如果我之前添加一个选项卡,则会收到另一个错误:
makefile:2: ***命令在第一个目标之前开始。停止
#kernel build system and can use its lanauge
ifneq($(KERNELRELEASE),)
obj-m:=helloworld.o
else
KDIR:= /lib/modules/2.6.33.3-85.fc13.i686/build
all:
make -C $(KDIR) M=$(PWD) modules
clean:
rm -f *.ko *.o *.mod.o *.mod.c *.symvers
endif
The error is:
makefile:2:*** missing separator . stop
but for the ifneq($(KERNELRELEASE),)
, if I add a tab before, I get another error:
makefile:2: ***commands commence before first target. stop
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
ifneq
和(
之间必须有一个空格。TAB前缀表示它是 shell 命令,因此请确保 shell 命令 (
make 和
rm
)以 TAB 开头,所有其他行(例如ifneq
)不以 TAB 开头。There must be a space between
ifneq
and(
.The TAB prefix means that it is a shell command, so be sure that the shell commands (
make
andrm
) begin with TAB, and all other lines such asifneq
do not begin with TAB.Make 抱怨第二行不是以制表符开头。您的 IDE/文本编辑器可能会使用空格作为制表符来保存文件。将 IDE 配置为使用制表符,或者使用 vim 或 nano 等简单编辑器,并将第二行的前导空格替换为制表符。
Make is complaining that the second line doesn't start with a tab. Your IDE/texteditor may be saving the file using spaces as equivalent to a tab character. Either configure the IDE to use the tab character, or use a simple editor like vim or nano and replace the leading white space on the second line with a tab.
在
obj-m:
和KDIR:
等之前检查。您的制表符是否被插入为空格?Check before
obj-m:
andKDIR:
etc. Are your tabs being inserted as spaces?您缺少条件 ifneq($(KERNELRELEASE),) 的第二部分,需要在逗号后添加一些内容,例如“2.6.17”(例如)。
You're missing the second part of your conditional ifneq($(KERNELRELEASE),) needs to have something after the comma, like "2.6.17" (for example).