什么是Linux内核驱动程序开发的vscode设置?

时间:2017-04-21 17:41:43

标签: c linux driver visual-studio-code

我需要在visual studio代码中构建简单的内核驱动程序 使用波纹管任务配置:

{
    "version": "0.1.0",
    "command": "make",
    "isShellCommand": true
}

但在我的Makefile中

obj-m := hellochardev.o

all:
    make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
clean:
    make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean

它分配M我的主目录,是否有解决方案来解决这个问题?

这里是构建日志:

make -C /lib/modules/4.8.0-46-generic/build/ M=/home/mohsen modules
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-46-generic'
scripts/Makefile.build:44: /home/mohsen/Makefile: No such file or directory
make[2]: *** No rule to make target '/home/mohsen/Makefile'.  Stop.
make[1]: *** [_module_/home/mohsen] Error 2
Makefile:1491: recipe for target '_module_/home/mohsen' failed
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-46-generic'
make: *** [all] Error 2
Makefile:4: recipe for target 'all' faile

0 个答案:

没有答案