PDA

View Full Version : Which files are required to compile a project?



chronozphere
14-10-2010, 02:58 PM
Hey everyone,

I started writing pascal code again after a month of web-development. :)

I'm currently setting up a repository for my engine. Both Delphi and Lazarus generate a lot of files and I'm pretty sure I don't have to commit them all into my repository, to make the project compile when I pull it out somwhere else. So:

Which files are required to compile a Lazarus project? :)

Thanks!

WILL
14-10-2010, 04:50 PM
Well depending on how much LCL you've used, all you should need at a bare minimum is:

Project.lpi (xml setting for your project)
Project.lpr (main body code)
Units.pas (extra units)

Stuff you may have added due to making an application instead of just a program are the Unit.lfm files which are the Lazarus form data.

The rest of the compiler generated files such as .o, .ppu and .compiled are just for FPC to do it's magic for the linker.

Here is a Windows batch file that I use called Clean.bat:

del *.o
del *.ppu
del *.a

del *.compiled

del *.ini
del *.log

del *.dcu
del *.~pas
del *.~dpr
del *.bak

chronozphere
14-10-2010, 05:27 PM
Thanks. :)

Here, Lazarus also seems to generate .manifest files and a directory called "backup". I guess I can ignore/delete those too?

I'm also not sure about .res and .rc files.

de_jean_7777
14-10-2010, 06:57 PM
Thanks. :)

Here, Lazarus also seems to generate .manifest files and a directory called "backup". I guess I can ignore/delete those too?

I'm also not sure about .res and .rc files.

Those files are automatically generated on compile time and you don't need them, so it's safe to delete them. The "backup" directory are backups of source files, so you can revert changes you made.