GNU Makefile - What needs to be done to go from Linux to make it run on Windows?

I have a GNU Makefile that already exists for a Linux C program.  What types of things need to be done to make the Makefile work on a Windows machine?
VWrestle97Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yjwongCommented:
If your program is portable to Cygwin, then it will work seamlessly. Try compiling your program using the standard Make utilities in the Cygwin suite.
0
VWrestle97Author Commented:
I don't think this is an option for me as posted in a recent question titled, "Using Windows Command Prompt, How to run a series of Cygwin statements immediately after Cygwin Starts"  where I stated, "I have Cygwin installed on my Windows XP.  I would like -  from windows command prompt -  to be able to open up Cygwin immediatley followed by a series of commands.  What is the best way to approach this?  Please provide example syntax."

An answer provided to this question was, "The only other way to pass on another command from the same batch file is to add a syntax to BASH.EXE; however I could not find anything for running another batch file. The only syntaxes are for logging in and setting the home directory. I don't think what you are asking is possible to do from one batch file."

Does this sound correct to you?  If that is true, then I can't use Cygwin because I am trying to get Matlab to run a series of Linux commands, so I believe the only solution that I have is to create a windows .bat version for the C program.  Do you agree with this?
0
yjwongCommented:
I'm not sure if that's what you wanted, but here's just a possible solution. You could actually directly run the Cygwin executables (i.e. make) without starting BASH by adding the Cygwin bin directory into your %PATH% environment variable. That way, you are able to run the make utilities directly through the Windows command prompt, or through the batch file.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

VWrestle97Author Commented:
Ah... this wasn't exactly my question, and I was able to do this but not the way you describe.  I don't have the example on me right now, but I will post it here when I get access to it so you can see how I did it.  I am not sure of the way you explain it, but can you explain in more detail about how to do it your way?

Getting back to my original question; I don't want to use Cygwin.  Basically I want to know the differences between the linux and windows makefile and what type of changes need to be made to make it compatible with windows.  Sorry for the confusion.

0
yjwongCommented:
What I did was just setting the PATH variable in the batch file to include the Cygwin's bin directory. For example, if your Cygwin bin directory is in C:\Cygwin\bin, then the batch file would look something like:

set PATH=%PATH%;C\Cygwin\bin
cd source_directory
make <some target>

If you are going to use the Windows makefile syntax, then I can't really help. I don't really know the differences between nmake and make. Sorry if I can't help.
0
VWrestle97Author Commented:
I'm sorry, the I used Matlab to setup my path - path('C:\blah\blah',path);  

so nmake is the windows version of linux's make?
0
VWrestle97Author Commented:
I ended up using Cygwin after-all because I found a command for windows batch file that can be used to send a series of commands to Cygwin with just requiring one instance of Cygwin open.  

The command I used in batch to access Cygwin is:

bash --login -c "command_1; command_2; ... command_N; exit; exec bash -rcfile exit"

I was misinformed from another thread that what I wanted to do cannot be accomplished with Cygwin, but when I figured it out I decided to use Cygwin instead of making my own version of windows makefile from a Linux makefile.
0
VWrestle97Author Commented:
I ended up using Cygwin after-all because I found a command for windows batch file that can be used to send a series of commands to Cygwin with just requiring one instance of Cygwin open.  

The command I used in batch to access Cygwin is:

bash --login -c "command_1; command_2; ... command_N; exit; exec bash -rcfile exit"

I was misinformed from another thread that what I wanted to do cannot be accomplished with Cygwin, but when I figured it out I decided to use Cygwin instead of making my own version of windows makefile from a Linux makefile.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.