- 论坛徽章:
- 0
|
我的代码如下:
#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include <linux/types.h>
#include <linux/module.h>
int main()
{return 0;}
我的Makefile如下:
CC=gcc
INCLUDE = /usr/src/kernels/2.6.23.1-42.fc8-i686/include/linux
CFLAGS=-O2 -W -Wall -DMODULE -D__KERNEL__ -I$(INCLUDE)
TARGET=CharDrivers
SRC=CharDrivers.c
all (TARGET).o
clean:
rm -f *.o *~ core
出错如下:
/usr/src/kernels/2.6.23.1-42.fc8-i686/include/asm/module.h:69:2:error:#error unknown processor family
In file included from CharDrivers.x:11:/usr/src/kernels/2.6.23.1-42.fc8-i686/include/linux.h/module.h:In function 'search_module_extables':
因为fedora8 的内核源码在/usr/src/kernels/2.6.23.1-42.fc8-i686,所以我写了如上的Makefile,问题出在哪儿,困扰我很久了,求助! |
|