增加 独立模块的编译.
Signed-off-by: rick.chan <chenyang@autoai.com>
This commit is contained in:
parent
9a5c1cf78c
commit
6c4bd921e1
|
@ -17,9 +17,27 @@ make modules_install INSTALL_MOD_PATH=<target dir>
|
|||
make clean
|
||||
# 类似 make clean,但同时也将configure生成的文件全部删除掉,包括Makefile。
|
||||
make distclean
|
||||
```
|
||||
|
||||
## 独立模块的编译
|
||||
|
||||
有些模块在开发时往往独立于内核进行组织和编译,其编译方法如下:
|
||||
|
||||
```bash
|
||||
# 独立于内核源码编译内核外部模块,-C 指定内核源码目录(必须已经编译过),M 指定外部模块所在源码目录
|
||||
make -C <kernel source dir> M=<modules dir> modules
|
||||
# 清除外部模块的编译结果
|
||||
make -C <kernel source dir> M=<modules dir> clean
|
||||
```
|
||||
|
||||
以上命令经常以下列形式写入到 Makefile 中:
|
||||
|
||||
```Makefile
|
||||
all:
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
||||
```
|
||||
|
||||
## make menuconfig 常用快捷键
|
||||
|
|
Loading…
Reference in New Issue