Development/Build System

This page is about the build system workflow and using it. To learn about the build system in itself, see the gbuild page.

High level build overview

 * 1) make (in top level) possibly reruns ./autogen.sh (if any of configure dependencies changed) and calls make -f Makefile.top
 * 2) Makefile.top includes generated config_host.mk from configure step above
 * 3) TODO: describe gnu make process
 * 4) ooinstall creates installation set

Tools involved in build

 * concat-deps.c
 * TODO

Module dependencies
To generate this dependency graph, download the sources of LibreOffice. After autogen.sh has been run, from the root of the LibreOffice sources, you can run make dump-deps-png which will produce the following graphviz based syntax to stdout. This has the same effect as calling the Perl script SRCDIR=./ ./bin/module-deps.pl manually.

To generate a beautiful image, use an online tool like webgraphviz and copy the syntax starting with 'digraph' you obtained from stdout (remove the first lines that are not part of the syntax), paste them in the textarea of the tool and click 'Generate graph!'. Some other viewers are listed here.

Note: We removed some comments generated by the LibreOffice tool in order to display properly into this Wiki.

Build diagnostic
There are some useful command-line options for debugging:


 * --just-print (-n)
 * --print-data-base (-p)
 * --debug

This option is supposed to suppress all command execution.

This executes the makefile, displaying commands as they are run by make, then it will dump its internal database.

This provides the most detailed information available without running the debugger. There are five native debugging options and two more added in patched make 3.82 version from dev-tools repository:


 * 1) basic is the least detailed information. When enabled, make prints each target that is found to be out-of-date and the status of update action;
 * 2) verbose set the basic option and includes additional information about which files were parsed, prerequisites that did not need to be rebuilt;
 * 3) implicit sets the basic and includes additional information about implicit rule searches for each target;
 * 4) jobs prints the details of subprocesses invoked by make;
 * 5) all all options and is default, when -d is used;
 * 6) makefile (m) includes updating any included files, such as lists of dependencies;
 * 7) call (c) expands all calls and shows their results; and
 * 8) eval (v) will tell you about all targets that are being updated and what recipes are run.

If the debugging option specified as --debug, basic debugging is used. If the debugging option is given as -d, all is used. To select other combinations of options, comma separated list --debug=options1,options2 is used, where the option can be one of the previous options (actually, make looks only at the first letter), i.e.

FAQ
Q. Why the term "class" is used in gbuild context?

A. See

Q. How can I build one module from tail_build and honor the dependency?

A. Something like the following should work:

Q. How to shorten the make call for specific targets?

A. Instead of:

you can just say:

iow for all these classes

you can just say:

or even

which builds the given class for all targets.

Q. What are the three letter codes that appear when I run make?

A. An (incomplete) list of codes are:


 * - build C++ file
 * - build C file
 * - linker
 * - build Objective-C++ file
 * - C/C++ unit test
 * - gperf

This should hint at the rest of the abbreviations: https://opengrok.libreoffice.org/search?q=gb_Output_announce

Links

 * Patching External Libraries
 * Status gbuild migration – DONE