LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-25-2010, 11:03 AM   #1
ThatDudeMan
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
How to use the make command


Hello,

a friend of mine gave me a .tar.gz file which contains a bunch of C sourcefiles and a makefile. I don't get how to use the make command to create an executable out of those files. What arguments do I have to give the make command?
 
Old 10-25-2010, 11:13 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
The tar.gz should have come with a README or INSTALL file that you should read for directions.
 
Old 10-25-2010, 11:20 AM   #3
ThatDudeMan
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
As I said, it only has a makefile and C sourcecode.
 
Old 10-25-2010, 11:35 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Is there a file named "Makefile"? If so, just run "make" and it should build. If it doesn't ask your friend for directions.
 
Old 10-25-2010, 12:00 PM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,164

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
First change your working directory to that into which you've unpacked the source code. Look to see if it contains a file called "configure". If it does, enter the command
./configure
If you don't need to do that, or after you've done it, enter
make
When that's finished, enter either of the following (the first for Ubuntu)
sudo make install
su -c "make install"
and it's done!

If you get a complaint that you are missing some dependency, you should be able to get that from your distro's repository. If the complaint comes from running make, run
make clean
to remove all the work done so far so that it can start from scratch when you've got the dependency.

When all is done, have a look in the make file (or perhaps a separate "install" file) to see if it mentions any documentation installed. Keep the file, because if you want to remove the program (if you ever want a new version) the make file may allow you to do it with
make uninstall
If it doesn't, it still lists all the files that were installed and where they went.
 
1 members found this post helpful.
Old 10-25-2010, 12:12 PM   #6
ThatDudeMan
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks, got it.
 
  


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
getting make: *** [all] Error 2 during make command for libmad-0.15.1b DJockey Linux - Software 3 07-29-2009 06:32 PM
My error in mkisofs command to make a command line iso mg92865 Linux - Newbie 1 06-20-2008 12:43 PM
Using the 'make' command m3tal Linux - Software 3 11-10-2006 04:26 AM
I accidentally deleted make file in /usr/local/bin, now cannot use make command.... Niceman2005 Linux - Software 2 11-17-2004 08:55 PM
make: cc: command not found make: *** [gzip.o]error 127 zyjk Linux - Newbie 5 02-08-2002 10:58 AM


All times are GMT -5. The time now is 04:54 PM.

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