+ -
当前位置:首页 → 问答吧 → 编写makefile以后 make不通过

编写makefile以后 make不通过

时间:2010-09-19

来源:互联网

我的makefile是这么写的:
内核的源码在/home/juer/src/linux-2.6.25.16里面
PWD=$(shell pwd)
KERNEL_SRC=/home/juer/src/linux-2.6.25.16
obj-m :=ip46natForTest.o
module-objs :=ip46natForTest.o
all:
        $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
clean:
        rm *.ko
        rm *.o



报错:

root@juer:/home/juer/ip46natForTest# make
make: Warning: File `Makefile' has modification time 5.3e+04 s in the future
make -C /lib/modules/2.6.25.16juer/build M=/home/juer/ip46natForTest modules
make[1]: Entering directory `/home/juer/src/linux-2.6.25.16'
make[2]: Warning: File `/home/juer/ip46natForTest/Makefile' has modification time 5.3e+04 s in the future
make[2]: *** No rule to make target `/home/juer/ip46natForTest/ip46natForTest.c', needed by `/home/juer/ip46natForTest/ip46natForTest.o'.  Stop.
make[1]: *** [_module_/home/juer/ip46natForTest] Error 2
make[1]: Leaving directory `/home/juer/src/linux-2.6.25.16'
make: *** [default] Error 2


希望高手来指点下

作者: lantian0811   发布时间: 2010-09-19

obj-m :=ip46natForTest.o
module-objs :=ip46natForTest.o

修改为
obj-m :=ip46natForTest.o
ip46natForTest-objs :=ip46natForTest.o

如果模块的依赖目标文件只有一个... 第二句话完全可以不要...

作者: PCliangtao   发布时间: 2010-09-19

回复 PCliangtao


    谢谢 我试试

作者: lantian0811   发布时间: 2010-09-19

回复 PCliangtao


    貌似还是不行

作者: lantian0811   发布时间: 2010-09-19

回复 PCliangtao

错误信息::
    root@juer:/home/juer/ip46natForTest# make
make: Warning: File `Makefile' has modification time 5.4e+04 s in the future
make -C /home/juer/src/linux-2.6.25.16 M=/home/juer/ip46natForTest modules
make[1]: Entering directory `/home/juer/src/linux-2.6.25.16'
make[2]: Warning: File `/home/juer/ip46natForTest/Makefile' has modification time 5.4e+04 s in the future
make[2]: Circular /home/juer/ip46natForTest/ip46natForTest.o <- /home/juer/ip46natForTest/ip46natForTest.o dependency dropped.
  LD [M]  /home/juer/ip46natForTest/ip46natForTest.o
ld: no input files
make[2]: *** [/home/juer/ip46natForTest/ip46natForTest.o] Error 1
make[1]: *** [_module_/home/juer/ip46natForTest] Error 2
make[1]: Leaving directory `/home/juer/src/linux-2.6.25.16'
make: *** [all] Error 2

作者: lantian0811   发布时间: 2010-09-19

热门下载

更多