*** 5,17 **** But many people find a knowledge of what is going on behind the scenes helpful. SQLite is implemented in ANSI-C. But many of the C code file that are input to the C compiler are generated from other scripts and programs rather than being ! typed in manually. The following diagram shows the complete ! build process: - {image: make-lib.gif} In the image above, red ovals are original source files from the configuration management system. --- 5,17 ---- But many people find a knowledge of what is going on behind the scenes helpful. + {rightimage: make-lib.gif} SQLite is implemented in ANSI-C. But many of the C code file that are input to the C compiler are generated from other scripts and programs rather than being ! typed in manually. The diagram to the right shows the complete ! build process. In the image above, red ovals are original source files from the configuration management system. *************** *** 116,131 **** shown above, the SQLite library is generated simply by passing the processed C code into an ordinary C compiler. *Building The Amalgamation* Beginning with version 3.3.14, SQLite is available in the form of a single huge source ! file that contains all of the source code for SQLite. We ! call this single source file "{link: /cvstrac/wiki?p=TheAmalgamation the amalgamation}". ! The diagram below shows how the amalgamation is built: - {image: make-amal.gif} Very little has changed from the previous diagram. The processed C code in the light-blue bubble is the same and --- 116,133 ---- shown above, the SQLite library is generated simply by passing the processed C code into an ordinary C compiler. + ----- *Building The Amalgamation* + {rightimage: make-amal.gif} + Beginning with version 3.3.14, SQLite is available in the form of a single huge source ! file that contains all of the source code for SQLite. ! We call this single source file "{link: /cvstrac/wiki?p=TheAmalgamation the amalgamation}". ! The diagram to the right shows how the amalgamation is built. Very little has changed from the previous diagram. The processed C code in the light-blue bubble is the same and *************** *** 137,139 **** --- 139,156 ---- {link: /cvstrac/rlog?f=sqlite/tool/mksqlite3c.tcl mksqlite3c.tcl} that reads the processed C code and copies it all into the amalgamation file, "sqlite3.c", in the right order. + The mksqlite3c.tcl script has to take care to replace + #includes of internal header files with the actual content + of those headers, and to make sure that headers are not + included more than once. And it has to add the sources in + just the right order. So building the amalgamation is more + than just concatenating the files together. But it is not + a lot more. + + Beginning with version 3.3.15, there is a makefile target that + will automatically build the amalgamation. Type: + + make sqlite3.c + + And the makefile will automatically construct the processed + C code then run mksqlite3c.tcl for you.