# which runs speedtest1 multiple times.
$(EXPORTED_FUNCTIONS.speedtest1): $(EXPORTED_FUNCTIONS.api.core)
- @echo "$(emo.compile) Making $@ ..."
+ @echo "Making $@ ..."
@$(call b.call.mkdir@)
@{ echo _wasm_main; cat $(EXPORTED_FUNCTIONS.api.core); } > $@
-speedtest1.js = $(dir.dout)/speedtest1.js
emcc.flags.speedtest1-vanilla = $(cflags.common) -DSQLITE_SPEEDTEST1_WASM
speedtest1.cfiles = $(speedtest1.c) $(sqlite3-wasm.c)
-$(speedtest1.js): $(MAKEFILE) $(speedtest1.cfiles) \
- $(pre-post-speedtest1-vanilla.deps) \
+$(out.speedtest1-vanilla.js): $(MAKEFILE) $(speedtest1.cfiles) \
+ $(pre-post.speedtest1-vanilla.deps) \
$(EXPORTED_FUNCTIONS.speedtest1)
- @echo "Building $@ ..."
- $(bin.emcc) \
+ @$(call b.echo,speedtest1-vanilla,$(emo.compile) building ...)
+ @$(call b.call.mkdir@)
+ @$(call b.cmd@)$(bin.emcc) \
$(emcc.speedtest1) \
$(emcc.speedtest1.common) \
$(emcc.flags.speedtest1-vanilla) $(pre-post.speedtest1-vanilla.flags) \
$(speedtest1.exit-runtime0) \
-o $@ $(speedtest1.cfiles) -lm
@chmod -x $(basename $@).wasm
- @$(maybe-wasm-strip) $(basename $@).wasm
- @$(call SQLITE.strip-emcc-js-cruft)
+ @$(call b.call.wasm-strip,speedtest1-vanilla)
+ @$(call b.do.wasm-opt,speedtest1-vanilla)
+ @$(call b.call.strip-emcc-js-cruft,$(logtag.speedtest1-vanilla))
@ls -la $@ $(speedtest1.wasm)
-speedtest1: $(speedtest1.js)
+speedtest1: $(out.speedtest1-vanilla.js)
#xxx#all: speedtest1
# end speedtest1.js
########################################################################
EmscriptenModule /* see post-js-header/footer.js */,
!!ff.__isUnderTest
);
+ sIMS.debugModule("sqlite3InitModule() sqlite3 =",s);
//const rv = s.asyncPostInit();
//delete s.asyncPostInit;
//#if wasmfs
throw new Error("sqlite3-api-cleanup.js expects to be running in the "+
"context of its Emscripten module loader.");
}
-
try{
/* Config options for sqlite3ApiBootstrap(). */
const bootstrapConfig = Object.assign(
bootstrapConfig.wasmPtrIR =
'number'===(typeof bootstrapConfig.exports.sqlite3_libversion())
? 'i32' :'i64';
+ const sIMS = sqlite3InitScriptInfo;
+ sIMS.debugModule("Bootstrapping lib config", sIMS);
/**
For purposes of the Emscripten build, call sqlite3ApiBootstrap().
"\n########################################################################\n"
/*
-** Flags for use with BuildDef::flags and the 3rd argument to
-** mk_pre_post().
+** Flags for use with BuildDef::flags.
**
** Maintenance reminder: do not combine flags within this enum,
** e.g. F_BUNDLER_FRIENDLY=0x02|F_ESM, as that will lead
"$(sqlite3-license-version.js): $(sqlite3.h) "
"$(dir.api)/sqlite3-license-version-header.js $(MAKEFILE)\n"
"\t@echo '$(logtag.@) $(emo.disk)'; { \\\n"
+ "\t\t$(call b.call.mkdir@); \\\n"
"\t\tcat $(dir.api)/sqlite3-license-version-header.js || exit $$?; \\\n"
"\t\techo '/*'; \\\n"
"\t\techo '** This code was built from sqlite3 version...'; \\\n"
ps(zBanner
"# $(sqlite3-api-build-version.js) injects the build version info into\n"
"# the bundle in JSON form.\n"
- "$(sqlite3-api-build-version.js): $(MKDIR.bld) $(bin.version-info) $(MAKEFILE)\n"
+ "$(sqlite3-api-build-version.js): $(bin.version-info) $(MAKEFILE)\n"
"\t@echo '$(logtag.@) $(emo.disk)'; { \\\n"
+ "\t\t$(call b.call.mkdir@); \\\n"
"\t\techo 'globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){'; \\\n"
"\t\techo -n ' sqlite3.version = '; \\\n"
"\t\t$(bin.version-info) --json; \\\n"
"\t} > $@"
);
-#if 0
- ps(zBanner
- "$(sqlite3-api.js.in): $(MKDIR.bld) $(sqlite3-api.jses) $(MAKEFILE)\n"
- "\t@echo 'Making $@ ...'\n"
- "\t@for i in $(sqlite3-api.jses); do \\\n"
- "\t\techo \"/* BEGIN FILE: $$i */\"; \\\n"
- "\t\tcat $$i; \\\n"
- "echo \"/* END FILE: $$i */\"; \\\n"
- "\tdone > $@\n"
- );
-#endif
-
ps(zBanner
"# extern-post-js* and extern-pre-js* are files for use with\n"
"# Emscripten's --extern-pre-js and --extern-post-js flags.\n"
/*
** Emits makefile code for setting up values for the --pre-js=FILE,
** --post-js=FILE, and --extern-post-js=FILE emcc flags, as well as
-** populating those files.
+** populating those files. This is necessary for any builds which
+** embed the library's JS parts of this build (as opposed to parts
+** which do not use the library-level code).
*/
static void mk_pre_post(char const *zBuildName){
/* Very common printf() args combo. */
" $(sqlite3-api.%s.js)"
" $(dir.api)/post-js-footer.js\n",
zBuildName, zBuildName);
+
pf("$(eval $(call b.eval.c-pp,"
"%s,"
"$(post-js.%s.in),"
"))\n",
zBuildName, zBuildName, zBuildName, zBuildName);
+ pf("$(post-js.%s.js): $(post-js.%s.in)\n",
+ zBuildName, zBuildName);
+
ps("\n# --extern-post-js=...");
pf("extern-post-js.%s.js = $(dir.tmp)/extern-post-js.%s.js\n",
zBuildName, zBuildName);
zBuildName);
}
+/**
+ Emit rules for sqlite3-api.${zBuildName}.js. zCmppD is optional
+ flags for $(bin.c-pp).
+*/
static void emit_api_js(char const *zBuildName,
char const *zCmppD){
pf("c-pp.D.%s ?= %s\n"
pB->zEnv ? pB->zEnv : oBuildDefs.vanilla.zEnv);
pf("emcc.flags.%s ?= %s\n", zBuildName, pB->zEmcc ? pB->zEmcc : "");
- /* Create sqlite3-api.*.js */
emit_api_js(zBuildName, pB->zCmppD);
mk_pre_post(zBuildName);
pf("\t@echo '$(logtag.%s) $(emo.fire)$(emo.fire)$(emo.fire): "
"unsupported build. Use at your own risk.'\n", zBuildName);
}
- pf("\t$(b.cmd.loud)$(call b.do.emcc,%s)\n", zBuildName);
+ pf("\t$(b.cmd@)$(call b.do.emcc,%s)\n", zBuildName);
{ /* Post-compilation transformations and copying to
$(dir.dout)... */
"$(SOAP.js)\n",
zBuildName, zBuildName);
emit_compile_start(zBuildName);
- pf("\t$(b.cmd.loud)$(bin.emcc) -o $@"
+ pf("\t$(b.cmd@)$(bin.emcc) -o $@"
" $(emcc.flags.%s)" /* set in fiddle.make */
" $(pre-post.%s.flags)"
" $(fiddle.cses)"
}
}
+static void mk_speedtest1(void){
+ char const *zBuildName = "speedtest1-vanilla";
+ pf(zBanner "# Begin build %s\n", zBuildName);
+ pf("emo.%s ="
+ "🛼" // roller skates
+ /*"🏎" //racecar doesn't show up well in my emacs or terminal */
+ "\n",
+ zBuildName);
+ pf("logtag.%s = [$(emo.%s) [%s] $@]:\n"
+ "$(info $(logtag.%s) Setting up target speedtest1)\n"
+ "all: speedtest1\n",
+ zBuildName, zBuildName, zBuildName,
+ zBuildName );
+
+ pf("out.%s.js = $(dir.dout)/speedtest1.js\n"
+ "out.%s.wasm = $(dir.dout)/speedtest1.wasm\n",
+ zBuildName, zBuildName);
+
+ emit_api_js(zBuildName, 0);
+ mk_pre_post(zBuildName);
+
+#if 0
+ mk_pre_post("speedtest1-vanilla");
+ ps(zBanner "ifeq (1,$(HAVE_WASMFS))");
+ mk_pre_post("speedtest1-wasmfs");
+ ps("endif\n# ^^^ HAVE_WASMFS" zBanner);
+#endif
+#if 0
+ mk_pre_post(0, "speedtest1","vanilla", 0, "speedtest1.wasm");
+ mk_pre_post(0, "speedtest1-wasmfs", "esm",
+ "$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs",
+ "speetest1-wasmfs.wasm");
+#endif
+
+}
+
int main(void){
int rc = 0;
const BuildDef *pB;
"b-esm64: $(dir.dout)/sqlite3-64bit.mjs\n"
);
mk_fiddle();
-#if 0
- mk_pre_post("speedtest1-vanilla");
- ps(zBanner "ifeq (1,$(HAVE_WASMFS))");
- mk_pre_post("speedtest1-wasmfs");
- ps("endif\n# ^^^ HAVE_WASMFS" zBanner);
-#endif
-#if 0
- mk_pre_post(0, "speedtest1","vanilla", 0, "speedtest1.wasm");
- mk_pre_post(0, "speedtest1-wasmfs", "esm",
- "$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs",
- "speetest1-wasmfs.wasm");
-#endif
+ mk_speedtest1();
return rc;
}
loud ?= 0
ifeq (1,$(loud))
$(info $(emo.megaphone) Emitting loud build info. Pass loud=0 to disable it.)
- b.cmd.loud =
+ b.cmd@ =
else
$(info $(emo.mute) Eliding loud build info. Pass loud=1 to enable it.)
- b.cmd.loud = @
+ b.cmd@ = @
endif
#
-C Move\ssome\sof\sthe\sgenerated\swasm\smakefile\sutility\scode\sout\sof\sC\sand\sinto\sutil.make.
-D 2025-09-24T04:58:14.025
+C Further\swasm\sbuild\srefactoring.\sGet\sspeedtest1\sbuilding\sagain.
+D 2025-09-24T06:43:24.367
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F ext/session/sqlite3session.h 7404723606074fcb2afdc6b72c206072cdb2b7d8ba097ca1559174a80bc26f7a
F ext/session/test_session.c 8766b5973a6323934cb51248f621c3dc87ad2a98f023c3cc280d79e7d78d36fb
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
-F ext/wasm/GNUmakefile 613f0baf08b905dfeb67f0f405be8b466870e72040970c7b631d0d3483aed329
+F ext/wasm/GNUmakefile 662d8e6e5bccd2573ebc807797845ab7ded3de5b84ecbb5bca071eee5dd57710
F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
F ext/wasm/README.md 66ace67ae98a45e4116f2ca5425b716887bcee4d64febee804ff6398e1ae9ec7
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see fb29e62082a658f0d81102488414d422c393c4b20cc2f685b216bc566237957b
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
F ext/wasm/api/README.md f4c0d67caaee21a77b8938c30b5f79667bfc9d0c95d01b51df77ea35ee773884
-F ext/wasm/api/extern-post-js.c-pp.js d3748c6bbdcef15d8e494e0558aad370b9c24242eb020042b3a73b4950562f5b
+F ext/wasm/api/extern-post-js.c-pp.js 6bf4407c028fac7d387821420cd25f6d68ad80f7d526e86539b6a3012230917f
F ext/wasm/api/extern-pre-js.js cc61c09c7a24a07dbecb4c352453c3985170cec12b4e7e7e7a4d11d43c5c8f41
F ext/wasm/api/post-js-footer.js e617e5f81a907362de152576323155f02d24642e625fc05fb801b86b6a269444
F ext/wasm/api/post-js-header.js 79d078aec33d93b640a19c574b504d88bb2446432f38e2fbb3bb8e36da436e70
F ext/wasm/api/pre-js.c-pp.js 664551f490d296e0f4590d3a029787ab0782b9a1fa5954d73bde4fb2c6bfc709
-F ext/wasm/api/sqlite3-api-cleanup.js f91a2afdef19c350bce99784fff20310d4d060520001059822aa36c4ce80dc56
+F ext/wasm/api/sqlite3-api-cleanup.js e643a96c5323e051e29046bfd6412750917ca2c955e31c9192fb924ecc8ed004
F ext/wasm/api/sqlite3-api-glue.c-pp.js 12f5b36775fab1e7bf5385689fded2b2a9f77360562515e9849acb5e66602e2d
F ext/wasm/api/sqlite3-api-oo1.c-pp.js db4c8ebb03bac60db32ce03f8c615b00f4e4ad53e7d5de5e63d2780cba052caa
F ext/wasm/api/sqlite3-api-prologue.js 259c72c6a33ba1be2297c568cbc2ad53437d1d4b2613d7772c56a3aa00bf435d
F ext/wasm/index.html bcaa00eca521b372a6a62c7e7b17a870b0fcdf3e418a5921df1fd61e5344080d
F ext/wasm/jaccwabyt/jaccwabyt.js bbac67bc7a79dca34afe6215fd16b27768d84e22273507206f888c117e2ede7d
F ext/wasm/jaccwabyt/jaccwabyt.md 167fc0b624c9bc2c477846e336de9403842d81b1a24fc4d3b24317cb9eba734f
-F ext/wasm/mkwasmbuilds.c 4bd08e7d51d6981a1c5915251b8ed2ed02bca88ab4d33395d97deb757d4c672a
+F ext/wasm/mkwasmbuilds.c cbe5d7ba4def46646240e95de37da13f82aa5bffcb45d5c6f0c85c1e48ad8da9
F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337
F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96
F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63
F ext/wasm/tests/opfs/sahpool/index.html be736567fd92d3ecb9754c145755037cbbd2bca01385e2732294b53f4c842328
F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36e0f6991460fff0cb7c15079454679a4e2
F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61
-F ext/wasm/util.make a500a5e82b8df9918a2fe5933be20684063b130783e45653d81c07cc3cd3bb92
+F ext/wasm/util.make fc5966e80b2060617a72883dcde6038de72f583efd2bbb0b17a97f90dac23e95
F ext/wasm/wasmfs.make 5de02751b3e9e79b81a52ab4fe0ed6aa6a23311a90db58fea98c1c4e2845e562
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
F main.mk 20fe7a151708fc6b1f8cd0fdcc73622701cff5959131cfb73e1f75d33e687bf8
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 61648610c3e454fce77b78e6f6be1b71e27bb9587af03ae5c0e083eac7158a64
-R d5aba8b9559a3ddbff76cbd26aca8857
+P a2935758f534b51cac3d2e5ece74b369c806e3a994781744708e1590b9c32542
+R acf4dcbfdb081e066471151e72df143c
U stephan
-Z fb9bb507dc672f8ae32e129d4eb47e84
+Z f6eb445351bec0a252beebd2cdc4d7bf
# Remove this line to create a well-formed Fossil manifest.
-a2935758f534b51cac3d2e5ece74b369c806e3a994781744708e1590b9c32542
+5434307dcd927686ce827da22de55020c4b431f888ac81ae3634d458ad0b563d