blob: 730407b4975ee8b9615203318b90921636fe9f5e (
plain)
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
41
|
#!/bin/sh
#
# This script is based on the sqlite publish.sh script. It is used to
# generate autogenerated SQLite files for release builds.
#
# Create a temporary directory to hold the generated files
tmp_dir="`dirname $0`/s_sql.tmp"
mkdir -p "$tmp_dir"
cd "$tmp_dir"
# Paths are relative to dist/s_sql.tmp.
# Use relative paths, so that s_sql can be run on Windows (the SQLite make
# step uses Tcl, which requires a relative path to work under cygwin).
sqldir=../../lang/sql/sqlite
destdir=../../lang/sql/generated
copy_if_changes()
{
f1="$1"
f2="$2"
cmp $f1 $f2 > /dev/null 2>&1 ||
(rm -f $f1 && cp $f2 $f1 && echo "Updated $f1")
}
mkdir -p $destdir
$sqldir/configure
make sqlite3.c
copy_if_changes "$destdir/sqlite3.c" "sqlite3.c"
copy_if_changes "$destdir/sqlite3.h" "sqlite3.h"
# Auto-generated files used in the Windows build.
copy_if_changes "$destdir/keywordhash.h" "keywordhash.h"
copy_if_changes "$destdir/opcodes.c" "opcodes.c"
copy_if_changes "$destdir/opcodes.h" "opcodes.h"
copy_if_changes "$destdir/parse.c" "parse.c"
copy_if_changes "$destdir/parse.h" "parse.h"
cd ..
rm -rf "$tmp_dir"
|