Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amezin/vscode-linux-kernel
Visual Studio Code project/compile_commands.json generator for Linux kernel sources and out-of-tree modules
https://github.com/amezin/vscode-linux-kernel
kernel linux-kernel visual-studio-code vscode
Last synced: 1 day ago
JSON representation
Visual Studio Code project/compile_commands.json generator for Linux kernel sources and out-of-tree modules
- Host: GitHub
- URL: https://github.com/amezin/vscode-linux-kernel
- Owner: amezin
- License: unlicense
- Created: 2018-09-30T01:51:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-23T09:44:56.000Z (about 1 year ago)
- Last Synced: 2024-12-13T12:12:40.707Z (9 days ago)
- Topics: kernel, linux-kernel, visual-studio-code, vscode
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 587
- Watchers: 22
- Forks: 157
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Visual Studio Code project for Linux kernel sources
===================================================Ensure the kernel is built (at least, all `*.cmd` files should be generated):
$ make defconfig
$ makeClone this repository as ".vscode":
$ git clone [email protected]:amezin/vscode-linux-kernel.git .vscode
Generate compile_commands.json:
$ python .vscode/generate_compdb.py
If you are not compiling kernel for x64, change `intelliSenseMode` in
`c_cpp_properties.json`. Possible values as of vscode-cpptools 1.0.1:* `gcc-x86`
* `gcc-x64`
* `gcc-arm`
* `gcc-arm64`Open the project:
$ code .
Out-of-tree builds
------------------https://github.com/amezin/vscode-linux-kernel/issues/4
Kernel can be built with separate output directory:
$ make O=../linux-build defconfig
$ make O=../linux-buildIn this case, you should pass the directory to `generate_compdb.py`:
$ python .vscode/generate_compdb.py -O ../linux-build
`compile_commands.json` will still be generated in the current directory (root of the `linux` repository).
Unfortunately, `tasks.json` will not work out of the box in this configuration (TODO).Out-of-tree module development
------------------------------If you build your module with this command:
$ make -C $KDIR M=$PWD modules
You could generate `compile_commands.json` with:
$ python .vscode/generate_compdb.py -O $KDIR $PWD
Example: https://github.com/amezin/nzxt-rgb-fan-controller-dkms