在linux上编译驱动程序make [英] compile driver on linux with make

查看:596
本文介绍了在linux上编译驱动程序make的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个错误讯息是什么意思?我试图运行make。它看起来像配置丢失。 Configure是内核源代码的一部分?

  make -C /lib/modules/4.2.0-19-generic/build SUBDIRS = / home / glochild / Downloads / AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE模块
make [1]:输入目录/usr/src/linux-headers-4.2.0-19-generic
CC [M] /home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o
/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.c:55:6:错误:宏__TIME__可能会阻止可重复生成[ -Werror = date-time]
__TIME____DATE__\\\

^
/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.c:55:19 :错误:宏__DATE__可能会阻止可重复生成[-Werror = date-time]
__TIME____DATE__\\\

^
cc1:错误
scripts / Makefile.build:264:目标配方/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o'failed
make [2]:*** [/ home /下载/ AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE / ax88179_178a.o]错误1
Makefile:1398:目标配方_module_ / home / glochild / Downloads / AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCEfailed
make [1] *** [_module_ / home / glochild / Downloads / AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE]错误2
make [1]:离开目录'/usr/src/linux-headers-4.2.0-19-generic'
Makefile:30:目标'default'失败的食谱
make:*** [默认]错误2


中添加 CFLAGS 变量

  -Wno-date-time 

这将禁用警告,并且由于警告被视为错误,因为 Makefile 正在传递 -Werror CFLAGS 代码无法编译。


What does this error message mean? I am trying to run make. It looks like configure is missing. Configure is part of the kernel source?

make -C /lib/modules/4.2.0-19-generic/build SUBDIRS=/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE modules
make[1]: Entering directory '/usr/src/linux-headers-4.2.0-19-generic'
  CC [M]  /home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o
/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.c:55:6: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
  " " __TIME__ " " __DATE__ "\n"
      ^
/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.c:55:19: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
  " " __TIME__ " " __DATE__ "\n"
                   ^
cc1: some warnings being treated as errors
scripts/Makefile.build:264: recipe for target '/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o' failed
make[2]: *** [/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE/ax88179_178a.o] Error 1
Makefile:1398: recipe for target '_module_/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE' failed
make[1]: *** [_module_/home/glochild/Downloads/AX88179_178A_LINUX_DRIVER_v1.10.0_SOURCE] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.2.0-19-generic'
Makefile:30: recipe for target 'default' failed
make: *** [default] Error 2

解决方案

In your Makefile add this to the CFLAGS variable

-Wno-date-time

this will disable the warning, and since warnings are treated as errors because the Makefile is passing -Werror with the CFLAGS the code can't compile.

这篇关于在linux上编译驱动程序make的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆