[try Beta version]
Not logged in

 
how to run makefile...

Jan 28, 2011 at 11:31pm
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!
Jan 28, 2011 at 11:35pm
"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 Jan 28, 2011 at 11:48pm
Jan 28, 2011 at 11:50pm
Thank you! I will download it and see if it works.. Thanks again! =)
Jan 29, 2011 at 12:18am
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.
Jan 29, 2011 at 12:29am
Ah okay. I didn't realize MinGW came with make.

That's a better solution for sure.
Jan 29, 2011 at 1:28am
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.
Jan 29, 2011 at 4:56am
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
Jan 29, 2011 at 7:06am
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.
Jan 29, 2011 at 7:09am
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..
Jan 29, 2011 at 7:12am
sorry, I figured it out...I will attempt to try harder before I ask questions prematurely next time!
Feb 15, 2011 at 5:51am
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
Feb 15, 2011 at 6:40am
IIRC - Mingw does not come with make, it comes with mingw32-make.
Look in your C:\MinGW\bin directory and check.
Last edited on Feb 15, 2011 at 6:41am
Feb 17, 2011 at 2:37pm
thanks a lot.. :)
Last edited on Feb 17, 2011 at 2:40pm
Topic archived. No new replies allowed.