Use existing Makefile targets in VSCode Tasks
To use exisiting Makefile targets in VSCode tasks, one only needs a couple of json task definitions in .vscode/tasks.json.
{
"version": "2.0.0",
"tasks": [
{
"label": "make build",
"type": "shell",
"command": "make",
"args": [
"all"
],
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}",
"env": {"QPC":"${env:HOME}/qp/qpc"}
},
"problemMatcher": [],
"dependsOn":["make clean"]
},
{
"label": "make clean",
"type": "shell",
"command": "make",
"args": [
"clean"
],
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
},
{
"label": "run",
"type": "shell",
"command": "build/file_name",
"group": "test",
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": []
}
]
}
This is using Tasks version 2.0.0. Documentation: https://code.visualstudio.com/docs/editor/tasks
Usage:
Terminal > Run Build TaskTerminal > Run Task