android平台驱动开发(六)--Makefile和Kconfig简介

Makefile:

1.编译进内核,还是以模块方式加载

模块方式编译成ko,通常是自己添加脚本方式insmod ,android 平台通常默认有modprobe加载,不需要额外添加insmod脚本

lsmod |grep test

可以查看是否安装成功

rmmod test-m.ko 可以删除ko

2.多个c文件编译成一个ko,Makefile怎么写

c 复制代码
obj-m += test.o
test-objs := init.o
test-objs += test.o
test-objs += test1.o

或者
obj-m += test.o
test-objs := test.o gsihal/test1.o gsihal/test2.o

Kconfig:

注意配置完Kconfig,需要在common/arch/arm64/configs/xxdefconfig中定义

常用关键词

tristate表示支持-m -y -n 三种编译


相关推荐
orion5712 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户1204872216118 小时前
Linux驱动编译与加载
linux·嵌入式
用户805533698031 天前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户805533698031 天前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房2 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia3 天前
linux curl命令详解_curl详解
linux
扛枪的书生3 天前
Linux 网络管理器用法速查
linux
顺风尿一寸3 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
XIAOHEZIcode3 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
唐青枫3 天前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux