Difference between revisions of "Build Tools"
(→Autotools: explain autogen.sh) |
(→Autotools: Rewrite for clarity.) |
||
Line 24: | Line 24: | ||
=== Autotools === | === Autotools === | ||
− | To build the '''Gnucash-docs''', we use | + | To build the '''Gnucash-docs''', we use the [https://en.wikipedia.org/wiki/GNU_Build_System GNU Build System], often referred to as "autotools". It's a complex and capable system for configuring and building a wide range of projects on a wide range of platforms. [https://autotools.io/index.html The Autotools Mythbuster] provides an excellent tutorial and reference for those wishing to learn about creating and building projects using the system. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | For those who simply need to build the documentation from source, the following three commands will suffice: | ||
+ | #<code>autogen.sh</code>: Checks that all required parts of the build system are installed, then builds the <code>configure</code> program from its source, <code>configure.ac</code> and the intermediate Makefiles <code>Makefile.in</code> from their source <code>Makefile.am</code>. You'll run <code>autogen.sh</code> after you first clone <code>gnucash-docs.git</code>, any time you edit a <code>Makefile.am</code> or <code>configure.ac</code>, and any time you pull commits with changes to those files. Since it does no harm to run it unnecessarily we recommend that you run it after any <code>git pull</code>. | ||
+ | #<code>configure</code>: This shell script, generated by <code>autogen.sh</code> as described above, examines your system and its arguments to convert the intermediate <code>Makefile.in<code> to <code>Makefile</code> that the <code>make</code> command will use to actually generate the documentation product files. One can get a listing of the arguments and environment variables that any particular <code>configure</code> understands by running <code>configure --help</code>. | ||
+ | #<code>make</code>: Using <code>Makefile</code> as a template, <code>make</code> runs the various programs and scripts needed to perform the build. Its arguments are the targets to be built; there are two special targets, <code>check</code> runs tests to ensure that the project has been built correctly and <code>install</code> moves the build products to the locations from which they may be used. | ||
[[Category:Development]] | [[Category:Development]] |
Revision as of 18:45, 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]
toninja [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 the GNU Build System, often referred to as "autotools". It's a complex and capable system for configuring and building a wide range of projects on a wide range of platforms. The Autotools Mythbuster provides an excellent tutorial and reference for those wishing to learn about creating and building projects using the system.
For those who simply need to build the documentation from source, the following three commands will suffice:
autogen.sh
: Checks that all required parts of the build system are installed, then builds theconfigure
program from its source,configure.ac
and the intermediate MakefilesMakefile.in
from their sourceMakefile.am
. You'll runautogen.sh
after you first clonegnucash-docs.git
, any time you edit aMakefile.am
orconfigure.ac
, and any time you pull commits with changes to those files. Since it does no harm to run it unnecessarily we recommend that you run it after anygit pull
.configure
: This shell script, generated byautogen.sh
as described above, examines your system and its arguments to convert the intermediateMakefile.in<code> to <code>Makefile
that themake
command will use to actually generate the documentation product files. One can get a listing of the arguments and environment variables that any particularconfigure
understands by runningconfigure --help
.make
: UsingMakefile
as a template,make
runs the various programs and scripts needed to perform the build. Its arguments are the targets to be built; there are two special targets,check
runs tests to ensure that the project has been built correctly andinstall
moves the build products to the locations from which they may be used.