3 # Run this script to generate the "src/shell.c" source file from
6 set topdir
[file dir
[file dir
[file normal
$argv0]]]
7 puts "Overwriting $topdir/src/shell.c with new shell source code..."
8 set out
[open $topdir/src
/shell.c wb
]
9 puts $out {/* DO NOT EDIT
!
10 ** This
file is automatically generated by the script in the canonical
11 ** SQLite
source tree at tool
/mkshellc.tcl. That script combines
source
12 ** code from various constituent
source files of SQLite into this single
13 ** "shell.c" file used to implement the SQLite command-line shell.
15 ** Most of the code found below comes from the
"src/shell.c.in" file in
16 ** the canonical SQLite
source tree. That main
file contains
"INCLUDE"
17 ** lines that specify other files in the canonical
source tree that are
18 ** inserted to getnerate this complete program
source file.
20 ** The code from multiple files is combined into this single
"shell.c"
21 ** source file to help make the command-line program easier to compile.
23 ** To modify this program
, get a copy of the canonical SQLite
source tree
,
24 ** edit the src
/shell.c.in
" and/or some of the other files that are included
25 ** by "src
/shell.c.in
", then rerun the tool/mkshellc.tcl script.
27 set in [open $topdir/src/shell.c.in rb]
31 if {[regexp {^INCLUDE } $lx]} {
32 set cfile [lindex $lx 1]
33 puts $out "/************************* Begin
$cfile ******************/"
34 set in2 [open $topdir/src/$cfile rb]
37 if {[regexp {^#include "sqlite
} $lx]} continue
38 set lx
[string map
[list __declspec
(dllexport
) {}] $lx]
42 puts $out "/************************* End $cfile ********************/"