Skip to content

Add make support for build and run#390

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/add-make-support
Draft

Add make support for build and run#390
Copilot wants to merge 2 commits intomasterfrom
copilot/add-make-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 19, 2026

Projects using Makefiles can't use the extension's compile/run commands because the compiler path settings always append the source file as an argument — incompatible with make. This adds a first-class make mode.

New settings

Setting Default Description
c-cpp-compile-run.use-make false Route compile/run through make instead of gcc/g++
c-cpp-compile-run.make-path "make" Path to make executable
c-cpp-compile-run.make-build-target "" Build target (empty = default target)
c-cpp-compile-run.make-run-target "" Run target (empty = execute compiled binary directly)

Changes

  • package.json / configuration.ts: Four new scoped settings with corresponding accessors.
  • src/make-runner.ts (new): MakeRunner class with build() and run() methods.
    • build() runs make [target] as a VS Code Task with $gcc problem matcher — no source file arg.
    • run() runs make [run-target] in the integrated terminal when a run target is configured; falls back to the normal Runner (direct binary execution) otherwise.
    • Working directory is resolved by checking for a Makefile/makefile in the source file's directory first, then falling back to the workspace root.
  • compile-run-manager.ts: compile, run, and compileRun route through MakeRunner when use-make is enabled; existing gcc/g++ path is unchanged.

Example workspace config

{
  "c-cpp-compile-run.use-make": true,
  "c-cpp-compile-run.make-build-target": "all",
  "c-cpp-compile-run.make-run-target": "run"
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for compiling/running with make</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.

Thank you for your extension. In some of my project I use a Makefile to determine flags and output files, and in a few cases I have a target for running the code.

Describe the solution you'd like

Please add a configuration option that calls make instead of gcc. If possible, please add the make targets for building and running the code.

Describe alternatives you've considered

Changing the executable is not enough because it would add the source file as an argument, which make does not support. Using the native vscode extensions for Makefile also don't work because I'm using this extension in code-server, which cannot use MS native extensions.
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: danielpinto8zz6 <8846362+danielpinto8zz6@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for compiling and running with make Add make support for build and run Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for compiling/running with make

2 participants