I\'m recently reading the source code of sqlite3. In the amalgamation version, there are only four files. On the official website, they say that:
"t
You can have similar result if you parse all .c file, extract all #include
s, then build a huge file that first lists all includes, then lists all the other content of those .c files.
This way you have all code in a single translation unit which allows the compiler to see all code at once and perform better optimizations. This is relevant for most C compilers yet newest compilers feature so-called link-time code generation that allows the compiler to see code of multiple translation units at once (at link time) and generate better code even without the amalgamation trick.