Difference between revisions of "Build Tools"

From GnuCash
Jump to: navigation, search
(Ninja: Note: commands change)
(Editorial cleanup, and re-arranging sequence slightly)
Line 1: Line 1:
The GnuCash project uses several different tools to build the program, the docs, the OS specific packages.
+
__NOTOC__
 +
The GnuCash project uses several different tools to build the program, the docs, and OS specific packages.
  
 
== Basic Tools ==
 
== Basic Tools ==
This control the build process at a ''low level''.
+
These control the build process at a ''low level''.
  
 
=== Make ===
 
=== Make ===
[https://en.wikipedia.org/wiki/Make_(software) Make] is a build automation tool that automatically builds executable programs and libraries from source code by reading files called '''Makefiles''' which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.  
+
[https://en.wikipedia.org/wiki/Make_(software) Make] is a ''build automation tool'' that builds executable programs and libraries from source code by reading files called '''Makefiles''' which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.  
  
It is directly used in '''gnucash-htdocs''', indirectly by [[#Autotools]] and optionally by [[#CMake]].
+
It is directly used in '''gnucash-htdocs''', indirectly by [[#Autotools]] and optionally by [[#CMake|CMake]].
  
 
=== Ninja ===
 
=== Ninja ===
[https://en.wikipedia.org/wiki/Ninja_(build_system) Ninja] is a small build system with a focus on speed. It differs from other build systems in two major respects: it is designed to have its input files generated by a higher-level build system, and it is designed to run builds as fast as possible.
+
[https://en.wikipedia.org/wiki/Ninja_(build_system) Ninja] is a small build system with a focus on speed. It is designed to have its input files generated by a higher-level build system, and it is designed to run builds as fast as possible.
 
;Note: The commands change then from <code>make [target]</code> to <code>ninja [target]</code>.
 
;Note: The commands change then from <code>make [target]</code> to <code>ninja [target]</code>.
  
You can use it in [[#CMake]].
+
You can use it in [[#CMake|CMake]].
  
 
== Tool Chains ==
 
== Tool Chains ==
''More complex'' projects use this tools to control the basic tools.
+
In addition, GnuCash uses different ''tool chains'' to control the basic tools mentioned above. The program makes use of the '''CMake''' tool chain, while the documentation uses the '''Autotools''' tool chain. The website is compiled directly using [[#Make|Make]].
 +
 
 +
=== CMake ===
 +
To build the '''program''', we use [https://en.wikipedia.org/wiki/CMake CMake].It is a cross-platform free and open-source software application for managing the build process of software using a compiler-independent method. It supports directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as make, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.  
  
 
=== Autotools ===
 
=== Autotools ===
'''Gnucash-docs''' is using Autotools, which consists of several parts, from which 2 are important:
 
  
[https://en.wikipedia.org/wiki/Autoconf Autoconf] is a tool for producing '''configure''' scripts for building, installing and packaging software on computer systems where a [https://en.wikipedia.org/wiki/Bourne_shell Bourne shell] is available.
+
To build the '''Gnucash-docs''', we use Autotools, which consists of several parts, of which 2 are important:
  
[https://en.wikipedia.org/wiki/Automake Automake] automatically generates one or more '''Makefile.in''' from files called '''Makefile.am'''. Each Makefile.am contains, among other things, useful variable definitions for the compiled software, such as compiler and linker flags, dependencies and their versions, etc. The generated Makefile.ins are portable and compliant with the Makefile conventions in the GNU Coding Standards, and may be used by configure scripts to generate a working Makefile.
+
# [https://en.wikipedia.org/wiki/Autoconf Autoconf] is a tool for producing '''configure''' scripts for building, installing and packaging software on computer systems where a [https://en.wikipedia.org/wiki/Bourne_shell Bourne shell] is available.
 +
 
 +
# [https://en.wikipedia.org/wiki/Automake Automake] automatically generates one or more '''Makefile.in''' from files called '''Makefile.am'''. Each Makefile.am contains, among other things, useful variable definitions for the compiled software, such as compiler and linker flags, dependencies and their versions, etc. The generated Makefile.ins are portable and compliant with the Makefile conventions in the GNU Coding Standards, and may be used by configure scripts to generate a working Makefile.
  
 
So there remain 3 basic steps:
 
So there remain 3 basic steps:
Line 33: Line 38:
 
#: run <code>configure [options]</code>.
 
#: run <code>configure [options]</code>.
 
# Finally after your edits run  <code>make <target></code>. Some common targets are <tt>all</tt>, <tt>check</tt>, <tt>install</tt>.
 
# Finally after your edits run  <code>make <target></code>. Some common targets are <tt>all</tt>, <tt>check</tt>, <tt>install</tt>.
 
=== CMake ===
 
For the '''program''' we use [https://en.wikipedia.org/wiki/CMake CMake].It is a cross-platform free and open-source software application for managing the build process of software using a compiler-independent method. It supports directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as make, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.
 
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 15:09, 17 September 2018

The GnuCash project uses several different tools to build the program, the docs, and OS specific packages.

Basic Tools

These control the build process at a low level.

Make

Make is a build automation tool that builds executable programs and libraries from source code by reading files called Makefiles which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.

It is directly used in gnucash-htdocs, indirectly by #Autotools and optionally by CMake.

Ninja

Ninja is a small build system with a focus on speed. It is designed to have its input files generated by a higher-level build system, and it is designed to run builds as fast as possible.

Note
The commands change then from make [target] to ninja [target].

You can use it in CMake.

Tool Chains

In addition, GnuCash uses different tool chains to control the basic tools mentioned above. The program makes use of the CMake tool chain, while the documentation uses the Autotools tool chain. The website is compiled directly using Make.

CMake

To build the program, we use CMake.It is a cross-platform free and open-source software application for managing the build process of software using a compiler-independent method. It supports directory hierarchies and applications that depend on multiple libraries. It is used in conjunction with native build environments such as make, Apple's Xcode, and Microsoft Visual Studio. It has minimal dependencies, requiring only a C++ compiler on its own build system.

Autotools

To build the Gnucash-docs, we use Autotools, which consists of several parts, of which 2 are important:

  1. Autoconf is a tool for producing configure scripts for building, installing and packaging software on computer systems where a Bourne shell is available.
  1. Automake automatically generates one or more Makefile.in from files called Makefile.am. Each Makefile.am contains, among other things, useful variable definitions for the compiled software, such as compiler and linker flags, dependencies and their versions, etc. The generated Makefile.ins are portable and compliant with the Makefile conventions in the GNU Coding Standards, and may be used by configure scripts to generate a working Makefile.

So there remain 3 basic steps:

  1. After checking out of the repository run ./autogen.sh.
    • Decide, which build directory to use and run the following steps in your build dir.
  2. After you
    • installed updates of your tools or
    • modified makefile.am or configure.ac
    run configure [options].
  3. Finally after your edits run make <target>. Some common targets are all, check, install.