当前位置: 技术问答>linux和unix
初入内核模块编成,提示 Nothing to be done for `/home/yyy/aatacktool/aatacktool.c
来源: 互联网 发布时间:2016-08-09
本文导语: 下面是Makefile,请问各位大侠,为什么啊? obi-m = aatacktool.o KERNELDIR:=/home/linux-2.6.27/ #KERNELDIR:=/lib/modules/$(shell uname -r)/build KERNELHEAD:=/home/2.6.27/include KDIR:=/lib/modules/$(shell uname -r)/build # The current directory ...
下面是Makefile,请问各位大侠,为什么啊?
obi-m = aatacktool.o
KERNELDIR:=/home/linux-2.6.27/
#KERNELDIR:=/lib/modules/$(shell uname -r)/build
KERNELHEAD:=/home/2.6.27/include
KDIR:=/lib/modules/$(shell uname -r)/build
# The current directory is passed to sub-makes as argument
PWD:=$(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) -I $(KERNELHEAD) M=$(PWD) aatacktool.c
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
.PHONY: modules modules_install clean
下面是程序:
#include "aatacktool.h"
#define DRIVER_VERSION "v1.0"
#define DRIVER_AUTHOR "RF"
#define DRIVER_DESC "just for test"
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
static int init_func(void)
{
printk("Hello world 1.n" );
#if 0
nfho.hook = packet_check;
nfho.hooknum = NF_IP_PRE_ROUTING;
nfho.pf = PF_INET;
nfho.priority = NF_IP_PRI_FIRST;
nf_register_hook(&nfho);
#endif
return 0;
}
static void cleanup_func(void)
{
printk(KERN_ALERT "Goodbye world 1.n" );
//nf_unregister_hook(&nfho);
}
module_init(init_func);
module_exit(cleanup_func);
obi-m = aatacktool.o
KERNELDIR:=/home/linux-2.6.27/
#KERNELDIR:=/lib/modules/$(shell uname -r)/build
KERNELHEAD:=/home/2.6.27/include
KDIR:=/lib/modules/$(shell uname -r)/build
# The current directory is passed to sub-makes as argument
PWD:=$(shell pwd)
modules:
$(MAKE) -C $(KERNELDIR) -I $(KERNELHEAD) M=$(PWD) aatacktool.c
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
.PHONY: modules modules_install clean
下面是程序:
#include "aatacktool.h"
#define DRIVER_VERSION "v1.0"
#define DRIVER_AUTHOR "RF"
#define DRIVER_DESC "just for test"
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
static int init_func(void)
{
printk("Hello world 1.n" );
#if 0
nfho.hook = packet_check;
nfho.hooknum = NF_IP_PRE_ROUTING;
nfho.pf = PF_INET;
nfho.priority = NF_IP_PRI_FIRST;
nf_register_hook(&nfho);
#endif
return 0;
}
static void cleanup_func(void)
{
printk(KERN_ALERT "Goodbye world 1.n" );
//nf_unregister_hook(&nfho);
}
module_init(init_func);
module_exit(cleanup_func);
|
make clean, and then run "make"
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。