Make for Windows
Make: GNU make utility to maintain groups of programs
Version
Description
Make is a tool which controls the generation of executables and other non-source files of a program from the program’s source files. Make gets its knowledge of how to build your program from a file called the makefile, which lists each of the non-source files and how to compute it from other files. When you write a program, you should write a makefile for it, so that it is possible to use Make to build and install the program.
Capabilities of Make
- Make enables the end user to build and install your package without knowing the details of how that is done — because these details are recorded in the makefile that you supply.
- Make figures out automatically which files it needs to update, based on which source files have changed. It also automatically determines the proper order for updating files, in case one non-source file depends on another non-source file. As a result, if you change a few source files and then run Make, it does not need to recompile all of your program. It updates only those non-source files that depend directly or indirectly on the source files that you changed.
- Make is not limited to any particular language. For each non-source file in the program, the makefile specifies the shell commands to compute it. These shell commands can run a compiler to produce an object file, the linker to produce an executable, ar to update a library, or TeX or Makeinfo to format documentation.
- Make is not limited to building a package. You can also use Make to control installing or deinstalling a package, generate tags tables for it, or anything else you want to do often enough to make it worth while writing down how to do it.
Homepage
Download
If you download the Setup program of the package, any requirements for running applications, such as dynamic link libraries (DLL’s) from the dependencies as listed below under Requirements, are already included. If you download the package as Zip files, then you must download and install the dependencies zip file yourself. Developer files (header files and libraries) from other packages are however not included; so if you wish to develop your own applications, you must separately install the required packages.
Description | Download | Size | Last change | Md5sum |
---|---|---|---|---|
• Complete package, except sources | Setup | 3384653 | 25 November 2006 | 8ae51379d1f3eef8360df4e674f17d6d |
• Sources | Setup | 1252948 | 25 November 2006 | b896c02e3d581040ba1ad65024bbf2cd |
• Binaries | Zip | 495645 | 25 November 2006 | 3521948bc27a31d1ade0dcb23be16d49 |
• Dependencies | Zip | 708206 | 25 November 2006 | d370415aa924fa023411c4099ef84563 |
• Documentation | Zip | 2470575 | 25 November 2006 | 43a07e449d4bab3eb3f31821640ecab7 |
• Sources | Zip | 2094753 | 25 November 2006 | 8bed4cf17c5206f8094f9c96779be663 |
You can also download the files from the GnuWin32 files page.
You can monitor new releases of the port of this package.
Как запустить makefile под WINDOWS.
Не так давно я пересел на AtmelStudio6 с AVRStudio4. Есть у меня классный программатор клон STK500. Который просто прекрасно работает с 4й версией. Вот и получается, что пишу я теперь проги под 6й версией, а программатором пользуюсь из под 4ой. Неудобно как то. Попробовал подключить программатор к 6й. Работает через пень колоду. То работает, то не работает. Решил я сделать новый, чтоб работал по 6й версией и не пукал. Решил что это будет AVRISP mkII.
Нарыл я проект LUFA. ТУТ
Скачал код, а там торчит makefile. Самой прошивки там нет, чтоб сразу залить в микроконтроллер. Значит надо запустить сборку makefile чтоб родился hex файл. А как это сделать? Без понятия. А надо. Начал рыть. Помог один товарищ линуксоид. Вместе с ним поколупались и нарыли вот что.
1). Установить прогу mingw-get-inst-20120426.exe. В одном из окон при установке галочку поставить напротив msys. Эта прога есть здесь.
2). Установить прогу bc-1.06-2.exe. Отсюда.
3). Указать путь для переменной PATH в XP 32bit,
Переменная PATH находится здесь.
Компьютер/свойства/дополнительно/переменные среды.
C:\MinGW\msys\1.0\bin;
C:\Program Files\GnuWin32\bin;
C:\Program Files\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin
Для WINDIWS_7 64bit
C:\MinGW\msys\1.0\bin;
C:\Program Files (x86)\GnuWin32\bin;
C:\Program Files (x86)\Atmel\Atmel Toolchain\AVR8 GCC\Native\3.4.2.939\avr8-gnu-toolchain\bin
4).Открыть консоль, зайти в нужную папку где находится файл make. Набрать команду make. Вот и все. Там же и появится желанный hex файл. Команда Make clean очищает от прежней сборки файлов.
Вот можно видео глянуть как это происходит.
Продолжение здесь.
cmake and make in Windows
I understand that in linux cmake, make and make install can be combined together to produce a release. For example:
In windows, however, I cannot find similar commands that can do the same job. Usually, what is done is to build a .sln project first if Visual Studio is used, after that compile the .sln project and in the end run the INSTALL project. Will it be possible to make a release with several commands as it has been done in Linux. Many thanks.
2 Answers 2
You can use msbuild instead of make:
or you could use CMake’s —build argument:
If you need the equivalent of the make command with no args (i.e. make all ) you would build the ALL_BUILD target as well, but this is built as part of the INSTALL target anyway.
In addition to Fraser’s answer, to get the first solution to work, one might need to call MSBuild in CMD as Administrator from the original path
Replace YEAR and EDITION with your corresponding values e.g. 2017 and Community
You might receive the following error, which means your enviroment variable is not set.
error MSB4019: The imported project «C:\Microsoft.Cpp.Default.props» was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
The enviroment variable can be set directly in the system settings or with CMD as Administrator. (Source for reference)
for Visual Studio 2015 and below:
Replace vXXX with your corresponding version e.g. 140
for Visual Studio 2017 and above:
Replace YEAR and EDITION with your corresponding values e.g. 2017 and Community
Edit:
I’ve also noticed that some solutions in Visual Studio 2017 wont show their contents in the Solution Explorer if the enviroment variable is set. Just remove them again if necessary.
Using make from Windows PowerShell
Under Linux, sources of projects commonly come with Makefile ‘s. Makefiles contain directives to build these projects using the command make . I am currently forced to use Windows, and so as to be able to use this OS I configured and enhanced the «PowerShell» (by installing some additional programs, such as vim or svn , a module called PSReadLine , writing a PowerShell profile, etc.).
However I could not find whether it is possible to install make in PowerShell. I am aware that I will also have to install programs that make will call, such as, say, g++ or pdflatex , but that’ll be for later. For now I would like to get make itself working in the first place.
A bit of research revealed two possibilities:
The accepted answer to this very similar question: How to use makefiles on Windows, suggests to use Cygwin. That’s a possibility, Cygwin is great, but since I decided to give PowerShell a chance I would like to know whether this is also possible with PowerShell, not Cygwin. Hence this question is not a duplicate, since that other question was about some possibility to use make in Windows, whereas I am asking for PowerShell in particular.
There exists a make clone for PowerShell clone called poshmake, but the syntax of the Poshmake files is different from usual Makefiles, which is a no-go. I want a true make , as maintaining two versions of Makefiles for all the projects I have lying around is not an option.
So: is it possible to install GNU make, which will understand the syntax of typical Makefiles, such that I can call make from within PowerShell?
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, 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!
10 Answers 10
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) :
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you’ll have a Linux distribution of your choice embedded in Windows 10 where you’ll be able to install make , gcc and all the tools you need to build C programs.
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.