How to run a makefile in Windows?

2019-01-12 17:26发布

I have some demos that I downloaded and they come with a Makefile.win and a Makefile.sgi. How can I run these in Windows to compile the demos?

8条回答
Luminary・发光体
2楼-- · 2019-01-12 17:40

Check out GnuWin's make, which provides a native port for Windows (without requiring a full runtime environment like Cygwin)

查看更多
对你真心纯属浪费
3楼-- · 2019-01-12 17:46

With Visual Studio 2017 I had to add this folder to my Windows 10 path env variable:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64

There's also HostX86

查看更多
手持菜刀,她持情操
4楼-- · 2019-01-12 17:52

Here is my quick and temporary way to run a Makefile

  • download make from SourceForge: gnuwin32
  • install it
  • go to the install folder

C:\Program Files (x86)\GnuWin32\bin

  • copy the all files in the bin to the folder that contains Makefile

libiconv2.dll libintl3.dll make.exe

  • open the cmd (you can do it with right click with shift) in the folder that contains Makefile and run

make.exe

done.

Plus, you can add arguments after the command, such as

make.exe skel

查看更多
仙女界的扛把子
5楼-- · 2019-01-12 17:55

If you have Visual Studio, run the Visual Studio Command prompt from the Start menu, change to the directory containing Makefile.win and type this:

nmake -f Makefile.win

You can also use the normal command prompt and run vsvars32.bat (c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools for VS2008). This will set up the environment to run nmake and find the compiler tools.

查看更多
来,给爷笑一个
6楼-- · 2019-01-12 17:57

Check out cygwin, a Unix alike environment for Windows

查看更多
Luminary・发光体
7楼-- · 2019-01-12 17:57

If it is a "NMake Makefile", that is to say the syntax is compatible with NMake, it will work.

Often standard Linux Makefiles are provided and NMake looks promising. However, the following link takes a simple Linux Makefile and explains some fundamental issues that one may encounter.

Makefiles in Windows

查看更多
登录 后发表回答