how to run makefile...

Hello again everyone!

I'm having a hard time executing a makefile that was created by my professor. In a directory, I have main.c, pair.c, pair.h, prep_defs.h, and makefile.txt. At school(we use Macs), I was able to simply type "make" at the terminal command prompt and it would work. At home, I am running a Windows 7 machine and using gcc in the windows command prompt. I went into the directory with all the mentioned files and typed in "make," but it says "'make' is not recognized as an internal or external command, operable program or batch file." Is there another way to execture this makefile that I am unaware of? Any help would be appreciated. Thanks!
"make" is a program. You'll need to get it and install it on your Windows 7 machine:

http://www.gnu.org/software/make/

Once you do that it should work.

EDIT: of course you'll also need a compiler and things installed, too. You're probably using GCC, so google GCC (or MinGW) and install that.
Last edited on
Thank you! I will download it and see if it works.. Thanks again! =)
plokij: You'd probably want to get MinGW for your windows machine. It comes with a few compilers (including C and C++ compilers), and the GNU make tool.
Ah okay. I didn't realize MinGW came with make.

That's a better solution for sure.
closed account (iw0XoG1T)
If I remember right download the windows installer for MinGW it gives you the option to also install msys which comes with all the necessary binutils (make included). Then all you have to do is set path and your makefile will work just fine.
The suggestions above will work but MinGW with the Msys is a little more idiot proof.
This means the compiler cant be seen, after installing mingw try this on cmd "set path=XXX;%path%" XXX is the directory ofyour binaries compiler
Everyone, thank you for the advice!

Alright, I've downloaded the MinGW installer and installed it, including the msys...it downloaded and installed a whole bunch of stuff. Afterwards, I went into the environment variables, found in the system control panel, and added "C:\MinGW\bin;" to the PATH environment variable. I then opened up a new command prompt window and typed in "make" but I still get the same message as before. Am I not installing this correctly? I need to get this to work so I can start working on my homework which is due in a few days...once again, any help would be appreciated.
Ok, I think I understand what I am doing wrong. I can just open up MinGW and do it from there...sorry guys! =)

Actually, there is one problem...how do I get to the directory with all my files in it when using MinGW? "cd" doesn't seem to work the same as in the command prompt..
sorry, I figured it out...I will attempt to try harder before I ask questions prematurely next time!
hi plokij,

my problem is the same as yours:

i have already installed "MinGW with msys" and added "C:\MinGW\bin" to the PATH environment variable. but when i type make, the command line says "make is not an internal or external command, operable program or batch file. could you please elaborate how to got around this problem?tnx
IIRC - Mingw does not come with make, it comes with mingw32-make.
Look in your C:\MinGW\bin directory and check.
Last edited on
thanks a lot.. :)
Last edited on
Topic archived. No new replies allowed.