Sign in Join
Wiki copytemporary

Lazarus project files: what changed

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

OldNewLine
11### Project directory structure
22
33Typical directory structure for Lazarus project:
44
55- created - auto-created by IDE or created manually
66- VCS - need to be included in Version Control System
77
88| directory name | created | VCS | description |
99|----|----|----|----|
1010| backup | auto | no | Contains backup copies of project source files. |
1111| lib | auto | no | Contains compiled binary files for different CPU and OS. |
1212| \<Project name\>.app | auto | no | macOS (Darwin) "application bundle" files (macOS treats folders with extension .app specially). |
1313| frames | manual | yes | TFrame descendant files (*.lfm, *.pas), recommended for large projects with many frames. |
1414| include | manual | yes | Platform-dependent includes. Contains sub-directories for different OS (darwin, linux, win32, win64, etc..) Recommended for multiplatform projects with platform-specific units. |
1515| languages | manual | yes | Contains *.po files with resource strings for different languages. Recommended for multi-language projects. |
1616| images | manual | yes | Picture files (*.png, *.jpg, *.ico, *.xpm, etc..), that can be compiled into resource by [[lazres]] utility. Recommended for projects and packages with many image files. |
1717| logs | manual | no | Debug output files (*.txt, *.log). |
1818| | | | |
1919
2020### Project files extensions
2121
2222The [[Lazarus Tutorial|Lazarus Tutorial#The Lazarus files]] explains some extensions by an example.
2323
2424- VCS - need to be included in Version Control System
2525
26-<table>
2726<thead>
28-<tr>
29-<th>extension</th>
30-<th>VCS</th>
31-<th>filetype</th>
32-<th>description</th>
33-</tr>
27+
3428</thead>
3529<tbody>
36-<tr>
37-<td><code>.lpi</code></td>
38-<td>yes</td>
39-<td>Lazarus Project Information</td>
40-<td>contains project-specific settings like compiler settings and needed packages. stored in XML</td>
41-</tr>
42-<tr>
43-<td><code>.lps</code></td>
44-<td>no</td>
45-<td>Lazarus Program Session</td>
46-<td>Personal data like cursor positions, source editor files, personal build modes. stored in XML</td>
47-</tr>
48-<tr>
49-<td><code>.lpr</code></td>
50-<td>yes</td>
51-<td>Lazarus Program</td>
52-<td>Pascal source of main program.</td>
53-</tr>
54-<tr>
55-<td><code>.lfm</code></td>
56-<td>yes</td>
57-<td>Lazarus Form</td>
58-<td>Form configuration information for all objects on a form (stored in a Lazarus-specific textual format, similar to Delphi dfm; the actions are described by Pascal source code in a corresponding <code>*.pas</code> file)</td>
59-</tr>
60-<tr>
61-<td><code>.pas</code></td>
62-<td>yes</td>
63-<td>Pascal code</td>
64-<td>Pascal code typically for a form stored in a corresponding <code>*.lfm</code> file</td>
65-</tr>
66-<tr>
67-<td><code>.pp</code><br />
30+
6831<code>.p</code></td>
69-<td>yes</td>
70-<td>Pascal code</td>
71-<td>Useful if you want to avoid confusion with Delphi source code files.</td>
72-</tr>
73-<tr>
74-<td><code>.inc</code></td>
75-<td>yes</td>
76-<td>Pascal code include</td>
77-<td>Included as part of Pascal code file. Typically contain platform-dependent definitions and routines.</td>
78-</tr>
79-<tr>
80-<td><code>.lrs</code></td>
81-<td>no</td>
82-<td>Lazarus Resource</td>
83-<td>Generated Lazarus Resource file; not to be confused with a Windows resource file. This file can be created with lazres tool (in directory Lazarus/Tools) using commandline: lazres myfile.lrs myfile.lfm</td>
84-</tr>
85-<tr>
86-<td><code>.compiled</code></td>
87-<td>no</td>
88-<td>FPC compilation state</td>
89-<td>Compiler does not generate any .compiled files. They are created by some build system (make, fpmake, lazbuild).</td>
90-</tr>
91-<tr>
92-<td><code>.ppu</code></td>
93-<td>no</td>
94-<td>Compiled unit</td>
95-<td>Compiled source code created by the Free Pascal compiler for each unit and program.</td>
96-</tr>
97-<tr>
98-<td><code>.o</code><br />
32+
9933<code>.or</code></td>
100-<td>no</td>
101-<td>Object file</td>
102-<td>Created by the compiler, every ppu file has a corresponding o file, needed by the linker.</td>
103-</tr>
104-<tr>
105-<td><code>.lpk</code></td>
106-<td>yes</td>
107-<td>Lazarus package information</td>
108-<td>package-specific settings, like compiler settings and needed packages; stored in XML</td>
109-</tr>
110-<tr>
111-<td><code>.lrt</code></td>
112-<td>no</td>
113-<td>Lazarus Resourcestring table</td>
114-<td>Lazarus Resourcestring table created when saving a lfm file and i18n is enabled. It contains the TTranslateString properties of the lfm. Do not edit them, they are overwritten.</td>
115-</tr>
116-<tr>
117-<td><code>.rst</code></td>
118-<td>no</td>
119-<td>Resourcestring table</td>
120-<td>Resourcestring table created by the compiler for every unit with a resourcestring section. Do not edit them, they are overwritten.</td>
121-</tr>
122-<tr>
123-<td><code>.rc</code></td>
124-<td>yes</td>
125-<td>Resource definition file</td>
126-<td>Delphi-compatible resource-definition script (.rc file) that describes the resources used by your application.</td>
127-</tr>
128-<tr>
129-<td><code>.po</code></td>
130-<td>yes</td>
131-<td>GNU gettext messages</td>
132-<td>When [[i18n]] is enabled the IDE creates/updated the .po files with the resourcestrings from the rst and lrt files.</td>
133-</tr>
134-<tr>
135-<td><code>.ico</code></td>
136-<td>yes</td>
137-<td>Icon file</td>
138-<td>Icon for application file</td>
139-</tr>
140-<tr>
141-<td><code>.res</code></td>
142-<td>yes/no</td>
143-<td>Binary resource</td>
144-<td>There are essentially 3 types in Delphi: 1) auto generated .res files. 2) other .res files for which you have source (.rc) and are declared with the RC file in project or source like <code>{$R 'logo.res' 'logo.rc'}</code>. 3) other .res files for which you don't have source. So category one shouldn't be in SVN (so essentially same as other pre-generated files like .dcu/.o or .ppu). Category two essentially also not, since they can be regenerated. Finally category 3, that should be kept. In older Delphi these were often files to e.g. enable themes while the Delphi version didn't know that windows version. This is less of a problem with Lazarus. You can also convert category 2 to 3 to simply including the .res (removing the .rc source), so that you don't have to add e.g. an image to SVN etc).</td>
145-</tr>
34+
14635</tbody>
147-</table>
14836
14937## An example .gitignore file for Lazarus/Free Pascal
15038
15139[Lazarus.gitignore](https://github.com/github/gitignore/blob/master/Global/Lazarus.gitignore)
15240
15341---
15442*From the Free Pascal wiki, page "Lazarus project files", as it stood on 2022-03-09 after a change by Alextp, 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).*
15543Category: Lazarus

Back to history