How to create makefile for Lazarus projects?
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开发者_C百科'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.
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.
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.
精彩评论