However, now that era is over, for I've found the solution, and I can document it in a developer-friendly way!
Indeed, Lazarus is "just an IDE". And it builds things using FPC through a wrapper called lazbuild. So, it is possible to build everything without installing the IDE.
On their website, it's provided as a single package, but in Debian (and therefore probably most other distributions) it is split into several packages, LCL being one of them.
What's more, the LCL package does not only include LCL, but also everything else you need to build projects created with Lazarus, including the lazbuild wrapper.
So, all you really need is:
- fp-compiler (it depends on RTL)
- FPC units you want to use in your project ( fp-units-<choose> , or simply install fpc which depends on most of them; the FPC IDE itself is only 5 MB in size)
- LCL (with --no-install-recommends since it depends on lazarus-ide )
You can simply install lcl --no-install-recommends (it depends on fp-compiler and some essential fp-units) and then add additional fp-units that you require (fp-units-gfx and fp-units-multimedia depend on quite a few development packages, but if you will probably need at least fp-units-gfx if you want to use forms in your application).
After that, you can use lazbuild to build your project - without the Lazarus IDE, documentation and fpc sources (that's several hundred megabytes).
If you want to avoid using lazbuild for some reason, then all you need to do is manually specify the compiler options, including unit directories, to fpc. (Or include them in fpc.cfg , but this is probably not going to be much help.)
To find out which options does Lazarus pass to the compiler for building your project, open "Project Options" and click "Show options" in the bottom of the window (at least that's how I did it on Lazarus 1.2.4). You can copy those options and use them in your Makefile . At least I have successfully built my "Hello World" with one form and one button this way.
The paths will vary greatly on different systems, so it's probably to use scripts to build them. And of course, LCL is (at least by default) located in the Lazarus directory and not in the FPC directory, so the FAQ on this forum gives the wrong paths. Also, you will most likely need at least three paths and not one - the same as you see in the Windows part.
It would probably be good if someone edited the FAQ, or even better, linked it to this post (or copied the post there) for sake of completeness (to also explain "Why would I want this" and other things).