I'm following the instructions of someone whose repository I cloned to my machine. What I want is simple: to be able to use the make
command as part of setting up the code environment. But I'm using Windows, and I searched online only to find a make.exe file to download, a make-4.1.tar.gz
file to download (I don't know what to do with it next), and things about downloading MinGW (for GNU; but after installing it I didn't find any mention of "make").
I don't want a GNU compiler or related stuff; I only want to use "make" in Windows. Please tell me what I should do to accomplish that.
Thanks in advance!
This question is related to
makefile
windows-8
windows-10
gnu-make
GNU make is available on chocolatey.
Install chocolatey from here.
Then, choco install make
.
Now you will be able to use Make on windows.
I've tried using it on MinGW, but it should work on CMD as well.
Download make.exe from their official site GnuWin32
In the Download session, click Complete package, except sources.
Follow the installation instructions.
Once finished, add the <installation directory>/bin/
to the PATH variable.
Now you will be able to use make in cmd.
I could suggest a step by step approach.
C:\Program Files (x86)\GnuWin32\
. ...;C:\Program Files (x86)\GnuWin32\bin
One solution that may helpful if you want to use the command line emulator cmder. You can install the package installer chocately. First we install chocately in windows command prompt using the following line:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
After chocolatey is installed the choco command can be used to install make. Once installed, you will need add an alias to /cmder/config/user_aliases.cmd. The following line should be added:
make="path_to_chocolatey\chocolatey\bin\make.exe" $*
Make will then operate in the cmder environment.
Another alternative is if you already installed minGW and added the bin folder the to Path environment variable, you can use "mingw32-make" instead of "make".
You can also create a symlink from "make" to "mingw32-make", or copying and changing the name of the file. I would not recommend the options before, they will work until you do changes on the minGW.
The accepted answer is a bad idea in general because the manually created make.exe
will stick around and can potentially cause unexpected problems. It actually breaks RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105
An alternative is installing make via Chocolatey (as pointed out by @Vasantha Ganesh K)
Another alternative is installing MSYS2 from Chocolatey and using make
from C:\tools\msys64\usr\bin
. If make
isn't installed automatically with MSYS2 you need to install it manually via pacman -S make
(as pointed out by @Thad Guidry and @Luke).
$ pacman -S make gettext base-devel
C:\msys64\usr\bin\
to your pathIf you're using Windows 10, it is built into the Linux subsystem feature. Just launch a Bash prompt (press the Windows key, then type bash
and choose "Bash on Ubuntu on Windows"), cd
to the directory you want to make and type make
.
FWIW, the Windows drives are found in /mnt
, e.g. C:\
drive is /mnt/c
in Bash.
If Bash isn't available from your start menu, here are instructions for turning on that Windows feature (64-bit Windows only):
Source: Stackoverflow.com