Как установить make windows

Как установить и использовать make в Windows?

Я следую инструкциям человека, репозиторий которого я клонировал на свою машину. Я хочу просто: иметь возможность использовать команду make как часть настройки среды кода. Но я использую Windows и поискал в Интернете только файл make.exe для загрузки, файл make-4.1.tar.gz для загрузки (я не знаю, что с ним делать дальше) и кое-что о загрузке MinGW (для GNU; но после его установки я не нашел упоминания о «make»).

Мне не нужен компилятор GNU или подобные вещи; Я хочу использовать только make в Windows. Скажите, пожалуйста, что мне нужно сделать для этого?

10 ответов

1.1 Скопируйте исполняемый файл make MinGW в make.exe :

1.2 Создайте ссылку на фактический исполняемый файл в вашем PATH. В этом случае при обновлении MinGW ссылка не удаляется:

Одно из решений, которое может оказаться полезным, если вы хотите использовать эмулятор командной строки cmder. Вы можете установить установщик пакетов по отдельности. Сначала мы устанавливаем по очереди в командной строке Windows, используя следующую строку:

После установки chocolatey можно использовать команду choco для установки make. После установки вам нужно будет добавить псевдоним в /cmder/config/user_aliases.cmd. Следует добавить следующую строку:

После этого Make будет работать в среде cmder.

Могу предложить пошаговый подход.

Другой альтернативой является то, что если вы уже установили minGW и добавили папку bin в переменную среды Path, вы можете использовать «mingw32-make» вместо «make».

Вы также можете создать символическую ссылку от «make» к «mingw32-make» или скопировать и изменить имя файла. Я бы не рекомендовал эти варианты раньше, они будут работать, пока вы не внесете изменения в minGW.

Если Bash недоступен в меню «Пуск», вот инструкции по включению этой функции Windows (только для 64-разрядной версии Windows):

Альтернативой является установка make через Chocolatey (как указано @Vasantha Ganesh K)

GNU make доступен для шоколадного.

Установите шоколад с здесь.

Теперь вы сможете использовать Make в Windows.
Я пробовал использовать его на MinGW, но он должен работать и на CMD.

Загрузите make.exe с официального сайта GnuWin32

Источник

Use Make on Windows

Make is an incredibly powerful tool for managing application compilation, testing and installation, or even setting up the development environment. It comes standard on Linux and macOS, and it is therefore widely adopted. But how can you get started with Make on Windows?

If you are using Windows Subsystem for Linux (WSL/WSL2), then you can easily install make with the sudo apt install make command. However, if you want to have the command available natively on a normal terminal prompt then you need to install a Windows-specific version.

How to install Make on Windows?

Next, verify that make works, and then you can start using it normally:

Alternatively, if you’d prefer to use the new native Windows package manager you can use this winget command:

This will download the installer and run it for you automatically. Make will also be added to the list of installed programs so you can uninstall it from the Add or remove programs section. You will still get the following error since the installer does not add make to the system path:

Using Make on Windows

From a syntax perspective there is no difference between Linux and Windows. You still need to write a Makefile and define the shell commands in tab-indented sections. However, the commands themselves need to be adjusted for the changed operating system.

Normally on a Makefile each line runs on a separate shell. If you need to run many commands from the same shell instance then they should be defined on the same line and chained together with the && operator.

The above example defines phony Make targets for setting up a Python virtual environment and running unit tests. Assuming that you have installed Python, running make test should execute successfully, running zero unit tests since it couldn’t find any.

If you need to make your Makefile support different operating systems, then you have to also detect the operating system to be able to run a different set of commands for each OS. With Windows the added difficulty is that in some cases (MSYS, MINGW) you actually need to use the Linux commands.

This answer on Stack Overflow has one solution for finding the correct environment, relying on how the system Path is delimited by semicolons ; unlike all other OSes. We can use that information to make our small example Makefile work natively on both Windows and Linux:

Similarly, if you’re compiling C or C++ code, you need to use gcc or g++ on Linux, and cl on the Windows developer command prompt. Also the command arguments will need to be different.

Conclusion

It’s possible to use Make natively on Windows, and it’s not even that difficult. If you’re accustomed to using Bash and Linux commands then the switch to PowerShell commands might require a bit of adaptation. Definitely the biggest challenge is to write Makefiles that support different operating systems, but as we saw that can be accomplished with some tricks.

Источник

Как использовать GNU Make в Windows?

Вот как я получил его для работы:

Затем я могу открыть командную строку и набрать make:

Это означает, что он работает сейчас!

Я использую GNU Make из проекта GnuWin32, см. http://gnuwin32.sourceforge.net/, но каких-то обновлений на некоторое время не было, поэтому я не уверен в этом статусе проекта.

Хотя этот вопрос старый, его все же задают многие, кто использует MSYS2.

Я начал использовать его в этом году, чтобы заменить CygWin, и я очень доволен.

Вы можете добавить папку приложения в свой путь из командной строки, используя:

setx PATH “% PATH%; c:\MinGW\bin”

Обратите внимание, что вам, вероятно, нужно будет открыть новое окно команд для изменения измененного параметра пути.

В качестве альтернативы, если вы просто хотите установить make, вы можете использовать диспетчер пакетов chocolatey для установки gnu make с помощью

Это касается любых проблем с путями, которые могут у вас возникнуть.

user1594322 дал правильный ответ, но когда я попробовал это, я столкнулся с проблемами администратора/разрешения. Я смог скопировать “mingw32-make.exe” и вставить его, переопределив/обойдя проблемы администратора, а затем отредактировав копию в “make.exe”. На VirtualBox в гостях Win7.

Ответ пользователя 1594322 хороший, у меня сейчас работает (mingw64). Спасибо!

Хотя make сам по себе доступен как отдельный исполняемый файл ( gnuwin32.sourceforge.net пакет make ), его использование в надлежащей среде разработки означает использование msys2.

Git 2.24 (Q4 2019) показывает, что:

test-tool run-command : научиться управлять (частями) тестового набора

Signed-off-by: Johannes Schindelin

Git для Windows переключается между циклами, предоставляя среду разработки, которая позволяет собирать Git и запускать его набор тестов.

Для этого вся система MSYS2, включая GNU make и GCC, предлагается как “Git для Windows SDK”.
Это имеет свою цену: первоначальная загрузка указанного SDK весит несколько сотен мегабайт, а распакованный SDK занимает

2 ГБ дискового пространства.

Идея состоит в том, чтобы позволить сборку Git в Visual Studio и запускать отдельные тесты с использованием Portable Git.

Источник

Как установить и использовать «make» в Windows?

Я следую инструкциям кого-то, чей репозиторий я клонировал на свою машину. Я хочу просто: иметь возможность использовать команду make как часть настройки среды кода. Но я использую Windows, и я искал в Интернете только для того, чтобы найти файл make.exe для загрузки, файл make-4.1.tar.gz для загрузки (я не знаю, что с ним делать дальше), а также о том, что загружая MinGW (для GNU, но после установки я не нашел упоминания о «make»).

Я не хочу компилятор GNU или связанные с ним вещи; Я просто хочу использовать «make» в Windows. Скажите, пожалуйста, что я должен сделать, чтобы это сделать.

ОТВЕТЫ

Ответ 1

или создайте ссылку на фактический исполняемый файл в вашей переменной PATH. В этом случае, если вы обновите MinGW, ссылка не будет удалена:

Ответ 2

GNU make доступен на шоколадной основе.

Теперь вы сможете использовать Make на Windows.
Я пытался использовать его на MinGW, но он должен работать и на CMD.

Ответ 3

Принятый ответ в целом является плохой идеей, потому что созданный вручную make.exe будет make.exe и потенциально может вызвать непредвиденные проблемы. Это на самом деле ломает RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105

Альтернативой является установка make через Chocolatey (как указано @Vasantha Ganesh K)

Ответ 4

Ответ 5

Если Bash недоступен в меню «Пуск», ниже приведены инструкции по включению этой функции Windows (только для 64-разрядной версии Windows):

Ответ 6

Скачайте make.exe с их официального сайта GnuWin32

В сеансе загрузки щелкните Полный пакет, кроме источников.

Следуйте инструкциям по установке.

По завершении добавьте /bin/ в переменную PATH.

Теперь вы сможете использовать make в cmd.

Ответ 7

Вы также можете создать символическую ссылку из «make» в «mingw32-make» или скопировать и изменить имя файла. Я бы не рекомендовал варианты раньше, они будут работать, пока вы не внесете изменения в minGW.

Источник

How to install and use «make» in Windows?

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. I searched online, but I could only find a make.exe file, a make-4.1.tar.gz file (I don’t know what to do with it next) and instructions for how to download MinGW (for GNU; but after installing it I didn’t find any mention of «make»).

How do I use make in Windows without a GNU compiler or related packages?

11 Answers 11

make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:

The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :

For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.

An outdated alternative was MinGw, but the project seems to be abandoned so it’s better to go for one of the previous choices.

Как установить make windows. nL5Sn. Как установить make windows фото. Как установить make windows-nL5Sn. картинка Как установить make windows. картинка nL5Sn.

GNU make is available on chocolatey.

Install chocolatey from here.

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.

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)

If Bash isn’t available from your start menu, here are instructions for turning on that Windows feature (64-bit Windows only):

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 /bin/ to the PATH variable.

Now you will be able to use make in cmd.

Как установить make windows. photo. Как установить make windows фото. Как установить make windows-photo. картинка Как установить make windows. картинка photo.

I could suggest a step by step approach.

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.

Как установить make windows. photo. Как установить make windows фото. Как установить make windows-photo. картинка Как установить make windows. картинка photo.

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:

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 will then operate in the cmder environment.

Как установить make windows. photo. Как установить make windows фото. Как установить make windows-photo. картинка Как установить make windows. картинка photo.

If above commands displays any error then install Chocolatey(choco)

Open cmd and copy and paste the below command (command copied from chocolatey URL)

Как установить make windows. 6Ou94. Как установить make windows фото. Как установить make windows-6Ou94. картинка Как установить make windows. картинка 6Ou94.

I once had the same problem. But I am surprised not to find one particular solution here.

choco appears to offer make 4.3, currently. So one could expect recent versions there.

As others have noted: This manual installation might cause conflicts if you have various make versions installed by other programs as well.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *