X
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 17 people, some anonymous, worked to edit and improve it over time.
The wikiHow Tech Team also followed the article's instructions and verified that they work.
This article has been viewed 126,925 times.
Learn more...
Source code is a computer program in human readable form. However, the machine cannot execute source code. The code must be compiled into machine code before it is useful. On Linux, the "make" build system is the most common one, and this how-to works for almost all Linux source code packages.
Steps
-
1Download the source code for the program or driver from the Internet or other media. It will most likely be in the form of a "tarball" and have a file extension of .tar, .tar.bz2, or .tar.gz. Sometimes a .zip file will be used instead however.
-
2Unpack the downloaded code- for .zip files use "unzip your file", for .tgz or .tar.gz use "tar -zxvf yourfile"; for .bz2 use "tar -jxvf yourfile"; or extract your files graphically.Advertisement
-
3In the terminal, move into the newly extracted directory. You do this by typing cd followed by a space and then the name of the directory. (Remember that directory names in Linux are case sensitive).
-
4Run the command "./configure" to configure the source code automatically. Arguments such as " --prefix=" can be used to control the install location. This checks that you have the right libraries and versions.
-
5Once configured, run "make" which does the actual compiling (this can take anything from a few seconds to many hours). An executable for the program will be created in the bin directory inside the source code directory.
-
6To install the program- run "make install".
-
7You have compiled and installed the program source code.
Advertisement
Warnings
- Compiling can take hours.⧼thumbs_response⧽
- Compiling and replacing critical system components can cause problems if you recompile and reinstall them. Know what you are doing.⧼thumbs_response⧽
- Some source packages don't have configure files or even make files. In this case, just type `make' at the prompt and see what happens.⧼thumbs_response⧽
Advertisement
About This Article
Advertisement