模块编程里makefile的错误
时间:2003-06-03
来源:互联网
到底我的makefile里什么地方写错了?
这是helloworld程序:
/*hello.c*/
#include <linux/kernel.h>
#include <linux/module.h>
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
int init_module()
{
printk("hello world --this is the kernel speaking\n");
return 0;
}
void cleanup_module()
{
printk("short is the life of a kernel module\n");
}
这是makefile的内容:
CC=gcc
CFLAGS:= -Wall -DMODULE -D_KERNEL_ -DLINUX
hello.o : hello.c /usr/include/linux/version.h
$(CC) $(CFLAGS) -c hello.c
为什么我在xterm下一执行make就有这样的错误:
makefile:4: *** missing separator. Stop.
这是helloworld程序:
/*hello.c*/
#include <linux/kernel.h>
#include <linux/module.h>
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif
int init_module()
{
printk("hello world --this is the kernel speaking\n");
return 0;
}
void cleanup_module()
{
printk("short is the life of a kernel module\n");
}
这是makefile的内容:
CC=gcc
CFLAGS:= -Wall -DMODULE -D_KERNEL_ -DLINUX
hello.o : hello.c /usr/include/linux/version.h
$(CC) $(CFLAGS) -c hello.c
为什么我在xterm下一执行make就有这样的错误:
makefile:4: *** missing separator. Stop.
作者: alittlekid 发布时间: 2003-06-03
Makefile的格式!请执行info make,仔细阅读Introduction部分,Rule Introduction章节,尤其注意这句话:
A "command" is an action that `make' carries out. A rule may have
more than one command, each on its own line. *Please note:* you need
to put a tab character at the beginning of every command line! This is
an obscurity that catches the unwary.
A "command" is an action that `make' carries out. A rule may have
more than one command, each on its own line. *Please note:* you need
to put a tab character at the beginning of every command line! This is
an obscurity that catches the unwary.
作者: moonlight 发布时间: 2003-06-04
检查这一行:
hello.o : hello.c /usr/include/linux/version.h
hello.o : hello.c /usr/include/linux/version.h
作者: kancon 发布时间: 2003-06-10
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28