#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
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
and rm
) begin with TAB, and all other lines such as ifneq
do not begin with TAB.
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:
之前检查obj-m:
和KDIR:
等。你的标签是否作为空格插入?
你错过了条件ifneq的第二部分($(KERNELRELEASE),)需要在逗号之后有一些东西,比如“2.6.17”(例如)。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.