How to Build a Typical Linux Project

If the project has no explicit releases, you may need to pull the source code directly from its CVS or SVN repository., Look into the files README and INSTALL that should be at the top folder in the downloaded project., Some projects provide the...

15 Steps 2 min read Advanced

Step-by-Step Guide

  1. Step 1: If the project has no explicit releases

    The websites of most such projects will have the corresponding command line which you only need to copy-paste to your system, for instance cvs
    -z3
    -d:pserver:[email protected]:/sources/classpath co classpath.

    The similar command usually downloads a large number of project files in a current folder.
  2. Step 2: you may need to pull the source code directly from its CVS or SVN repository.

    They may contain valuable information that will save you a lot of time. , This is not very frequent, but happens for very old projects and also for new projects that try to provide a "user friendly" build procedure.

    If you find such file, try to use it first (the installation may be placed in a separate script that is usually named install.sh).

    If you find these scripts, just run them.

    Otherwise, proceed to the following steps. , It is usually a .sh script that will tune the project build system to your machine.

    If you find it, type ./configure or sh configure to run this script. ./configure usually has a lot of options that may help if the "default" run fails with error messages.

    Run the script with the key
    --help to see the options.

    If there is no configure script, it may be an old
    - style project which only uses make files, so you can proceed directly to the next step. , If you find it, type the command make.

    It should find the make file in the current directory and build the project for you., In this case, type ant in the project root folder.

    While make is more popular for C and C++ projects, ant is popular for java projects., This uses autoconfigure, automake and libtool to create these files. , The default locations like /usr/lib or /usr/bin are usually only root-writeable, so this step usually needs administrator rights. , This usually invokes the newly compiled and installed program which is now ready to use.
  3. Step 3: Look into the files README and INSTALL that should be at the top folder in the downloaded project.

  4. Step 4: Some projects provide the build script as a shell script (usually named build.sh).

  5. Step 5: Search for the file called configure which also must be present in a project top folder.

  6. Step 6: Search for the file called makefile which may be initially present or appear after you run configure.

  7. Step 7: If there is no configure nor makefile in the project tree

  8. Step 8: it may be an ant - powered project with the build.xml file instead.

  9. Step 9: If ant doesn't work either

  10. Step 10: or the project is C or C++

  11. Step 11: try running ./autogen.sh to create the configure and makefile files.

  12. Step 12: After you succeeded to compile the makefile - based project

  13. Step 13: try make install to place the project files into appropriate locations (to install the project).

  14. Step 14: After the installation succeeds

  15. Step 15: try to type the short project name.

Detailed Guide

The websites of most such projects will have the corresponding command line which you only need to copy-paste to your system, for instance cvs
-z3
-d:pserver:[email protected]:/sources/classpath co classpath.

The similar command usually downloads a large number of project files in a current folder.

They may contain valuable information that will save you a lot of time. , This is not very frequent, but happens for very old projects and also for new projects that try to provide a "user friendly" build procedure.

If you find such file, try to use it first (the installation may be placed in a separate script that is usually named install.sh).

If you find these scripts, just run them.

Otherwise, proceed to the following steps. , It is usually a .sh script that will tune the project build system to your machine.

If you find it, type ./configure or sh configure to run this script. ./configure usually has a lot of options that may help if the "default" run fails with error messages.

Run the script with the key
--help to see the options.

If there is no configure script, it may be an old
- style project which only uses make files, so you can proceed directly to the next step. , If you find it, type the command make.

It should find the make file in the current directory and build the project for you., In this case, type ant in the project root folder.

While make is more popular for C and C++ projects, ant is popular for java projects., This uses autoconfigure, automake and libtool to create these files. , The default locations like /usr/lib or /usr/bin are usually only root-writeable, so this step usually needs administrator rights. , This usually invokes the newly compiled and installed program which is now ready to use.

About the Author

J

Joseph Wallace

Enthusiastic about teaching practical skills techniques through clear, step-by-step guides.

35 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: