71

I am working on Windows 10. I want to run a "make build" in MINGW64 but following error comes up:

$ make build
bash: make: command not found

I want to build Glide for Golang

I tried following:

$ sudo yum install build-essential
bash: sudo: command not found

As well as:

$ yum install build-essential
bash: yum: command not found

And:

$ apt-cyg build-essential
bash: apt-cyg: command not found

How can I "work-around" this problem?

Zoe
  • 27,060
  • 21
  • 118
  • 148

11 Answers11

73
  • Go to ezwinports, https://sourceforge.net/projects/ezwinports/files/

  • Download make-4.2.1-without-guile-w32-bin.zip (get the version without guile)

  • Extract zip
  • Copy the contents to C:\ProgramFiles\Git\mingw64\ merging the folders, but do NOT overwrite/replace any exisiting files.
Vallabha Vamaravelli
  • 1,153
  • 1
  • 9
  • 15
  • 6
    Just to elaborate: for file(s) inside of extracted zip under: lib/bin/include, ignore 'share' if you want, copy carefully to corresponding folders under C:\ProgramFiles\Git\mingw64\ . Then restart git-bash, you'll see "make". – Emily Jul 05 '19 at 15:26
53

You can also use Chocolatey.

Having it installed, just run:

choco install make

When it finishes, it is installed and available in Git for Bash / MinGW.

Juan Calero
  • 4,124
  • 5
  • 31
  • 45
27

You have to install mingw-get and after that you can run mingw-get install msys-make to have the command make available.

Here is a link for what you want http://www.mingw.org/wiki/getting_started

Community
  • 1
  • 1
DistordAngel
  • 393
  • 4
  • 6
  • 3
    I am getting following error when i use above steps: mingw-get install make $ mingw-get install make mingw-get.exe: * ERROR * make: unknown package, can you please suggest – Amit Mahajan Oct 14 '16 at 22:07
  • 11
    The package is called `msys-make` not `make` – fillobotto Jan 15 '17 at 13:49
  • 3
    I had to use `mingw32-make` instead of `msys-make` – Chris Happy Jan 16 '20 at 01:34
  • *** ERROR *** package make-3.81-3-msys-1.0.13-lic.tar.lzma is already installed so sad. no one had same problem like me – greendino Jun 10 '21 at 04:38
  • 1
    @greendino this was the case for me as well; turned out I had MinGW\bin on my PATH but the make executable was under the msys bin directory and that dir was not on the PATH, so make was installed but the shell couldn't find it. My msys bin dir was MinGW\msys\1.0\bin and after adding it to my PATH the make command succeeded. – CCJ Mar 22 '22 at 00:49
1

We can't use the 'make' command on windows and we don't get it preinstalled with MINGW. So to use it, you need to download it first. The steps are as follows-

  1. Go to https://sourceforge.net/projects/mingw/postdownload and download it.
  2. After the installation is over, go and check if bin folder is present in the directory of MINGW .
  3. If everything works well till now, change the environment variables- go to settings of your laptop and type Environment variables. Go to it's section and click on 'environment variables' at the end.
  4. On the section where 'path' is written, add a new file - the location of the bin file and save.
  5. Install make by typing the following on mingw command line : mingw-get install mingw32-make
  6. Now make is installed. To use it in command line just write "mingw32-make" in place of "make".
Attreyee M
  • 19
  • 3
1

Mingw64 has mingw32-make.exe instead of make.exe in its bin folder.

Thus, alternative solution is to use mingw32-make, or alias to it.

(Mingw64 latest version: 12.2.0-rt_v10-rev2, from asset x86_64-12.2.0-release-win32-seh-ucrt-rt_v10-rev2.7z)

Johnny Wong
  • 945
  • 9
  • 16
1

There are few options available

  1. Go to the file location C:\msys64\mingw64\bin (choose the correct installation location as per your installation) and run the below command in the CMD

    C:\msys64\mingw64\bin>mklink make mingw32-make.exe
    
  2. Above link approach is not working for you then simply duplicate "mingw32-make.exe" and then rename it as "make.exe"

SridharKritha
  • 8,481
  • 2
  • 52
  • 43
0

Try using cmake itself. In the build directory, run:

cmake --build .

lallolu
  • 139
  • 2
  • 4
0
  • Go to downloads of jmeubank.github.io/tdm/gcc : https://jmeubank.github.io/tdm-gcc/download/
  • Download 64+32-bit MinGW-w64 edition.
  • Run the .exe file.
  • Click on Remove if you have tdm-gcc already.
  • Then Click on Create to install tdm-gcc.
  • Complete the installation.
  • Add path to environment variable if not added automatically.
  • Now run mingw32-make on your terminal / command prompt.

Hope this works

0

For Eclipse that uses mingw64 to compile C/C++ code. Do this to use the mingw32-make.exe file in the ....mingw64\bin install directory.

  1. Select the project name in Eclipse that contains the Makefile
  2. Then select "Project" ->properties on the menubar. A popout window will be displayed.
  3. Select the "Build C/C++ Build" menu option in the left pane if not already selected for you. Then select in the right panel the "Builder Settings" tab.
  4. Uncheck the box labeled "Use default build command".
  5. The textbox below the unchecked box becomes ungreyed. Then replace the default "make" command with "mingw32-make"
  6. Select "Apply and Close" and the popout window will close.
  7. Then just select "Project"->clean to start over and it should rebuild the code in the project based on the Makefile. Also it doesn't hurt to save your project changes and restart eclipse too, then build the project again.

Last resort, is copy the mingw32-make.exe in the mingw64\bin directory and rename it as make.exe

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
M SW
  • 9
  • 5
0

Check out https://leanprover.github.io/lean4/doc/make/msys2.html. The installing dependencies section suggests MSYS2 installation. The relevant section is quoted below.

The official webpage of MSYS2 provides one-click installers. Once installed, you should run the "MSYS2 MinGW 64-bit shell" from the start menu (the one that runs mingw64.exe). Do not run "MSYS2 MSYS" instead! MSYS2 has a package management system, pacman, which is used in Arch Linux.

Once msys2 is installed, as mentioned above open the MSYS2 MinGW64 shell and install make.

pacman -S make

Optional - uninstall any other installations of MinGW and assuming default path add C:\msys64\usr\bin to the Path variable.

kingvittu
  • 47
  • 8
-5

You have to install make first. Run any of the below commands and it will work.

pip install make

OR

conda install make
Ankit Moral
  • 157
  • 1
  • 4