3

After doing a light search on the Lazarus site I've come to the conclusion that this question has been asked some times but I haven't found an answer, so I'll ask my SO peers.

Is there a a way to create a Makefile to replicate the action of the Lazarus IDE when it compiles a project.

If so I really don't mind if it's makefile.fpc or just plain makefile, I just want some pointers on how to get to it.

BTW, I've tried the option to enable the Makefile on the Lazarus options. Doesn't work.

Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76

2 Answers2

3

Afaik the key is "lazbuild", which is the cmdline build tool.

But no, afaik there is no makefile generation option, and I doubt there will ever be one.

FPC/lazarus use makefiles internally, to iterate over packages, but they don't generate a makefile for each compile like other systems do.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
2
lazbuild -B project.lpi 

will rebuild the whole project.

lazbuild project.lpi 

will compile the whole project, looking only at changed files.

see here for more references and detailed usage: http://wiki.freepascal.org/lazbuild

lazbuild --create-makefile 

might create a makefile, but i haven't tested this yet.

Thierry
  • 21
  • 1