The MakefileBuild Visual Studio Extension adds functionality to Visual Studio to open and build Makefiles. The extension provides a command that can be triggered to build the active Makefile in the editor, using make.exe found in the system PATH.
- Open Makefiles: Recognize Makefiles in the Visual Studio environment.
- Build Makefiles: Execute the
makecommand to build the Makefile. - Output Window Integration: Displays build output and errors in the Visual Studio Output window.
To use this extension, you need to have the GNU build tools installed on your system. Ensure make.exe is available in your system PATH.
To install the extension:
- Clone this repository.
- Open the solution in Visual Studio.
- Build the solution to produce the
.vsixfile. - Run the
.vsixfile to install the extension into Visual Studio.
- Open a Makefile in Visual Studio.
- Ensure
make.exeis available in your system PATH. - Trigger the
MakeCommandfrom the command palette.
The core functionality is implemented in the MakeCommand class:
- Initialization: The
InitializeAsyncmethod sets up the command and output window. - Execute Command: The
Executemethod retrieves the active Makefile, identifiesmake.exein the system PATH, and runs themakecommand. - Output Handling: Standard output and error from the
makecommand are captured and displayed in the Visual Studio Output window.