}
ps(zBanner
+ "emoji ?= 1\n"
+ "ifneq (0,$(emoji))\n"
"emo.disk = 💾\n"
"emo.fire = 🔥\n"
"emo.done = 🏆\n" /*🏁*/
"emo.stop =🛑\n"
"emo.strip =🪚\n" /*🔪*/
"emo.garbage =🗑\n"
+ "endif\n"
);
ps(zBanner
);
ps(zBanner
- "emcc.loud ?= 0\n"
- "ifeq (1,$(emcc.loud))\n"
- "$(info $(emo.megaphone) Emitting loud build info."
- " Pass emcc.loud=0 to disable it.)\n"
- "emcc.squelch =\n"
- "else\n"
- "$(info $(emo.mute) Eliding loud build info."
- " Pass emcc.loud=1 to enable it.)\n"
- "emcc.squelch = @\n"
- "endif\n"
+ "loud ?= 0\n"
+ "ifeq (1,$(loud))\n"
+ "$(info $(emo.megaphone) Emitting loud build info."
+ " Pass loud=0 to disable it.)\n"
+ "cmd.loud =\n"
+ "else\n"
+ "$(info $(emo.mute) Eliding loud build info."
+ " Pass emcc.loud=1 to enable it.)\n"
+ "cmd.loud = @\n"
+ "endif\n"
);
ps(zBanner
** --post-js=FILE, and --extern-post-js=FILE emcc flags, as well as
** populating those files.
*/
-static void mk_pre_post(char const *zBuildName,
- BuildDef const * pB ){
+static void mk_pre_post(char const *zBuildName){
/* Very common printf() args combo. */
pf("%s# Begin --pre/--post flags for %s\n", zBanner, zBuildName);
pf("# End --pre/--post flags for %s%s", zBuildName, zBanner);
}
-#if 0
-/*
-** Emits rules for the fiddle builds.
-*/
-static void mk_fiddle(void){
- int i = 0;
+static char const * BuildDef_jsext(const BuildDef * pB){
+ return (F_ESM & pB->flags) ? ".mjs" : ".js";
+}
- mk_pre_post("fiddle-module", 0, "fiddle-module.wasm");
- for( ; i < 2; ++i ){
- /* 0==normal, 1==debug */
- const char *zTail = i ? ".debug" : "";
- const char *zDir = i ? "$(dir.fiddle-debug)" : "$(dir.fiddle)";
-
- pf("%s# Begin fiddle%s\n", zBanner, zTail);
- pf("fiddle-module.js%s = %s/fiddle-module.js\n", zTail, zDir);
- pf("$(fiddle-module.js%s):%s $(MAKEFILE_LIST) $(MAKEFILE.fiddle) "
- "$(EXPORTED_FUNCTIONS.fiddle) "
- "$(fiddle.cses) $(pre-post-fiddle-module-vanilla.deps) "
- "$(SOAP.js)\n",
- zTail, (i ? " $(fiddle-module.js)" : ""));
- if( 1==i ){/*fiddle.debug*/
- pf("\t@test -d \"$(dir $@)\" || mkdir -p \"$(dir $@)\"\n");
- }
- pf("\t$(bin.emcc) -o $@ $(fiddle.emcc-flags%s) "
- "$(pre-post-fiddle-module-vanilla.flags) $(fiddle.cses)\n",
- zTail);
- ps("\t@chmod -x $(basename $@).wasm");
- pf("\t@$(call b.do.wasm-strip,%s)\n", zBuildName);
- ps("\t@$(call SQLITE.strip-emcc-js-cruft,NAME_GOES_HERE)");
- pf("\t@cp -p $(SOAP.js) $(dir $@)\n");
- if( 1==i ){/*fiddle.debug*/
- pf("\tcp -p $(dir.fiddle)/index.html "
- "$(dir.fiddle)/fiddle.js "
- "$(dir.fiddle)/fiddle-worker.js "
- "$(dir $@)\n");
- }
- /* Compress fiddle files. We handle each file separately, rather
- than compressing them in a loop in the previous target, to help
- avoid that hand-edited files, like fiddle-worker.js, do not end
- up with stale .gz files (which althttpd will then serve instead
- of the up-to-date uncompressed one). */
- pf("%s/fiddle-module.js.gz: %s/fiddle-module.js\n", zDir, zDir);
- ps("\tgzip < $< > $@");
- pf("%s/fiddle-module.wasm.gz: %s/fiddle-module.wasm\n", zDir, zDir);
- ps("\tgzip < $< > $@");
- pf("fiddle%s: %s/fiddle-module.js.gz %s/fiddle-module.wasm.gz\n",
- i ? "-debug" : "", zDir, zDir);
- if( 0==i ){
- ps("fiddle: $(fiddle-module.js)");
- }else{
- ps("fiddle-debug: $(fiddle-module.js.debug)");
- }
- pf("# End fiddle%s%s", zTail, zBanner);
- }
+static char const * BuildDef_basename(const BuildDef * pB){
+ return pB->zBaseName ? pB->zBaseName : oBuildDefs.vanilla.zBaseName;
+}
+
+static void emit_core_vars(char const *zBuildName,
+ const BuildDef * pB){
+ const char * zJsExt = BuildDef_jsext(pB);
+ char const * const zBaseName = BuildDef_basename(pB);
+ pf("dir.dout.%s ?= $(dir.dout)/%s\n", zBuildName, zBuildName);
+ pf("out.%s.base ?= $(dir.dout.%s)/%s\n",
+ zBuildName, zBuildName, zBaseName);
+ pf("out.%s.js ?= $(dir.dout.%s)/%s%s\n",
+ zBuildName, zBuildName, zBaseName, zJsExt);
+ pf("out.%s.wasm ?= $(dir.dout.%s)/%s.wasm\n",
+ //"$(basename $@).wasm"
+ zBuildName, zBuildName, zBaseName);
}
-#endif
/*
** Emits makefile code for one build of the library.
/* The various targets named X.js or X.mjs also generate X.wasm,
** and we need that part of the name to perform some
** post-processing after Emscripten generates X.wasm. */;
- const char * zJsExt = (F_ESM & pB->flags)
- ? ".mjs" : ".js";
- char const * const zBaseName = pB->zBaseName
- ? pB->zBaseName : oBuildDefs.vanilla.zBaseName;
+ const char * zJsExt = BuildDef_jsext(pB);
+ char const * const zBaseName = BuildDef_basename(pB);
assert( oBuildDefs.vanilla.zEnv );
assert( zBaseName );
pf("# zCmppD=%s\n# zBaseName=%s\n",
pB->zCmppD ? pB->zCmppD : "", zBaseName);
- pf("logtag.%s = [%s %s $@]:\n", zBuildName, pB->zEmo, zBuildName);
+ pf("logtag.%s ?= [%s %s $@]:\n", zBuildName, pB->zEmo, zBuildName);
if( pB->zIfCond ){
pf("%s\n", pB->zIfCond );
}
pf("$(info $(logtag.%s) Setting up target b-%s)\n",
zBuildName, zBuildName );
+ emit_core_vars(zBuildName, pB);
pf("dir.dout.%s ?= $(dir.dout)/%s\n", zBuildName, zBuildName);
- pf("out.%s.base = $(dir.dout.%s)/%s\n",
+ pf("out.%s.base ?= $(dir.dout.%s)/%s\n",
zBuildName, zBuildName, zBaseName);
- pf("out.%s.js = $(dir.dout.%s)/%s%s\n",
+ pf("out.%s.js ?= $(dir.dout.%s)/%s%s\n",
zBuildName, zBuildName, zBaseName, zJsExt);
- pf("out.%s.wasm = $(dir.dout.%s)/%s.wasm\n",
+ pf("out.%s.wasm ?= $(dir.dout.%s)/%s.wasm\n",
//"$(basename $@).wasm"
zBuildName, zBuildName, zBaseName);
- pf("c-pp.D.%s = %s\n", zBuildName, pB->zCmppD ? pB->zCmppD : "");
- pf("emcc.environment.%s = %s\n", zBuildName,
+ pf("c-pp.D.%s ?= %s\n", zBuildName, pB->zCmppD ? pB->zCmppD : "");
+ pf("emcc.environment.%s ?= %s\n", zBuildName,
pB->zEnv ? pB->zEnv : oBuildDefs.vanilla.zEnv);
- pf("emcc.flags.%s = %s\n", zBuildName, pB->zEmcc ? pB->zEmcc : "");
+ pf("emcc.flags.%s ?= %s\n", zBuildName, pB->zEmcc ? pB->zEmcc : "");
{ /* Create sqlite3-api.*.js */
pf("sqlite3-api.%s.c-pp.js = $(dir.tmp)/sqlite3-api.%s.c-pp%s\n",
zBuildName, zBuildName);
}
- mk_pre_post(zBuildName, pB);
+ mk_pre_post(zBuildName);
{ /* build it... */
pf(zBanner
"\n",
zBuildName, zBuildName, zBuildName);
- pf("\t@echo '$(logtag.%s) $(emo.compile) building $@ ...'\n"
+ pf("\t@echo '$(logtag.%s) $(emo.compile) building ...'\n"
"\t@mkdir -p $(dir $@);\n",
zBuildName);
pf("\t@echo '$(logtag.%s) $(emo.fire)$(emo.fire)$(emo.fire): "
"unsupported build. Use at your own risk.'\n", zBuildName);
}
- pf("\t$(emcc.squelch)$(call b.do.emcc,%s)\n", zBuildName);
+ pf("\t$(cmd.loud)$(call b.do.emcc,%s)\n", zBuildName);
{ /* Post-compilation transformations and copying to
$(dir.dout)... */
pf("# End build [%s]%s", zBuildName, zBanner);
}
+/*
+** Emits rules for the fiddle builds.
+*/
+void mk_fiddle(void){
+ //BuildDef bdF = oBuildDefs.vanilla;
+
+ //mk_pre_post("fiddle-module");
+ //mk_pre_post("fiddle-module.debug");
+ pf("emo.fiddle = 🎻\n");
+ for(int i = 0; i < 2; ++i ){
+ /* 0==normal, 1==debug */
+ int const isDebug = i>0;
+ const char * const zBuildName = i ? "fiddle.debug" : "fiddle";
+ //const char *zDir = i ? "$(dir.fiddle-debug)" : "$(dir.fiddle)";
+
+ pf("%s# Begin %s\n", zBanner, zBuildName);
+ if( isDebug ){
+ pf("emo.%s = $(emo.fiddle)$(emo.bug)\n", zBuildName);
+ }
+ pf("logtag.%s ?= [$(emo.%s) %s $@]:\n",
+ zBuildName, zBuildName, zBuildName);
+ pf("$(info $(logtag.%s) Setting up target %s)\n",
+ zBuildName, zBuildName );
+
+ //bdF.zBaseName = "fiddle-module";
+ //bdF.zEmcc = i ? "$(fiddle.emcc-flags.debug)" : "$(fiddle.emcc-flags)";
+
+ pf("dir.%s = %s\n"
+ "out.%s.js = $(dir.%s)/fiddle-module.js\n"
+ "out.%s.wasm = $(dir.%s)/fiddle-module.wasm\n"
+ "$(out.%s.wasm): $(out.%s.js)\n",
+ zBuildName, zBuildName,
+ zBuildName, zBuildName,
+ zBuildName, zBuildName,
+ zBuildName, zBuildName);
+
+ {/* emcc */
+ pf("$(out.%s.js): $(MAKEFILE_LIST) $(MAKEFILE.fiddle) "
+ "$(EXPORTED_FUNCTIONS.fiddle) "
+ "$(fiddle.cses) %s "
+ "$(SOAP.js)\n",
+ zBuildName,
+ (i ? " $(out.fiddle.js)" : ""));
+ pf("\t@echo '$(logtag.%s) $(emo.compile) building ...'\n",
+ zBuildName);
+ if( isDebug ){
+ pf("\t@test -d \"$(dir $@)\" || mkdir -p \"$(dir $@)\"\n");
+ }
+ pf("\t$(bin.emcc) -o $@ $(emcc.flags.%s) "
+ /* emcc.flags.X is set in fiddle.make */
+ //"$(pre-post-fiddle-module.flags) "
+ "$(fiddle.cses)\n",
+ zBuildName);
+ pf("\t@chmod -x $(out.%s.wasm)\n", zBuildName);
+ pf("\t@$(call b.do.wasm-strip,%s)\n", zBuildName);
+ pf("\t@$(call SQLITE.strip-emcc-js-cruft,$(logtag.%s))\n",zBuildName);
+ pf("\t@cp -p $(SOAP.js) $(dir $@)\n");
+ if( isDebug ){
+ ps("\tcp -p $(dir.fiddle)/index.html "
+ "$(dir.fiddle)/fiddle.js "
+ "$(dir.fiddle)/fiddle-worker.js "
+ "$(dir $@)");
+ }
+ }
+ if( !isDebug ){
+ pf("all: $(out.%s.wasm)\n", zBuildName);
+ }
+
+ /* Compress fiddle files. We handle each file separately, rather
+ than compressing them in a loop in the previous target, to help
+ avoid that hand-edited files, like fiddle-worker.js, do not end
+ up with stale .gz files (which althttpd will then serve instead
+ of the up-to-date uncompressed one). */
+ pf("\n$(out.%s.js).gz: $(out.%s.js)\n"
+ "\tgzip < $< > $@\n", zBuildName, zBuildName);
+ pf("\n$(out.%s.wasm).gz: $(out.%s.wasm)\n"
+ "\tgzip < $< > $@\n", zBuildName, zBuildName);
+
+ pf("\n%s: $(out.%s.js).gz $(out.%s.wasm).gz\n",
+ zBuildName, zBuildName, zBuildName);
+ if( isDebug ){
+ ps("fiddle-debug: fiddle.debug");
+ }
+ pf("# End %s%s", zBuildName, zBanner);
+ }
+}
+
int main(void){
int rc = 0;
const BuildDef *pB;
"b-esm: $(dir.dout)/sqlite3.mjs\n"
"b-esm64: $(dir.dout)/sqlite3-64bit.mjs\n"
);
-#if 0
mk_fiddle();
+#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",
-C Get\smost\sof\sthe\swasm\sbuild\s(re)working\sand\smuch\sprettier.
-D 2025-09-23T13:49:44.420
+C Get\sfiddle/fiddle.debug\sbuilding\sagain\sbut\sthey're\sincomplete\sand\sdon't\srun.
+D 2025-09-23T23:22:31.489
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 7bd5b216a66af20f18515bb3668330e3834bf2dd562c26c40775bd0d95610680
+F ext/wasm/GNUmakefile 2beb7f3ebf6dc671e08a0e1cadb3bce1f2a598bf148c9a05b039ac1c2c873c11
F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
F ext/wasm/README.md 66ace67ae98a45e4116f2ca5425b716887bcee4d64febee804ff6398e1ae9ec7
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
F ext/wasm/demo-worker1.js 08720227e98fa5b44761cf6e219269cee3e9dd0421d8d91459535da776950314
F ext/wasm/dist.make 57f5da2f0de5a297b5a0bc39ffec736380050578240ab24d864c2ff1b3634a3b
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
-F ext/wasm/fiddle.make 7ed14ba851d331b62ea9ddfcdb62184ff853c5620c3856631310ca0f9633ef93
+F ext/wasm/fiddle.make c3ecfae3328526c8048cbd2e71888bebe2a438077268e9a8f2e302d33db91e4d
F ext/wasm/fiddle/fiddle-worker.js 7798af02e672e088ff192716f80626c8895e19301a65b8af6d5d12b2d13d2451
F ext/wasm/fiddle/fiddle.js 84fd75967e0af8b69d3dd849818342227d0f81d13db92e0dcbc63649b31a4893
F ext/wasm/fiddle/index.html a27b8127ef9ecf19612da93b2a6a73bdb3777b5c56b5450bb7200a94bc108ff9
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 d90795491b85a79d63d6087a6725fc99623eb5ac56510998001b7687ec1c110c
+F ext/wasm/mkwasmbuilds.c 0e9dbc039423f9542cecaf02b183866b7687bcf6ee85df0bb3e3bd9714846928
F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337
F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96
F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63
F ext/wasm/speedtest1-wasmfs.html 0e9d335a9b5b5fafe6e1bc8dc0f0ca7e22e6eb916682a2d7c36218bb7d67379d
F ext/wasm/speedtest1-wasmfs.mjs c77c7231338ed5c0e1ce16aa29106df8e5b5cf11a48319c49433490a8d3ded30
-F ext/wasm/speedtest1-worker.html d24d1e06caf3dcd83430c8c3d87761ff7555fd06eaeaf2fc02ce49cf45f0d032
+F ext/wasm/speedtest1-worker.html 068d4190f304fa1c34e6501a1b3a4c32fe8d8dac93c2d0f53d667a1cb386eedc
F ext/wasm/speedtest1-worker.js 5b7eba7cdb5239768e1ed61edb046df8e0092e6c9d6e0bc76e51536022bdccb9
F ext/wasm/speedtest1.html e2a0e0bd12243ca34b11235bf9f3c229f4574ea1125f2ecf2bf0589853d6f9c8
F ext/wasm/split-speedtest1-script.sh a3e271938d4d14ee49105eb05567c6a69ba4c1f1293583ad5af0cd3a3779e205 x
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 4d7eff2afbcf023291bc1133c4413d1ea44f4096bb515e4bcd40bc8fc8d2a591
-R e8886245b28a331e670aa538541aa363
+P a5a7890c75003a637a227b700dc342f4f4a24bd368b216bdb168b4ddfbe8f015
+R bfaea347066be5eee8c06be83934df87
U stephan
-Z 82e89b29e3b7887e8b71ff36239b271d
+Z b32fd3d4dde2ccaa5319fc2bd82bfb84
# Remove this line to create a well-formed Fossil manifest.