xref: /sqlite-3.40.0/ext/wasm/GNUmakefile (revision d92c652a)
1########################################################################
2# This GNU makefile drives the build of the sqlite3 WASM
3# components. It is not part of the canonical build process.
4########################################################################
5SHELL := $(shell which bash 2>/dev/null)
6MAKEFILE := $(lastword $(MAKEFILE_LIST))
7all:
8release: all
9
10# Emscripten SDK home dir and related binaries...
11EMSDK_HOME ?= $(word 1,$(wildcard $(HOME)/src/emsdk $(HOME)/emsdk))
12emcc.bin ?= $(word 1,$(wildcard $(shell which emcc) $(EMSDK_HOME)/upstream/emscripten/emcc))
13ifeq (,$(emcc.bin))
14  $(error Cannot find emcc.)
15endif
16
17wasm-strip ?= $(shell which wasm-strip 2>/dev/null)
18ifeq (,$(filter clean,$(MAKECMDGOALS)))
19ifeq (,$(wasm-strip))
20  $(info WARNING: *******************************************************************)
21  $(info WARNING: builds using -O2/-O3/-Os/-Oz will minify WASM-exported names,)
22  $(info WARNING: breaking _All The Things_. The workaround for that is to build)
23  $(info WARNING: with -g3 (which explodes the file size) and then strip the debug)
24  $(info WARNING: info after compilation, using wasm-strip, to shrink the wasm file.)
25  $(info WARNING: wasm-strip was not found in the PATH so we cannot strip those.)
26  $(info WARNING: If this build uses any optimization level higher than -O1 then)
27  $(info WARNING: the ***resulting WASM binary WILL NOT BE USABLE***.)
28  $(info WARNING: wasm-strip is part of the wabt package:)
29  $(info WARNING:    https://github.com/WebAssembly/wabt)
30  $(info WARNING: on Ubuntu-like systems it can be installed with:)
31  $(info WARNING:    sudo apt install wabt)
32  $(info WARNING: *******************************************************************)
33endif
34endif # 'make clean' check
35
36ifeq (,$(wasm-strip))
37  maybe-wasm-strip = echo "not wasm-stripping"
38else
39  maybe-wasm-strip = $(wasm-strip)
40endif
41
42dir.top := ../..
43# Reminder: some Emscripten flags require absolute paths
44dir.wasm := $(patsubst %/,%,$(dir $(abspath $(MAKEFILE))))
45dir.api := api
46dir.jacc := jaccwabyt
47dir.common := common
48dir.fiddle := fiddle
49CLEAN_FILES := *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~
50emcc_enable_bigint ?= 1
51sqlite3.c := $(dir.top)/sqlite3.c
52SQLITE_OPT = \
53  -DSQLITE_ENABLE_FTS4 \
54  -DSQLITE_ENABLE_RTREE \
55  -DSQLITE_ENABLE_EXPLAIN_COMMENTS \
56  -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
57  -DSQLITE_ENABLE_STMTVTAB \
58  -DSQLITE_ENABLE_DBPAGE_VTAB \
59  -DSQLITE_ENABLE_DBSTAT_VTAB \
60  -DSQLITE_ENABLE_BYTECODE_VTAB \
61  -DSQLITE_ENABLE_OFFSET_SQL_FUNC \
62  -DSQLITE_OMIT_LOAD_EXTENSION \
63  -DSQLITE_OMIT_DEPRECATED \
64  -DSQLITE_OMIT_UTF16 \
65  -DSQLITE_OMIT_SHARED_CACHE \
66  -DSQLITE_OMIT_WAL \
67  -DSQLITE_THREADSAFE=0 \
68  -DSQLITE_TEMP_STORE=3 \
69  -DSQLITE_OS_KV_OPTIONAL=1 \
70  '-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \
71  -DSQLITE_USE_URI=1 \
72  -DSQLITE_WASM_ENABLE_C_TESTS
73# ^^^ most flags are set in sqlite3-wasm.c but we need them
74# made explicit here for building speedtest1.c.
75
76ifneq (,$(filter release,$(MAKECMDGOALS)))
77emcc_opt ?= -Oz -flto
78else
79emcc_opt ?= -O0
80# ^^^^ build times for -O levels higher than 0 are painful at
81# dev-time.
82endif
83# When passing emcc_opt from the CLI, += and re-assignment have no
84# effect, so emcc_opt+=-g3 doesn't work. So...
85emcc_opt_full := $(emcc_opt) -g3
86# ^^^ ALWAYS use -g3. See below for why.
87#
88# ^^^ -flto improves runtime speed at -O0 considerably but doubles
89# build time.
90#
91# ^^^^ -O3, -Oz, -Os minify symbol names and there appears to be no
92# way around that except to use -g3, but -g3 causes the binary file
93# size to absolutely explode (approx. 5x larger). This minification
94# utterly breaks the resulting module, making it unsable except as
95# self-contained/self-referential-only code, as ALL of the exported
96# symbols get minified names.
97#
98# However, we have an option for using -Oz or -Os:
99#
100# Build with (-Os -g3) or (-Oz -g3) then use wasm-strip, from the wabt
101# tools package (https://github.com/WebAssembly/wabt), to strip the
102# debugging symbols. That results in a small build with unmangled
103# symbol names. -Oz gives ever-so-slightly better compression than
104# -Os: not quite 1% in some completely unscientific tests. Runtime
105# speed for the unit tests is all over the place either way so it's
106# difficult to say whether -Os gives any speed benefit over -Oz.
107#
108# (Much later: -O2 consistently gives the best speeds.)
109########################################################################
110
111
112$(sqlite3.c):
113	$(MAKE) -C $(dir.top) sqlite3.c
114
115clean:
116	-rm -f $(CLEAN_FILES)
117
118ifeq (release,$(filter release,$(MAKECMDGOALS)))
119  ifeq (,$(wasm-strip))
120    $(error Cannot make release-quality binary because wasm-strip is not available. \
121            See notes in the warning above)
122  endif
123else
124  $(info Development build. Use '$(MAKE) release' for a smaller release build.)
125endif
126
127EXPORTED_FUNCTIONS.api.in := $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-api
128
129EXPORTED_FUNCTIONS.api: $(EXPORTED_FUNCTIONS.api.in) $(MAKEFILE)
130	cat $(EXPORTED_FUNCTIONS.api.in) > $@
131CLEAN_FILES += EXPORTED_FUNCTIONS.api
132
133sqlite3-api.jses := $(dir.api)/sqlite3-api-prologue.js
134sqlite3-api.jses += $(dir.common)/whwasmutil.js
135sqlite3-api.jses += $(dir.jacc)/jaccwabyt.js
136sqlite3-api.jses += $(dir.api)/sqlite3-api-glue.js
137sqlite3-api.jses += $(dir.api)/sqlite3-api-oo1.js
138sqlite3-api.jses += $(dir.api)/sqlite3-api-worker1.js
139sqlite3-api.jses += $(dir.api)/sqlite3-api-opfs.js
140sqlite3-api.jses += $(dir.api)/sqlite3-api-cleanup.js
141
142sqlite3-api.js := sqlite3-api.js
143CLEAN_FILES += $(sqlite3-api.js)
144$(sqlite3-api.js): $(sqlite3-api.jses) $(MAKEFILE)
145	@echo "Making $@..."
146	@for i in $(sqlite3-api.jses); do \
147		echo "/* BEGIN FILE: $$i */"; \
148		cat $$i; \
149		echo "/* END FILE: $$i */"; \
150	done > $@
151
152########################################################################
153# --post-js and --pre-js are emcc flags we use to append/prepend JS to
154# the generated emscripten module file.
155pre-js.js := $(dir.api)/pre-js.js
156post-js.js := post-js.js
157CLEAN_FILES += $(post-js.js)
158post-jses := \
159  $(dir.api)/post-js-header.js \
160  $(sqlite3-api.js) \
161  $(dir.api)/post-js-footer.js
162$(post-js.js): $(post-jses) $(MAKEFILE)
163	@echo "Making $@..."
164	@for i in $(post-jses); do \
165		echo "/* BEGIN FILE: $$i */"; \
166		cat $$i; \
167		echo "/* END FILE: $$i */"; \
168	done > $@
169extern-post-js.js := $(dir.api)/extern-post-js.js
170extern-pre-js.js := $(dir.api)/extern-pre-js.js
171pre-post-common.flags := \
172  --post-js=$(post-js.js) \
173  --extern-post-js=$(extern-post-js.js) \
174  --extern-pre-js=$(extern-pre-js.js)
175pre-post-jses.deps := $(post-js.js) \
176  $(extern-post-js.js) $(extern-pre-js.js)
177########################################################################
178# call-make-pre-js creates rules for pre-js-$(1).js. $1 = the base
179# name of the JS file on whose behalf this pre-js is for.
180define call-make-pre-js
181pre-post-$(1).flags ?=
182pre-js-$(1).js: $$(pre-js.js) $$(MAKEFILE)
183	cp $$(pre-js.js) $$@
184	echo "Module[xInstantiateWasm].uri = '$(1).wasm';" >> $$@
185CLEAN_FILES += pre-js-$(1).js
186pre-post-$(1).deps := $$(pre-post-jses.deps) pre-js-$(1).js
187pre-post-$(1).flags += --pre-js=pre-js-$(1).js
188endef
189#$(error $(call call-make-pre-js,sqlite3-wasmfs))
190# /post-js and pre-js
191########################################################################
192
193########################################################################
194# emcc flags for .c/.o/.wasm/.js.
195emcc.flags =
196#emcc.flags += -v # _very_ loud but also informative about what it's doing
197# -g is needed to keep -O2 and higher from creating broken JS via
198# minification.
199
200########################################################################
201# emcc flags for .c/.o.
202emcc.cflags :=
203emcc.cflags += -std=c99 -fPIC
204# -------------^^^^^^^^ we currently need c99 for WASM-specific sqlite3 APIs.
205emcc.cflags += -I. -I$(dir.top)
206
207########################################################################
208# emcc flags specific to building the final .js/.wasm file...
209emcc.jsflags := -fPIC
210emcc.jsflags += --minify 0
211emcc.jsflags += --no-entry
212emcc.jsflags += -sMODULARIZE
213emcc.jsflags += -sSTRICT_JS
214emcc.jsflags += -sDYNAMIC_EXECUTION=0
215emcc.jsflags += -sNO_POLYFILL
216emcc.jsflags += -sEXPORTED_FUNCTIONS=@$(dir.wasm)/EXPORTED_FUNCTIONS.api
217emcc.exportedRuntimeMethods := \
218    -sEXPORTED_RUNTIME_METHODS=FS,wasmMemory,allocateUTF8OnStack
219    # FS ==> stdio/POSIX I/O proxies
220    # wasmMemory ==> required by our code for use with -sIMPORTED_MEMORY
221    # allocateUTF8OnStack => for kvvfs internals
222emcc.jsflags += $(emcc.exportedRuntimeMethods)
223emcc.jsflags += -sUSE_CLOSURE_COMPILER=0
224emcc.jsflags += -sIMPORTED_MEMORY
225emcc.environment := -sENVIRONMENT=web,worker
226emcc.jsflags += -sALLOW_MEMORY_GROWTH
227# emcc: warning: USE_PTHREADS + ALLOW_MEMORY_GROWTH may run non-wasm code
228#       slowly, see https://github.com/WebAssembly/design/issues/1271
229#       [-Wpthreads-mem-growth]
230emcc.jsflags += -sINITIAL_MEMORY=13107200
231#emcc.jsflags += -sINITIAL_MEMORY=64225280
232# ^^^^ 64MB is not enough for WASMFS/OPFS test runs using batch-runner.js
233emcc.jsflags += $(emcc.environment)
234#emcc.jsflags += -sTOTAL_STACK=4194304
235
236sqlite3.js.init-func := sqlite3InitModule
237# ^^^^ $(sqlite3.js.init-func) symbol name is hard-coded in $(extern-post-js.js)
238
239emcc.jsflags += -sEXPORT_NAME=$(sqlite3.js.init-func)
240emcc.jsflags += -sGLOBAL_BASE=4096 # HYPOTHETICALLY keep func table indexes from overlapping w/ heap addr.
241#emcc.jsflags += -sSTRICT # fails due to missing __syscall_...()
242#emcc.jsflags += -sALLOW_UNIMPLEMENTED_SYSCALLS
243#emcc.jsflags += -sFILESYSTEM=0 # only for experimentation. sqlite3 needs the FS API
244#emcc.jsflags += -sABORTING_MALLOC
245emcc.jsflags += -sALLOW_TABLE_GROWTH
246emcc.jsflags += -Wno-limited-postlink-optimizations
247# ^^^^^ it likes to warn when we have "limited optimizations" via the -g3 flag.
248#emcc.jsflags += -sSTANDALONE_WASM # causes OOM errors, not sure why
249# https://lld.llvm.org/WebAssembly.html
250emcc.jsflags += -sERROR_ON_UNDEFINED_SYMBOLS=0
251emcc.jsflags += -sLLD_REPORT_UNDEFINED
252#emcc.jsflags += --allow-undefined
253emcc.jsflags += --import-undefined
254#emcc.jsflags += --unresolved-symbols=import-dynamic --experimental-pic
255#emcc.jsflags += --experimental-pic --unresolved-symbols=ingore-all --import-undefined
256#emcc.jsflags += --unresolved-symbols=ignore-all
257emcc.jsflags += -sWASM_BIGINT=$(emcc_enable_bigint)
258# ^^^^ MEMORY64=1 fails to load, erroring with:
259#  invalid memory limits flags 0x5
260#    (enable via --experimental-wasm-memory64)
261#
262# ^^^^ MEMORY64=2 builds and loads but dies when we do things like:
263#
264#  new Uint8Array(heapWrappers().HEAP8U.buffer, ptr, n)
265#
266# because ptr is now a BigInt, so is invalid for passing to arguments
267# which have strict must-be-a-Number requirements.
268########################################################################
269
270
271########################################################################
272# -sSINGLE_FILE:
273# https://github.com/emscripten-core/emscripten/blob/main/src/settings.js#L1704
274# -sSINGLE_FILE=1 would be really nice but we have to build with -g
275# for -O2 and higher to work (else minification breaks the code) and
276# cannot wasm-strip the binary before it gets encoded into the JS
277# file. The result is that the generated JS file is, because of the -g
278# debugging info, _huge_.
279########################################################################
280
281########################################################################
282# Maintenance reminder: the output .js and .wasm files of emcc must be
283# in _this_ dir, rather than a subdir, or else parts of the generated
284# code get confused and cannot load property (namely, the
285# sqlite3.worker.js generated in conjunction with -sWASMFS).
286sqlite3.js := sqlite3.js
287sqlite3.wasm := sqlite3.wasm
288sqlite3-wasm.o := $(dir.api)/sqlite3-wasm.o
289$(sqlite3-wasm.o): emcc.cflags += $(SQLITE_OPT)
290$(sqlite3-wasm.o): $(dir.top)/sqlite3.c
291sqlite3-wasm.c := $(dir.api)/sqlite3-wasm.c
292########################################################################
293# call-wasm-c-compile sets up build rules
294# for $1.o. $1 must be the name of a C file (with extension).
295define call-wasm-c-compile
296$(1).o := $$(subst .c,.o,$(1))
297sqlite3.wasm.obj += $$($(1).o)
298$$($(1).o): $$(MAKEFILE) $(1)
299	$$(emcc.bin) $$(emcc_opt_full) $$(emcc.flags) $$(emcc.cflags) -c $(1) -o $$@
300CLEAN_FILES += $$($(1).o)
301endef
302$(foreach c,$(sqlite3-wasm.c),$(eval $(call call-wasm-c-compile,$(c))))
303$(eval $(call call-make-pre-js,sqlite3))
304$(sqlite3.js): $(MAKEFILE) $(sqlite3.wasm.obj) \
305    EXPORTED_FUNCTIONS.api \
306    $(pre-post-sqlite3.deps)
307	@echo "Building $@ ..."
308	$(emcc.bin) -o $@ $(emcc_opt_full) $(emcc.flags) \
309    $(emcc.jsflags) $(pre-post-common.flags) $(pre-post-sqlite3.flags) \
310    $(sqlite3.wasm.obj)
311	chmod -x $(sqlite3.wasm)
312	$(maybe-wasm-strip) $(sqlite3.wasm)
313	@ls -la $@ $(sqlite3.wasm)
314
315CLEAN_FILES += $(sqlite3.js) $(sqlite3.wasm)
316all: $(sqlite3.js)
317wasm: $(sqlite3.js)
318# End main Emscripten-based module build
319########################################################################
320
321########################################################################
322# batch-runner.js...
323dir.sql := sql
324speedtest1 := ../../speedtest1
325speedtest1.c := ../../test/speedtest1.c
326speedtest1.sql := $(dir.sql)/speedtest1.sql
327speedtest1.cliflags := --size 25 --big-transactions
328$(speedtest1):
329	$(MAKE) -C ../.. speedtest1
330$(speedtest1.sql): $(speedtest1) $(MAKEFILE)
331	$(speedtest1) $(speedtest1.cliflags) --script $@
332batch-runner.list: $(MAKEFILE) $(speedtest1.sql) $(dir.sql)/000-mandelbrot.sql
333	bash split-speedtest1-script.sh $(dir.sql)/speedtest1.sql
334	ls -1 $(dir.sql)/*.sql | grep -v speedtest1.sql | sort > $@
335clean-batch:
336	rm -f batch-runner.list $(dir.sql)/speedtest1*.sql
337# ^^^ we don't do this along with 'clean' because we clean/rebuild on
338# a regular basis with different -Ox flags and rebuilding the batch
339# pieces each time is an unnecessary time sink.
340batch: batch-runner.list
341all: batch
342# end batch-runner.js
343########################################################################
344# speedtest1.js...
345# speedtest1-common.eflags = emcc flags used by multiple builds of speedtest1
346# speedtest1.eflags = emcc flags used by main build of speedtest1
347speedtest1-common.eflags := $(emcc_opt_full)
348speedtest1.eflags :=
349speedtest1.eflags += -sENVIRONMENT=web
350speedtest1-common.eflags += -sINVOKE_RUN=0
351speedtest1-common.eflags += --no-entry
352#speedtest1-common.eflags += -flto
353speedtest1-common.eflags += -sABORTING_MALLOC
354speedtest1-common.eflags += -sINITIAL_MEMORY=128450560
355speedtest1-common.eflags += -sSTRICT_JS
356speedtest1-common.eflags += -sMODULARIZE
357speedtest1-common.eflags += -Wno-limited-postlink-optimizations
358speedtest1-common.eflags += -sEXPORTED_FUNCTIONS=@$(dir.wasm)/EXPORTED_FUNCTIONS.speedtest1
359speedtest1-common.eflags += $(emcc.exportedRuntimeMethods)
360speedtest1-common.eflags += -sALLOW_TABLE_GROWTH
361speedtest1-common.eflags += -sDYNAMIC_EXECUTION=0
362speedtest1-common.eflags += --minify 0
363speedtest1-common.eflags += -sEXPORT_NAME=$(sqlite3.js.init-func)
364speedtest1-common.eflags += -sWASM_BIGINT=$(emcc_enable_bigint)
365speedtest1-common.eflags += $(pre-post-common.flags)
366speedtest1.exit-runtime0 := -sEXIT_RUNTIME=0
367speedtest1.exit-runtime1 := -sEXIT_RUNTIME=1
368# Re -sEXIT_RUNTIME=1 vs 0: if it's 1 and speedtest1 crashes, we get
369# this error from emscripten:
370#
371# > native function `free` called after runtime exit (use
372# NO_EXIT_RUNTIME to keep it alive after main() exits))
373#
374# If it's 0 and it crashes, we get:
375#
376# > stdio streams had content in them that was not flushed. you should
377# set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline
378# when you printf etc.
379#
380# and pending output is not flushed because it didn't end with a
381# newline (by design). The lesser of the two evils seems to be
382# -sEXIT_RUNTIME=1 but we need EXIT_RUNTIME=0 for the worker-based app
383# which runs speedtest1 multiple times.
384
385EXPORTED_FUNCTIONS.speedtest1: EXPORTED_FUNCTIONS.api
386	{ echo _wasm_main; cat EXPORTED_FUNCTIONS.api; } > $@
387CLEAN_FILES += EXPORTED_FUNCTIONS.speedtest1
388speedtest1.js := speedtest1.js
389speedtest1.wasm := $(subst .js,.wasm,$(speedtest1.js))
390speedtest1.cflags := \
391  -I. -I.. -I$(dir.top) \
392  -DSQLITE_SPEEDTEST1_WASM
393speedtest1.cs := $(speedtest1.c) $(sqlite3-wasm.c)
394$(speedtest1.js): emcc.cflags+=
395# speedtest1 notes re. sqlite3-wasm.o vs sqlite3-wasm.c: building against
396# the latter (predictably) results in a slightly faster binary, but we're
397# close enough to the target speed requirements that the 500ms makes a
398# difference.
399$(eval $(call call-make-pre-js,speedtest1))
400$(speedtest1.js): $(MAKEFILE) $(speedtest1.cs) \
401    $(pre-post-speedtest1.deps) \
402    EXPORTED_FUNCTIONS.speedtest1
403	@echo "Building $@ ..."
404	$(emcc.bin) \
405        $(speedtest1.eflags) $(speedtest1-common.eflags) $(speedtest1.cflags) \
406        $(pre-post-speedtest1.flags) \
407        $(SQLITE_OPT) \
408        $(speedtest1.exit-runtime0) \
409        -o $@ $(speedtest1.cs) -lm
410	$(maybe-wasm-strip) $(speedtest1.wasm)
411	ls -la $@ $(speedtest1.wasm)
412
413speedtest1: $(speedtest1.js)
414all: speedtest1
415CLEAN_FILES += $(speedtest1.js) $(speedtest1.wasm)
416# end speedtest1.js
417########################################################################
418
419########################################################################
420# fiddle_remote is the remote destination for the fiddle app. It
421# must be a [user@]HOST:/path for rsync.
422# Note that the target "should probably" contain a symlink of
423# index.html -> fiddle.html.
424fiddle_remote ?=
425ifeq (,$(fiddle_remote))
426ifneq (,$(wildcard /home/stephan))
427  fiddle_remote = wh:www/wh/sqlite3/.
428else ifneq (,$(wildcard /home/drh))
429  #fiddle_remote = if appropriate, add that user@host:/path here
430endif
431endif
432$(fiddle_files): default
433push-fiddle: $(fiddle_files)
434	@if [ x = "x$(fiddle_remote)" ]; then \
435		echo "fiddle_remote must be a [user@]HOST:/path for rsync"; \
436		exit 1; \
437	fi
438	rsync -va fiddle/ $(fiddle_remote)
439# end fiddle remote push
440########################################################################
441
442########################################################################
443# Convenience rules to rebuild with various -Ox levels. Much
444# experimentation shows -O2 to be the clear winner in terms of speed.
445# Note that build times with anything higher than -O0 are somewhat
446# painful.
447
448.PHONY: o0 o1 o2 o3 os oz
449o-xtra := -g3
450# ^^^ -g3 is important to keep higher -O levels from mangling (via
451# minification), or outright removing, otherwise working code.
452
453o-xtra += -flto
454# ^^^^ -flto can have a considerably performance boost at -O0 but
455# doubles the build time and seems to have negligible effect on
456# higher optimization levels.
457o0: clean
458	$(MAKE) -e "emcc_opt=-O0 $(o-xtra)"
459o1: clean
460	$(MAKE) -e "emcc_opt=-O1 $(o-xtra)"
461o2: clean
462	$(MAKE) -e "emcc_opt=-O2 $(o-xtra)"
463o3: clean
464	$(MAKE) -e "emcc_opt=-O3 $(o-xtra)"
465os: clean
466	@echo "WARNING: -Os can result in a build with mysteriously missing pieces!"
467	$(MAKE) -e "emcc_opt=-Os $(o-xtra)"
468oz: clean
469	$(MAKE) -e "emcc_opt=-Oz $(o-xtra)"
470
471########################################################################
472# Sub-makes...
473
474include fiddle.make
475
476########################################################################
477# Some platforms do not support the WASMFS build. Raspberry Pi OS is one
478# of them. As such platforms are discovered, add their (uname -m) name
479# to PLATFORMS_WITH_NO_WASMFS to exclude the wasmfs build parts.
480PLATFORMS_WITH_NO_WASMFS := aarch64 # add any others here
481THIS_ARCH := $(shell /usr/bin/uname -m)
482ifneq (,$(filter $(THIS_ARCH),$(PLATFORMS_WITH_NO_WASMFS)))
483$(info This platform does not support the WASMFS build.)
484else
485include wasmfs.make
486endif
487
488########################################################################
489# Push files to public wasm-testing.sqlite.org server
490wasm-testing.include = *.wasm *.js *.html \
491    batch-runner.list sql common fiddle jaccwabyt
492wasm-testing.exclude = sql/speedtest1.sql
493wasm-testing.dir     = /jail/sites/wasm-testing
494wasm-testing.dest   ?= wasm-testing:$(wasm-testing.dir)
495# ---------------------^^^^^^^^^^^^ ssh alias
496push:
497	rsync -z -e ssh --ignore-times --chown=stephan:www-data --group -r \
498    $(patsubst %,--exclude=%,$(wasm-testing.exclude)) \
499    $(wasm-testing.include) $(wasm-testing.dest)
500	ssh wasm-testing 'cd $(wasm-testing.dir) && bash .gzip' || \
501    echo "SSH failed: it's likely that stale content will be served via old gzip files."
502
503