Windows make system file

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.

Как запустить 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 очищает от прежней сборки файлов.
Вот можно видео глянуть как это происходит.
Продолжение здесь.

How to run a makefile in Windows?

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?

17 Answers 17

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:

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.

You can install GNU make with chocolatey, a well-maintained package manager, which will add make to the global path and runs on all CLIs (powershell, git bash, cmd, etc…) saving you a ton of time in both maintenance and initial setup to get make running.

Читайте также:  Dell wireless 1397 wlan mini card драйвер windows 10 64 bit

Install the chocolatey package manager for Windows
compatible to Windows 7+ / Windows Server 2003+

Run choco install make

I am not affiliated with choco, but I highly recommend it, so far it has never let me down and I do have a talent for breaking software unintentionally.

Check out cygwin, a Unix alike environment for Windows

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

If you have winget, you can install via the CLI like this:

Also, be sure to add the install path to your system PATH :

Here is my quick and temporary way to run a Makefile

  • download make from SourceForge: gnuwin32
  • install it
  • go to the install folder
  • copy the all files in the bin to the folder that contains Makefile
  • open the cmd(you can do it with right click with shift) in the folder that contains Makefile and run

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

If you install Cygwin. Make sure to select make in the installer. You can then run the following command provided you have a Makefile.

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

There’s also HostX86

If it is a «NMake Makefile», that is to say the syntax and command is compatible with NMake, it will work natively on Windows. Usually Makefile.win (the .win suffix) indicates it’s a makefile compatible with Windows NMake. So you could try nmake -f Makefile.win .

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. It also suggests a few alternatives to handling Linux Makefiles on Windows.

I use MinGW tool set which provides mingw32-make build tool, if you have it in your PATH system variables, in Windows Command Prompt just go into the directory containing the files and type this command:

Firstly, add path of visual studio common tools ( c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools ) into the system path. To learn how to add a path into system path, please check this website: http://www.computerhope.com/issues/ch000549.htm. You just need to this once.

After that, whenever you need, open a command line and execute vsvars32.bat to add all required visual studio tools’ paths into the system path.

Then, you can call nmake -f makefile.mak

PS: Path of visual studio common tools might be different in your system. Please change it accordingly.

I tried with cygwin & gnuwin, and didn’t worked for me, I guess because the makefile used mainly specific linux code.

What it worked was use Ubuntu Bash for Windows 10. This is a Marvel if you come from MAC as it is my case:

  1. To install the Ubuntu Bash: https://itsfoss.com/install-bash-on-windows/
  2. Once in the console, to install make simply type «make» and it gives the instructions to download it.

Extras:

  1. Useful enable copy / paste on bash: Copy Paste in Bash on Ubuntu on Windows
  2. In my case the make called Maven, so I have to install it as well: https://askubuntu.com/questions/722993/unable-to-locate-package-maven
  3. To access windows filesystem C: drive, for example: «cd /mnt/c/»

I tried all of the above. What helps me:

  1. Download the mingw-get.
  2. Setup it.
  3. Add something like this C:\MinGW\bin to environment variables.
  4. Launch (!important) git bash. Power shell, developer vs cmd, system cmd etc didn’t help.
  5. Type mingw-get into the command line.
  6. After type mingw-get install mingw32-make .

Done! Now You might be able to use make-commands from any folder that contains Makefile.

  1. Download from https://sourceforge.net/projects/gnuwin32/
  2. Set the variable path in advance setting for recognize in command prompt (C:\Program Files (x86)\GnuWin32\bin)

Install msys2 with make dependency add both to PATH variable. (The second option is GNU ToolChain for Windows. MinGW version has already mingw32-make included.)

Install Git Bash. Run mingw32-make from Git Bash.

I am assuming you added mingw32/bin is added to environment variables else please add it and I am assuming it as gcc compiler and you have mingw installer.

First step: download mingw32-make.exe from mingw installer, or please check mingw/bin folder first whether mingw32-make.exe exists or not, else than install it, rename it to make.exe .

After renaming it to make.exe , just go and run this command in the directory where makefile is located. Instead of renaming it you can directly run it as mingw32-make .

After all, a command is just exe file or a software, we use its name to execute the software, we call it as command.

How to create an empty file at the command line in Windows?

How to create an empty file at the DOS/Windows command-line?

Читайте также:  Delete windows from volume

but it always displays that a file was copied.

Is there any other method in the standard cmd?

It should be a method that does not require the touch command from Cygwin or any other nonstandard commands. The command needs to run from a script so keystrokes cannot be used.

33 Answers 33

In the same spirit, Samuel suggests in the comments:

the shortest one I use is basically the one by Nomad:

It does give an error:

But this error is on stderr. And > only redirects stdout, where nothing have been produced.
Hence the creation of an empty file.
The error message can be disregarded here. Or, as in Rain’s answer, redirected to NUL :

(Original answer, November 2009)

( echo «» would actually put «» in the file! And echo without the ‘.’ would put » Command ECHO activated » in the file. )

Note: the resulting file is not empty but includes a return line sequence: 2 bytes.

This discussion points to a true batch solution for a real empty file:

The » » pipes a nul response to the set/p command, which will cause the variable used to remain unchanged. As usual with set/p , the string to the right of the equal sign is displayed as a prompt with no CRLF.

Since here the «string to the right of the equal sign» is empty. the result is an empty file.

The difference with cd. > filename (which is mentioned in Patrick Cuff’s answer and does also produce a 0-byte-length file) is that this «bit of redirection» (the trick) can be used to echo lines without any CR:

The dir command should indicate the file size as 11 bytes: » helloworld! «.

www.makeuseof.com

Follow MUO

How to Create an ISO Image of Your Windows System

Need to backup and restore Windows without backup tools? It’s time to learn how to make an ISO image of your Windows PC.

Need a quick and easy way to backup and restore Windows without relying on backup tools or the cloud for your personal data?

Several third-party Windows backup and restore tools are available, but they can be complicated and time-consuming to use. So, why not learn how to make an ISO image of your Windows PC instead?

Why Choose a Windows 10 Image Backup?

We all know that backing up our data is important, especially when upgrading to a new version of Windows. But rather than fiddle around with partitions for specific data, or syncing to the cloud, why not simply back up your entire Windows installation?

You can add personal folders to an image backup, but omit apps and games. Alternatively, you could opt to create an image of your entire system drive. Naturally, you would need a suitable volume of storage for such a backup.

Thanks to the ISO image format, it is possible to back up your entire PC. This essentially creates an exact copy of your entire drive or selected directories. You’ll be able to restore the image backup should disaster strike.

ISO files can also be used to back up existing CDs and DVDs.

Creating a Windows 10 ISO System Image With DataNumen

One popular use for disk images is creating a clone of your hard storage (hard disk drive or solid-state drive), which might be on its last legs.

DataNumen Disk Image (a.k.a. «DDKI») is one such solution, runs on all versions of Windows and is available as freeware.

After downloading and installing the utility, use the Clone tab to select the drive you wish to make an image of; to clone multiple drives, use the Batch Clone tab.

Select the destination location and assign a filename in the Output image file as box, where you should select the target disk drive. This is device you’re using to save the backup to. It might be an existing external drive, or a HDD you’ve recently purchased.

Click Start Cloning. This copies your disk to its destination device, ready to use. Our look at HDD cloning covers this topic in greater depth.

Creating an ISO Disk Image in Windows 7

Although cloud backups are easy, there’s no reason not to prepare an ISO disk image for disaster recovery scenarios. You might make an image of the system in its current state. You might alternatively create an image of a freshly installed operating system. Perhaps this will include some apps and games that you have installed.

Читайте также:  Доступа не вся оперативная память windows

If you’re using Windows 7, backing up to an ISO disk image is part of the Windows 7 backup and restore feature.

To create a system image in Windows 7, open Start > Getting Started > Back up your files. In the left-hand pane, click Create a system image, and select the destination.

This might be an external hard disk drive or some other large volume. You can also write to DVDs (you’ll need more than one) or Blu-ray.

Do you have a home server, or some large storage on your network, perhaps in the shape of a purchased NAS? If so, you can use the On a network location option. If you want to use a USB flash device, connect this to your computer in advance and select it as the destination.

Also ensure that the System drive (by default the C: drive) is selected.

The confirmation screen will detail how much space will be taken up by the backup. Check this to ensure the figure matches the remaining space on the target device. Proceed with the backup and wait while it completes. The duration will depend on the size of the backup and the speed of the drive.

Restoring the Windows 7 Disk Image

Once complete, Windows will suggest you create a system restore disc. This is a good idea, so find a blank disc and follow the instructions. You can then use this to boot your PC and select the System Image Recovery option to restore the ISO Disk Image of your Windows installation following a disaster scenario.

Creating an ISO Disk Image in Windows 8.1

The same tool for creating a disk image is available in later versions of Windows. You ideally need to have upgraded Windows 8 to Windows 8.1 before proceeding here.

To find the system image creation tool, press Start and type «file history«. The automatic search will display Restore your files with File History entry first, so click this to open the File History tool, then System Image Backup in the lower left corner.

You can then proceed as detailed in the Windows 7 section above. With the ISO backup created, use the steps for Windows 8.1, below, to restore the image in Windows 10. In a disaster recovery scenario, you will need to boot into the Windows 10 equivalent of Safe Mode to restore the image.

Restoring Your Windows 8.1 Disk Image

If a Windows 10 upgrade doesn’t work out for you (perhaps you’ll experience a reboot loop), having an ISO image to fall back on is a massive advantage. You can restore the Windows 8.1 disk image in Window’s Advanced options screen, which you will find by pressing F8 repeatedly when your PC boots up (or holding SHIFT as you click Restart).

In Advanced Startup Options, select Repair your Computer > System Image Recovery and follow the instructions, ensuring that Windows can find the ISO file.

Note that even if you have the Windows 8.1 installation media you can still restore the disk image. At the Install now screen, use the Repair your computer link and then Repair.

From here you’ll be redirected to the Advanced Startup menu, so select Troubleshoot > Advanced options > System Image Recovery, following instructions to restore your Windows ISO system image.

Back Up Your Windows PC With an ISO Image

As you can see, creating an ISO image backup of your entire Windows system is perfect for backing up in advance of a major system upgrade. Additionally, the speed with which the ISO can be created and subsequently restored should make it a far more attractive option than just backing up your data and hoping for the best.

Once your ISO is made, you may need to boot your computer with it following a system failure. Try one of these tools to make a bootable USB from your ISO file or follow this guide to install Windows from your bootable USB.

It’s not hard to make Windows 10 faster. Here are several methods to improve the speed and performance of Windows 10.

Deputy Editor for Security, Linux, DIY, Programming, and Tech Explained. He also produces The Really Useful Podcast and has extensive experience in desktop and software support. A contributor to Linux Format magazine, Christian is a Raspberry Pi tinkerer, Lego lover and retro gaming fan.

Subscribe To Our Newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

One More Step…!

Please confirm your email address in the email we just sent you.

Оцените статью