Difference between revisions of "Build"

From Linuxintro
imported>ThorstenStaerk
m
imported>ThorstenStaerk
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Building typically involves the steps
+
If you obtain software as source code, you may have to [[build]] it before you can run it. This article lists the typical steps that are needed, what can go wrong and how you can solve possible problems.
 +
 
 +
= Steps of the build process =
 +
Building software typically involves the steps
 
  [[automake]]
 
  [[automake]]
  [[configure]]
+
  configure
 
  [[make]]
 
  [[make]]
 
  make install
 
  make install
Line 7: Line 10:
 
There are different files involved into the build process, the following gives an overview about that:
 
There are different files involved into the build process, the following gives an overview about that:
  
  (you)-> [[Makefile.am]] -([[automake]])-> Makefile.in -
+
  (you)-> Makefile.am -(automake)-> Makefile.in -
 
                                                 \
 
                                                 \
                                                   -([[configure]])-> [[Makefile]] -
+
                                                   -(configure)-> [[Makefile]] -
 
                                                 /                          \
 
                                                 /                          \
 
                           (you)-> configure.in -                            -(make)-> binary
 
                           (you)-> configure.in -                            -(make)-> binary
 
                                                                             /
 
                                                                             /
                                                        (you)-> sourcecode -
+
                                                      (you)-> sourcecode -
  
 
You as a developer write the sourcecode, the configure.in file and the Makefile.am. Makefile.am is transformed by automake to Makefile.in. Makefile.in and configure.in are transformed by configure to Makefile, while the Makefile and the sourcecode together build the binary.
 
You as a developer write the sourcecode, the configure.in file and the Makefile.am. Makefile.am is transformed by automake to Makefile.in. Makefile.in and configure.in are transformed by configure to Makefile, while the Makefile and the sourcecode together build the binary.
 
So, if you are asked how to write a Makefile, the best answer is "not at all, better have configure write the Makefile.
 
So, if you are asked how to write a Makefile, the best answer is "not at all, better have configure write the Makefile.
  
== See also ==
+
== make ==
* [[make]]
+
make is part of the [[build]] process, it does the [[compiling]] and linking. It requires a [[MakeFile]].
 +
 
 +
= Compiling =
 +
Compiling is part of the build process and part of the [[make]] step. It is done by calling the compiler, e.g. gcc. Compiling means the translation of human-readable commands into machine language, for more information, see [[wikipedia:compiling]].
 +
 
 +
[[Category:Concept]]

Latest revision as of 19:13, 11 January 2016

If you obtain software as source code, you may have to build it before you can run it. This article lists the typical steps that are needed, what can go wrong and how you can solve possible problems.

Steps of the build process

Building software typically involves the steps

automake
configure
make
make install

there are reasons not to count the "make install" step to the build, but it shall be mentioned here for clarity. Mostly, the automake step is done before bundling and publishing the software so the normal user does not need to do it. There are different files involved into the build process, the following gives an overview about that:

(you)-> Makefile.am -(automake)-> Makefile.in -
                                                \
                                                 -(configure)-> Makefile -
                                                /                          \
                         (you)-> configure.in -                             -(make)-> binary
                                                                           /
                                                      (you)-> sourcecode -

You as a developer write the sourcecode, the configure.in file and the Makefile.am. Makefile.am is transformed by automake to Makefile.in. Makefile.in and configure.in are transformed by configure to Makefile, while the Makefile and the sourcecode together build the binary. So, if you are asked how to write a Makefile, the best answer is "not at all, better have configure write the Makefile.

make

make is part of the build process, it does the compiling and linking. It requires a MakeFile.

Compiling

Compiling is part of the build process and part of the make step. It is done by calling the compiler, e.g. gcc. Compiling means the translation of human-readable commands into machine language, for more information, see wikipedia:compiling.