Windows OS

How to Install and Use make in Windows


make is a command line utility that executes the makefile. This command line tool is supported by Unix, Linux, and Windows operating systems. The programming languages supported by shell command can utilize the make command. It is mainly used to recompile and relink a piece of code and also used to maintain libraries.

In this blog, we will demonstrate the way to install, use, and uninstall the make command on Windows.

How to Install make on Windows?

This section will offer the easiest method to install the make command using the Chocolatey package manager on PowerShell.

Step 1: Open PowerShell Command Prompt

First, press the “Window + X” key to access the Power User menu and run Windows PowerShell command prompt as Admin:

Step 2: Install Chocolatey Package Manager

Next, execute the below-provided command for Chocolatey package manager installation:

Confirm the installation of the Chocolatey package manager by running the “choco” command:

> choco

The given output indicates that we have successfully installed Chocolatey version “v1.1.0” on our Windows system:

Step 3: Install make

Finally, install the make utility using Chocolatey with the help of the following command:

> choco install make

Step 4: Verify make Version

Verify the make utility installation by checking out its version:

> make --version

You can see that we have successfully installed “GNU Make 4.3” on Windows. Let’s move ahead to use it.

How to Use make on Windows?

make command can be used for many purposes, but it is mainly utilized to execute a Makefile or description file.

Want to know the procedure to use the make command for running a Makefile? Check out the below-given steps.

Step 1: Create Makefile

First, we will create a text file with the name “Makefile” in our “Myproject” folder:

Paste the below-provided code to test the working of the make command and press “CTRL+S” to save it:

hello:
    echo "hello world"

Step 2: Remove .txt Extension

In the next step, remove the “.txt” file extension from the Makefile. To do so, first, select the “View” option of the menubar and enable the “File name extensions” checkbox as shown below:

Then, remove the “.txt” extension. Remember that you only need to remove the file extension without changing the file name. Upon doing so, an alert box will appear on the screen from where you have to hit the “Yes” button:

Step 3: Run make Command

After that, copy the path where the “Makefile” exists:

Open the command prompt by searching “CMD” in the “Startup” menu and open it:

Next, move to the folder where Makefile is saved. Use the “cd” command and paste the copied path as we have specified in the below-provided command:

> cd C:\Users\Talha Saif\Desktop\Myproject

Now, execute the “make” command to compile the Makefile code on the command prompt:

> make

You can see that we have successfully compiled and executed the Makefile using the make command:

The make utility also supports many options that can be used for performing different operations. Specify the “–help” option in the make command to view its manual:

> make --help

Let’s move ahead towards the uninstallation method of the make utility from Windows.

How to Uninstall make From Windows?

The make utility can be uninstalled from the Windows system using the choco command:

> choco uninstall make

We have effectively elaborated the method to install, use, and uninstall the make utility on Windows.

Conclusion

One of the easiest methods to install the make command utility on Windows is using the “Chocolatey” package manager on PowerShell. For this purpose, first, open Windows PowerShell and install the Chocolatey package manager. After that, install the make utility using the “choco install make” command. This blog explained the methods related to the installation, usage, and uninstallation of make on Windows.

About the author

Rafia Zafar

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.