LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2010, 12:36 AM   #1
lmsiew2
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
Question Problem understanding 'make'


Hi,

I have a program consists of header files, .cpp, .c, a Makefile and need to include the problem instances file (.tim).

May i know how to compile and run them? From google, i have heard bout the command make. But i have no idea how. Please kindly help..

Thanks..

Regards,
limeng
 
Old 08-13-2010, 01:27 AM   #2
rmknox
Member
 
Registered: May 2010
Posts: 354

Rep: Reputation: 34
way too complex to describe here

start with this from wikipedia

http://en.wikipedia.org/wiki/Make_%28software%29

then use a search engine and look for unix makefile

good luck

what make does is compile tyhose things that have changes since last time, and taks build those theings tht have changed from last
plus anytrh9ng else yu want it to do

it is like a very intelligent batch file in many op sys
 
Old 08-13-2010, 01:28 AM   #3
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
See what (GNU) Make is about at their site. Put short, it contains kind of written instructions for the utility for what to do, for which files and when, to produce the output (usually an executable file or files) required. The building process may vary depending on what the programmer has chosen to do, but usually the instructions are included in a README or an INSTALL file, which you can read using any text file viewer/editor. A typical process includes running a configuration script, then asking Make to compile the sources and finally ask it to "install", i.e. copy the compiled files to their correct places in the filesystem. Details of this may be altered by giving suitable arguments to either the configuration script or Make.

The usual three-step process starts with
Code:
./configure
make
then with root privileges
Code:
make install
Before you go and run those, check for the README, INSTALL or other similar files and read them.
 
Old 08-13-2010, 01:28 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
From a command prompt, just "cd" into your project directory, and type "make". It's really as simple as that

Here's the deal:

1. A "makefile" is a text file that consists of a bunch of "rules" for building a program (compile, link and any other activities that need to be done). It's kind of like a shell script - except it's "declarative" (gives the rules for what needs to be done) instead of "procedural" (it doesn't spell things out step-by-step, like a programming language might).

2. When you type "make", it runs the "make" program.

The "make" program looks for a file called "Makefile" in your current directory.

If it finds it, it reads it, parses the "rules" ... and builds your program.

3. So again - if all you want to do is compile some code that already has a makefile: just start a command prompt, go to your project directory, and type "make".

If you want to learn more about "makefile's", then look here:

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

'Hope that helps .. PSM
 
1 members found this post helpful.
Old 08-13-2010, 01:38 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,672
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
and these too:
0. http://www.eng.hawaii.edu/Tutor/Make/
1. http://www.cprogramming.com/tutorial/makefiles.html
2. http://www.xmission.com/~georgeps/do...makefiles.html
3. http://www.cs.cmu.edu/~gkesden/412-1...makeintro.html
4. http://www-laog.obs.ujf-grenoble.fr/...oc/node38.html
5. http://www.freebsd.org/doc/en/books/...makefiles.html

That was a nice link, Paul

Last edited by TheIndependentAquarius; 08-13-2010 at 02:56 AM.
 
Old 08-15-2010, 12:28 PM   #6
lmsiew2
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Question

Thanks everyone for replying..

I've got a basic picture of make now. Somehow, would like to know if i can run program developed under Linux and run it on Windows? Because im having an error on this getrusage() function when im trying to run on Windows. Any idea? Thanks..
 
Old 08-15-2010, 12:30 PM   #7
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,672
Blog Entries: 29

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Quote:
Originally Posted by lmsiew2 View Post
Thanks everyone for replying..
Because im having an error on this getrusage() function when im trying to run on Windows. Any idea? Thanks..
You re welcome
Post here the exact error message.

Last edited by TheIndependentAquarius; 08-15-2010 at 12:33 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Process Understanding priyadarshan Linux - Newbie 3 08-05-2010 03:41 AM
New Problem- Understanding Network Cards lowbrow *BSD 6 04-12-2008 11:18 AM
Problem understanding line in script snowman81 Programming 3 02-09-2008 10:58 PM
Understanding make file-help for newbie sceadu Programming 5 11-02-2004 05:25 AM
make dep,make clean,make bzImage problem Babba Linux - Newbie 2 01-08-2003 04:49 AM


All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration