@@ -10,14 +10,21 @@ SQLITE_AMALGAMATION = sqlite-amalgamation-3300100
10
10
SQLITE_AMALGAMATION_ZIP_URL = https://www.sqlite.org/2019/sqlite-amalgamation-3300100.zip
11
11
SQLITE_AMALGAMATION_ZIP_SHA1 = ff9b4e140fe0764bc7bc802facf5ac164443f517
12
12
13
- # Note that extension-functions.c hasn't been updated since 2010-02-06, so likely doesn't need to be updated
13
+ # Note that extension-functions.c hasn't been updated since 2010-02-06, so likely doesn't need to be updated
14
14
EXTENSION_FUNCTIONS = extension-functions.c
15
15
EXTENSION_FUNCTIONS_URL = https://www.sqlite.org/contrib/download/extension-functions.c?get=25
16
16
EXTENSION_FUNCTIONS_SHA1 = c68fa706d6d9ff98608044c00212473f9c14892f
17
17
18
18
EMCC =emcc
19
19
20
- CFLAGS =-O2 -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_DISABLE_LFS -DLONGDOUBLE_TYPE=double -DSQLITE_THREADSAFE=0 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS
20
+ CFLAGS = \
21
+ -O2 \
22
+ -DLONGDOUBLE_TYPE=double \
23
+ -DSQLITE_OMIT_LOAD_EXTENSION \
24
+ -DSQLITE_DISABLE_LFS \
25
+ -DSQLITE_ENABLE_FTS3 \
26
+ -DSQLITE_ENABLE_FTS3_PARENTHESIS \
27
+ -DSQLITE_THREADSAFE=0
21
28
22
29
# When compiling to WASM, enabling memory-growth is not expected to make much of an impact, so we enable it for all builds
23
30
# Since tihs is a library and not a standalone executable, we don't want to catch unhandled Node process exceptions
@@ -32,7 +39,7 @@ EMFLAGS = \
32
39
33
40
EMFLAGS_WASM = \
34
41
-s WASM=1 \
35
- -s ALLOW_MEMORY_GROWTH=1
42
+ -s ALLOW_MEMORY_GROWTH=1
36
43
37
44
EMFLAGS_OPTIMIZED = \
38
45
-s INLINING_LIMIT=50 \
@@ -67,19 +74,19 @@ dist/sql-wasm-debug.js: $(BITCODE_FILES) $(OUTPUT_WRAPPER_FILES) out/api.js src/
67
74
.PHONY : optimized
68
75
optimized : dist/sql-asm.js dist/sql-wasm.js dist/sql-asm-memory-growth.js
69
76
70
- dist/sql-asm.js : $(BITCODE_FILES ) $(OUTPUT_WRAPPER_FILES ) out/api.js src/exported_functions.json src/exported_runtime_methods.json
77
+ dist/sql-asm.js : $(BITCODE_FILES ) $(OUTPUT_WRAPPER_FILES ) out/api.js src/exported_functions.json src/exported_runtime_methods.json
71
78
$(EMCC ) $(EMFLAGS ) $(EMFLAGS_OPTIMIZED ) -s WASM=0 $(BITCODE_FILES ) --pre-js out/api.js -o $@
72
79
mv $@ out/tmp-raw.js
73
80
cat src/shell-pre.js out/tmp-raw.js src/shell-post.js > $@
74
81
rm out/tmp-raw.js
75
82
76
- dist/sql-wasm.js : $(BITCODE_FILES ) $(OUTPUT_WRAPPER_FILES ) out/api.js src/exported_functions.json src/exported_runtime_methods.json
83
+ dist/sql-wasm.js : $(BITCODE_FILES ) $(OUTPUT_WRAPPER_FILES ) out/api.js src/exported_functions.json src/exported_runtime_methods.json
77
84
$(EMCC ) $(EMFLAGS ) $(EMFLAGS_OPTIMIZED ) $(EMFLAGS_WASM ) $(BITCODE_FILES ) --pre-js out/api.js -o $@
78
85
mv $@ out/tmp-raw.js
79
86
cat src/shell-pre.js out/tmp-raw.js src/shell-post.js > $@
80
87
rm out/tmp-raw.js
81
88
82
- dist/sql-asm-memory-growth.js : $(BITCODE_FILES ) $(OUTPUT_WRAPPER_FILES ) out/api.js src/exported_functions.json src/exported_runtime_methods.json
89
+ dist/sql-asm-memory-growth.js : $(BITCODE_FILES ) $(OUTPUT_WRAPPER_FILES ) out/api.js src/exported_functions.json src/exported_runtime_methods.json
83
90
$(EMCC ) $(EMFLAGS ) $(EMFLAGS_OPTIMIZED ) -s WASM=0 -s ALLOW_MEMORY_GROWTH=1 $(BITCODE_FILES ) --pre-js out/api.js -o $@
84
91
mv $@ out/tmp-raw.js
85
92
cat src/shell-pre.js out/tmp-raw.js src/shell-post.js > $@
@@ -91,7 +98,7 @@ dist/sql-asm-memory-growth.js: $(BITCODE_FILES) $(OUTPUT_WRAPPER_FILES) out/api.
91
98
worker : dist/worker.sql-asm.js dist/worker.sql-asm-debug.js dist/worker.sql-wasm.js dist/worker.sql-wasm-debug.js
92
99
93
100
out/worker.js : src/worker.coffee
94
- cat $^ | coffee --bare --compile --stdio > $@
101
+ cat $^ | npx coffee --bare --compile --stdio > $@
95
102
96
103
dist/worker.sql-asm.js : dist/sql-asm.js out/worker.js
97
104
cat $^ > $@
@@ -125,7 +132,7 @@ dist/worker.sql-wasm-debug.js: dist/sql-wasm-debug.js out/worker.js
125
132
126
133
out/api.js : src/output-pre.js src/api.coffee src/exports.coffee src/api-data.coffee src/output-post.js
127
134
mkdir -p out
128
- cat src/api.coffee src/exports.coffee src/api-data.coffee | coffee --bare --compile --stdio > $@
135
+ cat src/api.coffee src/exports.coffee src/api-data.coffee | npx coffee --bare --compile --stdio > $@
129
136
cat src/output-pre.js $@ src/output-post.js > out/api-wrapped.js
130
137
mv out/api-wrapped.js $@
131
138
@@ -180,12 +187,12 @@ sqlite-src/$(SQLITE_AMALGAMATION)/$(EXTENSION_FUNCTIONS): cache/$(EXTENSION_FUNC
180
187
cp ' cache/$(EXTENSION_FUNCTIONS)' $@
181
188
182
189
183
- .PHONY : clean
184
- clean :
185
- rm -rf out/* dist/*
190
+ .PHONY : clean
191
+ clean :
192
+ rm -rf out/* dist/*
186
193
187
194
.PHONY : clean-all
188
- clean-all :
195
+ clean-all :
189
196
rm -f out/* dist/* cache/*
190
197
rm -rf sqlite-src/
191
198
0 commit comments