forked from nalgeon/sqlean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (41 loc) · 2.24 KB
/
Makefile
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
42
43
44
45
46
47
48
.PHONY: prepare-dist download-sqlite download-native compile-linux compile-windows compile-macos test
prepare-dist:
mkdir -p dist
rm -f dist/*
download-sqlite:
curl -L http://sqlite.org/$(SQLITE_RELEASE_YEAR)/sqlite-amalgamation-$(SQLITE_VERSION).zip --output src.zip
unzip src.zip
mv sqlite-amalgamation-$(SQLITE_VERSION)/* src
download-native:
curl -L https://github.com/sqlite/sqlite/raw/master/ext/misc/json1.c --output src/sqlite3-json1.c
compile-linux:
gcc -fPIC -shared src/sqlite3-crypto.c src/crypto/*.c -o dist/crypto.so -lm
gcc -fPIC -shared src/sqlite3-json1.c -o dist/json1.so -lm
gcc -fPIC -shared src/sqlite3-math.c -o dist/math.so -lm
gcc -fPIC -shared src/sqlite3-re.c src/re.c -o dist/re.so -lm
gcc -fPIC -shared src/sqlite3-stats.c -o dist/stats.so -lm
gcc -fPIC -shared src/sqlite3-text.c -o dist/text.so -lm
gcc -fPIC -shared src/sqlite3-unicode.c -o dist/unicode.so -lm
gcc -fPIC -shared src/sqlite3-vsv.c -o dist/vsv.so -lm
compile-windows:
gcc -shared -I. src/sqlite3-crypto.c src/crypto/*.c -o dist/crypto.dll -lm
gcc -shared -I. src/sqlite3-json1.c -o dist/json1.dll
gcc -shared -I. src/sqlite3-math.c -o dist/math.dll
gcc -shared -I. src/sqlite3-re.c src/re.c -o dist/re.dll
gcc -shared -I. src/sqlite3-stats.c -o dist/stats.dll
gcc -shared -I. src/sqlite3-text.c -o dist/text.dll
gcc -shared -I. src/sqlite3-unicode.c -o dist/unicode.dll
gcc -shared -I. src/sqlite3-vsv.c -o dist/vsv.dll
compile-macos:
gcc -fPIC -dynamiclib -I src src/sqlite3-crypto.c src/crypto/*.c -o dist/crypto.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-json1.c -o dist/json1.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-math.c -o dist/math.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-re.c src/re.c -o dist/re.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-stats.c -o dist/stats.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-text.c -o dist/text.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-unicode.c -o dist/unicode.dylib -lm
gcc -fPIC -dynamiclib -I src src/sqlite3-vsv.c -o dist/vsv.dylib -lm
# fails is grep does find a failed test case
# https://stackoverflow.com/questions/15367674/bash-one-liner-to-exit-with-the-opposite-status-of-a-grep-command/21788642
test:
sqlite3 < test/$(suite).sql | (! grep -E "\d+.0")