Skip to content

Commit 90134b5

Browse files
committed
Add dist-xl build target.
1 parent 66f4245 commit 90134b5

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
/debug
1212
/deps
1313
/tmp
14+
15+
/dist-xl.zip
16+
/dist-xl

Makefile

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,28 @@ WASQLITE_DEFINES ?= \
9494
-DSQLITE_USE_ALLOCA \
9595
-DSQLITE_ENABLE_BATCH_ATOMIC_WRITE
9696

97+
WASQLITE_KS_DEFINES ?= $(WASQLITE_DEFINES) \
98+
-DSQLITE_ENABLE_FTS5 \
99+
-DSQLITE_ENABLE_RTREE \
100+
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
101+
-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
102+
-DSQLITE_ENABLE_STMTVTAB \
103+
-DSQLITE_ENABLE_DBPAGE_VTAB \
104+
-DSQLITE_ENABLE_DBSTAT_VTAB \
105+
-DSQLITE_ENABLE_BYTECODE_VTAB \
106+
-DSQLITE_ENABLE_OFFSET_SQL_FUNC
107+
97108
# directories
98109
.PHONY: all
99110
all: dist
100111

101112
.PHONY: clean
102113
clean:
103-
rm -rf dist debug tmp
114+
rm -rf dist dist-xl debug tmp
104115

105116
.PHONY: spotless
106117
spotless:
107-
rm -rf dist debug tmp deps cache
118+
rm -rf dist dist-xl debug tmp deps cache
108119

109120
## cache
110121
.PHONY: clean-cache
@@ -232,3 +243,28 @@ dist/wa-sqlite-async.mjs: $(BITCODE_FILES_DIST) $(LIBRARY_FILES) $(EXPORTED_FUNC
232243
$(EMFLAGS_LIBRARIES) \
233244
$(EMFLAGS_ASYNCIFY_DIST) \
234245
$(BITCODE_FILES_DIST) -o $@
246+
247+
# dist-xl
248+
.PHONY: clean-dist-xl
249+
clean-dist-xl:
250+
rm -f dist-xl.zip
251+
rm -rf dist-xl
252+
253+
.PHONY: dist-xl
254+
dist-xl: dist-xl/wa-sqlite.mjs dist-xl/wa-sqlite-async.mjs
255+
zip -r dist-xl dist-xl/
256+
257+
dist-xl/wa-sqlite.mjs: deps/$(SQLITE_AMALGAMATION)/sqlite3.c deps/$(EXTENSION_FUNCTIONS) src/*.c
258+
mkdir -p dist-xl
259+
$(EMCC) $(CFLAGS_DIST) $(WASQLITE_KS_DEFINES) $(EMFLAGS_DIST) \
260+
$(EMFLAGS_INTERFACES) \
261+
$(EMFLAGS_LIBRARIES) \
262+
$^ -o $@
263+
264+
dist-xl/wa-sqlite-async.mjs: deps/$(SQLITE_AMALGAMATION)/sqlite3.c deps/$(EXTENSION_FUNCTIONS) src/*.c
265+
mkdir -p dist-xl
266+
$(EMCC) $(CFLAGS_DIST) $(WASQLITE_KS_DEFINES) $(EMFLAGS_DIST) \
267+
$(EMFLAGS_INTERFACES) \
268+
$(EMFLAGS_LIBRARIES) \
269+
$(EMFLAGS_ASYNCIFY_DIST) \
270+
$^ -o $@

0 commit comments

Comments
 (0)