Development/Build System

From The Document Foundation Wiki
Jump to: navigation, search

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

Generated with the new and shiny module-deps script (master has the latest):

Graph image creation requires permission to upload.

Build diagnostic

There are some useful command-line options for debugging: --just-print (-n) --print-data-base (-p) and --debug.

--just-print

This option is supposed to suppress all command execution.

--print-data-base

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

--debug

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 dependecnies
  7. call (c) expands all calls and shows their results
  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.

make --debug=c,v

FAQ

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

A. See Classes are composed from structural and behavioral constituents. Wikipedia logo v3.svg


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

A. Something like that should work:

cd tail_build && make <absolute-path-to-workdir>/Module/<module-name>

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

A. Instead of

make /home/david/libo/workdir/unxlngx6/CppunitTest/sw_macros_test.test

you can just say:

make CppunitTest_sw_macros_test

iow for all these classes

AllLangResTarget
AllLangZip
CliLibrary
CliNativeLibrary
CliUnoApi
Configuration
CppunitTest
CustomTarget
Dictionary
Executable 
Extension 
ExternalPackage 
ExternalProject 
Helper 
InstallModule 
InstallScript 
InternalUnoApi 
Jar 
JunitTest 
Library 
Package 
Pagein
PythonTest
Pyuno 
Rdb 
StaticLibrary 
UI 
UnoApi 
UnoApiMerge
UnpackedTarball
WinResTarget
Zip

you can just say:

make <class>_<target>

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

A. An (incomplete) list of codes are:

  • [CXX] - build C++ file
  • [C ] - build C file
  • [LNK] - linker
  • [OCX] - build Objective-C++ file
  • [CUT] - C/C++ unit test
  • [GPF] - gperf

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

Links