The GnuCash project uses several different tools to build the program, the docs, and OS specific packages.
These control the build process at a low level.
Make is a build automation tool that builds targets from source by interpreting recipe files called Makefiles which specify how to transform the source file(s) into the target file(s). Many "Integrated Development Environments" or "IDEs" use
make (or its Microsoft cousin
nmake) to perform the build. Makefiles can be written by hand (as is the case for gnucash-htdocs.git) or generated by Autotools or CMake. Make can be invoked recursively to build complex programs and use file timestamps to only recompile files and libraries wherea dependency has been changed. Makefiles ususally specify a number of targets of the build which may be supplied as arguments when make is called to perform specific actions to produce specific outputs.
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.
- The commands change then from
- Some Linux distributions name the command
ninja-buildto distinguish it from another program called
A comparison of CMake with the make utility is available here
CMake is commonly used to configure
ninja build files: To do so pass
-G Ninja among the
In addition, GnuCash uses different tool chains to control the basic tools mentioned above. The program makes use of the CMake as the base of its tool chain, while the user documentation uses the Autotools as the base of the tool chain. The website is compiled directly using Make. The API documentation is created from the source code using Make or Ninja, depending on how the source code build system is configured.
To set up or configure the program build system, 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. At present, CMake is primarily used to configure the build system by creating the input files for either the make or the ninja build programs which compile and link the program and its libraries. These utilities also control installation of the program and libraries
To set up or configure the Gnucash-docs build system, 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 the
configureprogram from its source,
configure.acand the intermediate Makefiles
Makefile.infrom their source
Makefile.am. You'll run
autogen.shafter you first clone
gnucash-docs.git, any time you edit a
configure.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 any
configure: This shell script, generated by
autogen.shas described above, examines your system and its arguments to convert the intermediate
Makefile.in<code> to <code>Makefilethat the
makecommand will use to actually generate the documentation product files. One can get a listing of the arguments and environment variables that any particular
configureunderstands by running
Makefileas a template,
makeruns the various programs and scripts needed to perform the build. Its arguments are the targets to be built; there are two special targets,
make checkruns tests to ensure that the project has been built correctly and
make installmoves the build products to the locations from which they may be used.