Sign in Join
Wiki copytemporary

lazbuild: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11lazbuild is a command line utility to compile Lazarus projects and packages, as well as the Lazarus IDE itself. When you built Lazarus yourself you can find the lazbuild executable in the Lazarus source directory together with the lazarus executable.
22
33## Synopsis
44
5-`lazbuild [options] filename filename ...`
5+```text
6+lazbuild [options] filename filename ...
7+```
68
79## Description
810
911lazbuild builds Lazarus projects (.lpi) and/or packages (.lpk). It automatically compiles required packages. It can also compile the IDE and install any compiled packages.
1012
1113## Usage
1214
1315lazbuild is a command-line tool. It recursively checks all dependencies and compiles needed packages first. It uses the Free Pascal compiler (fpc) to compile.
1416
1517## Options
1618
1719-h or --help
1820write the list of options.
1921
2022-B or --build-all
2123build all files of project/package. Normally the compiler only compiles the main source and all sources with a newer date.
2224
2325-r or --recursive
2426apply build flags (-B) to dependencies, too.
2527
2628-d or --skip-dependencies
2729do not compile dependencies
2830
2931--build-ide=\<options\>
3032Compile the IDE (i.e. the Lazarus executable). The list of installation packages is read from the config directory. The \<options\> are appended to the other IDE custom options. They can be empty. (With 0.9.30 and below the IDE profile custom options were replaced). Since at least Lazarus 1.0.6 (revision 38971): you can pass -dKeepInstalledPackages to build the IDE with the list of packages you had previously selected - analogous to make useride; handy when using --add-package. Build-ide uses the selected profile in the IDE. You can use another profile with --build-mode (see below).
3133
3234- Example for building with your default profile: --build-ide=
3335- Example for building with a specific profile: --build-ide="Normal IDE"
3436
3537-v or --version
3638show version and exit
3739
3840-q or --quiet
3941be less verbose; can be given multiple times. Since 1.5: Passing quiet two times, will pass -vw-n-h-i-l-d-u-t-p-c-x- to the compiler.
4042
4143--verbose
4244be more verbose; can be given multiple times
4345
4446--verbose-pkgsearch
4547Write what package files are searched and found. Since 1.5.
4648
4749--add-package
4850add package(s) to list of installed packages in the IDE (combine with --build-ide to rebuild IDE). Since 1.1.
4951
5052Example: --build-ide= --add-package projecttemplates lazopenglcontext /path/to/your/pkg/name.lpk
5153
5254--add-package-link=\<.lpk file\>
5355Register the Lazarus package files (.lpk) and exit. Do not build. Since 1.7.
5456
5557--create-makefile
5658Instead of compile package, create a simple Makefile. No support for build modes. Does not compile required packages.
5759
5860--primary-config-path=\<path\> or --pcp=\<path\>
5961primary config directory, where Lazarus stores its config files. Default is \$HOME/.lazarus
6062
6163--secondary-config-path=\<path\> or --scp=\<path\>
6264secondary config directory, where Lazarus searches for config template files. Default is /etc/lazarus
6365
6466--operating-system=\<operating-system\> or --os=\<operating-system\>
6567override the project operating system. e.g. win32 or linux.
6668
6769--widgetset=\<widgetset\> or --ws=\<widgetset\>
6870override the project widgetset. e.g. gtk, gtk2, qt, win32, or carbon.
6971
7072--cpu=\<cpu\>
7173override the project cpu. e.g. i386, x86_64, powerpc, powerpc_64 etc.
7274
7375--subtarget=\<subtarget\>
7476override the project subtarget (since Lazarus 3.99)
7577
7678--build-mode=\<project/ide build mode\> or --bm=\<project/ide build mode\>
7779override the project build mode. With --build-ide= it selects the IDE build profile. (With 0.9.30 and below you can not select the IDE build profile)
7880
7981--compiler=\<ppcXXX\>
8082override the default compiler. e.g. ppc386, ppcx64, ppcppc etc.
8183
8284--language=\<language\>
8385override language. For example --language=de. For possible values see files in the lazarus/languages directory.
8486
8587--lazarusdir=\<Lazarus directory\>
8688directory, to be used as a basedirectory
8789
8890--max-process-count=\<count\>
8991Maximum number of threads for compiling in parallel. Default is 0, which guesses the number of cores in the system. Since 1.5.
9092
9193--no-write-project
9294Do not write updated project info file (.lpi) after build. If not specified, build number will be incremented if configured. Since 1.7.
9395
9496## .lpi and .lpk files
9597
9698If you want to create .lpi and .lpk files, it is recommended to use the Lazarus IDE. The files are simple XML and all settings can be edited via the IDE. There is no reason to edit them manually, except for very rare cases like renaming hundreds of files.
9799
98100---
99101*From the Free Pascal wiki, page "lazbuild", as it stood on 2023-07-26 after a change by Mattias2, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
100102Category: Lazarus
101103Category: Packages

Back to history