Documentation Source Text

Check-in [5b99c03910]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update the amalgamation document with the latest size and file count numbers. Add yet another link to the How To Compile document.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5b99c03910587f2ad09224620d0ae9bf4f5483dc
User & Date: drh 2014-08-05 20:37:38
Context
2014-08-06
01:08
Add the DEFAULT bug to the change log. Fix a few typos. check-in: c60ce44b02 user: drh tags: trunk
2014-08-05
20:37
Update the amalgamation document with the latest size and file count numbers. Add yet another link to the How To Compile document. check-in: 5b99c03910 user: drh tags: trunk
20:22
Update the change log for the latest changes. Make it easier to find the "How To Compile" documentation. Remove Nokia from the sponsors list. check-in: c22649df68 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/amalgamation.in.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26


27
28
29
30
31
32
33
34
35
36
37
38
<title>The SQLite Amalgamation</title>
<tcl>hd_keywords {amalgamation} {the amalgamation}</tcl>

<h2>The SQLite Amalgamation</h2>

<p>The core SQLite library consists of about 96 files of C code
(as of [Version 3.6.21]) in the core with 11 additional files
in the [FTS3] and [RTREE] extensions.
Most of these are "source" files in the sense that they are stored 
in the configuration management system and are maintained directly. 
But 6 of the core C files are generated automatically during the 
compilation process.  Of the 96 code files, 76 are C code and 
20 are C header files.</p>

<p>The standard makefiles for SQLite have a target for building
an object we call the "amalgamation".  
The amalgamation is a single C code file, named "sqlite3.c",
that contains all C code 
for the core SQLite library and the [FTS3] and [RTREE] extensions.
This file contains about 110K lines of code 
(65K if you omit blank lines and comments) and is over 3.8 megabytes
in size.</p>

<p>The amalgamation contains everything you need to integrate SQLite 
into a larger project.  Just copy the amalgamation into your source 
directory and compile it along with the other C code files in your project.


You may also want to make use of the "sqlite3.h" header file that 
defines the programming API for SQLite. 
The sqlite3.h header file is available separately. 
The sqlite3.h file is also contained within the amalgamation, in
the first couple of thousand lines. So if you have a copy of 
sqlite3.c but cannot seem to locate sqlite3.h, you can always 
regenerate the sqlite3.h by copying and pasting from the amalgamation.</p>

<p>In addition to making SQLite easier to incorporate into other
projects, the amalgamation also makes it run faster. Many
compilers are able to do additional optimizations on code when 
it is contained with in a single translation unit such as it 





|
|



|
|
|






|
|





>
>




|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<title>The SQLite Amalgamation</title>
<tcl>hd_keywords {amalgamation} {the amalgamation}</tcl>

<h2>The SQLite Amalgamation</h2>

<p>The core SQLite library consists of 100 files of C code
(as of [Version 3.8.6]) in the core with 14 additional files
in the [FTS3] and [RTREE] extensions.
Most of these are "source" files in the sense that they are stored 
in the configuration management system and are maintained directly. 
But 6 of the core C files are generated automatically using scripts
or auxiliary programs during the compilation process.  Of the 100 
core files, 71 are C code and 29 are C header files.</p>

<p>The standard makefiles for SQLite have a target for building
an object we call the "amalgamation".  
The amalgamation is a single C code file, named "sqlite3.c",
that contains all C code 
for the core SQLite library and the [FTS3] and [RTREE] extensions.
This file contains about 149K lines of code 
(90K if you omit blank lines and comments) and is over 5.2 megabytes
in size.</p>

<p>The amalgamation contains everything you need to integrate SQLite 
into a larger project.  Just copy the amalgamation into your source 
directory and compile it along with the other C code files in your project.
(A [how to compile|more detailed discussion] of the compilation process is
available.)
You may also want to make use of the "sqlite3.h" header file that 
defines the programming API for SQLite. 
The sqlite3.h header file is available separately. 
The sqlite3.h file is also contained within the amalgamation, in
the first few of thousand lines. So if you have a copy of 
sqlite3.c but cannot seem to locate sqlite3.h, you can always 
regenerate the sqlite3.h by copying and pasting from the amalgamation.</p>

<p>In addition to making SQLite easier to incorporate into other
projects, the amalgamation also makes it run faster. Many
compilers are able to do additional optimizations on code when 
it is contained with in a single translation unit such as it 

Changes to pages/howtocompile.in.

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
with the expectation that application developers can use these examples
as guidance for developing their own custom compilation procedures.
In other words, this article provides ideas and insights, not turnkey
solutions.</p>

<h2>Amalgamation Versus Individual Source Files</h2> 

<p>SQLite is built from literally hundreds of files of C code and script
spread across multiple directories.  The implementation of SQLite is pure
ANSI-C, but many of the C-language source code files are either either
generated or transformed by auxiliary C programs and AWK, SED, and TCL 
scripts prior to being incorporated into the finished SQLite library.
Building the necessary C programs and transforming and/or creating the
C-language source code for SQLite is a complex process.</p>








|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
with the expectation that application developers can use these examples
as guidance for developing their own custom compilation procedures.
In other words, this article provides ideas and insights, not turnkey
solutions.</p>

<h2>Amalgamation Versus Individual Source Files</h2> 

<p>SQLite is built from over one hundred of files of C code and script
spread across multiple directories.  The implementation of SQLite is pure
ANSI-C, but many of the C-language source code files are either either
generated or transformed by auxiliary C programs and AWK, SED, and TCL 
scripts prior to being incorporated into the finished SQLite library.
Building the necessary C programs and transforming and/or creating the
C-language source code for SQLite is a complex process.</p>