How to Use make on Windows

 Option 2: Install GNU Make via Chocolatey#

This method allows you to use make directly in PowerShell or Command Prompt.

Prerequisites#

Before installing GNU Make via Chocolatey, ensure you have Chocolatey package manager installed on your Windows system.

To check if Chocolatey is installed: Open PowerShell as Administrator and run:

choco --version

If Chocolatey is not installed:

  1. Open PowerShell as Administrator
  2. Run the following command to install Chocolatey:

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

  3. Close and reopen PowerShell as Administrator

Installing GNU Make#

  1. Open PowerShell or Command Prompt as Administrator

    Press Win + X and select "Windows PowerShell (Admin)" or "Command Prompt (Admin)"

  2. Install GNU Make using Chocolatey

    choco install make

  3. Confirm the installation

    When prompted, type y or yes to proceed with the installation.

  4. Verify the installation

  5. After installation completes, verify that make is available:

    make --version

    You should see output similar to:

    GNU Make 4.x.x Built for Windows32

Usage#

Once installed, you can use make commands directly in any PowerShell or Command Prompt window:

# Navigate to your project directory
cd path\to\your\project

# Run make commands
make
make build
make clean
posted @ 2026-01-02 20:18  大块头  阅读(4)  评论(0)    收藏  举报