LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 10: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, 10:13 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
The tar.gz should have come with a README or INSTALL file that you should read for directions.
 
Old 10-25-2010, 10: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, 10:35 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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, 11:00 AM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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, 11:12 AM   #6
ThatDudeMan
LQ Newbie
 
Registered: Oct 2010
Posts: 3

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:17 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
Open Source Consulting | Domain Registration