Minor tweaks in mkwasmbuilds.c.

FossilOrigin-Name: cee43280727435440b9e01b302a790a1a102aea930bc821ebc737ea519458cef
This commit is contained in:
stephan 2024-09-24 13:00:21 +00:00
parent 88c43ce1f6
commit d2917d9f69
3 changed files with 34 additions and 30 deletions

View File

@ -47,13 +47,36 @@
#define JS_BUILD_MODES vanilla esm bundler-friendly node
static const char * zBanner =
"\n########################################################################\n";
/*
** Emits common vars needed by the rest of the emitted code (but not
** needed by makefile code outside of these generated pieces).
*/
static void mk_prologue(void){
pf("%s", zBanner);
ps("# extern-post-js* and extern-pre-js* are files for use with");
ps("# Emscripten's --extern-pre-js and --extern-post-js flags.");
ps("extern-pre-js.js := $(dir.api)/extern-pre-js.js");
ps("extern-post-js.js.in := $(dir.api)/extern-post-js.c-pp.js");
ps("# Emscripten flags for --[extern-][pre|post]-js=... for the");
ps("# various builds.");
ps("pre-post-common.flags := --extern-pre-js=$(sqlite3-license-version.js)");
ps("# pre-post-jses.deps.* = a list of dependencies for the");
ps("# --[extern-][pre/post]-js files.");
ps("pre-post-jses.deps.common := $(extern-pre-js.js) $(sqlite3-license-version.js)");
}
/*
** 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.
*/
static void mk_pre_post(const char *zName, const char *zMode){
static void mk_pre_post(const char *zName /* build name */,
const char *zMode /* build mode */,
const char *zCmppD /* optional -D flags for c-pp for the
** --pre/--post-js files. */){
pf("%s# Begin --pre/--post flags for %s-%s\n", zBanner, zName, zMode);
pf("c-pp.D.%s-%s := %s\n", zNM, zCmppD ? zCmppD : "");
pf("pre-post-%s-%s.flags ?=\n", zNM);
/* --pre-js=... */
@ -110,24 +133,6 @@ static void mk_pre_post(const char *zName, const char *zMode){
pf("# End --pre/--post flags for %s-%s%s", zName, zMode, zBanner);
}
/*
** Emits common vars needed by the rest of the emitted code (but not
** needed by code outside of these generated pieces).
*/
static void mk_prologue(void){
pf("%s", zBanner);
ps("# extern-post-js* and extern-pre-js* are files for use with");
ps("# Emscripten's --extern-pre-js and --extern-post-js flags.");
ps("extern-pre-js.js := $(dir.api)/extern-pre-js.js");
ps("extern-post-js.js.in := $(dir.api)/extern-post-js.c-pp.js");
ps("# Emscripten flags for --[extern-][pre|post]-js=... for the");
ps("# various builds.");
ps("pre-post-common.flags := --extern-pre-js=$(sqlite3-license-version.js)");
ps("# pre-post-jses.deps.* = a list of dependencies for the");
ps("# --[extern-][pre/post]-js files.");
ps("pre-post-jses.deps.common := $(extern-pre-js.js) $(sqlite3-license-version.js)");
}
/*
** Emits makefile code for one build of the library, primarily defined
** by the combination of zName and zMode, each of which must be values
@ -150,8 +155,7 @@ static void mk_lib_mode(const char *zName /* build name */,
pf("%s# Begin build [%s-%s]\n", zBanner, zNM);
pf("ifneq (1,$(MAKING_CLEAN))\n");
pf("$(info Setting up build [%s-%s]: %s)\n", zNM, zJsOut);
pf("c-pp.D.%s-%s := %s\n", zNM, zCmppD);
mk_pre_post(zNM);
mk_pre_post(zNM, zCmppD);
pf("\nemcc.flags.%s.%s ?=\n", zNM);
if( zEmcc[0] ){
pf("emcc.flags.%s.%s += %s\n", zNM, zEmcc);
@ -225,7 +229,7 @@ int main(void){
"$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs",
"-sEXPORT_ES6 -sUSE_ES6_IMPORT_META");
mk_pre_post("speedtest1","vanilla");
mk_pre_post("speedtest1-wasmfs","esm");
mk_pre_post("speedtest1","vanilla", 0);
mk_pre_post("speedtest1-wasmfs","esm", 0);
return rc;
}

View File

@ -1,5 +1,5 @@
C Wasm\sbuild\scleanups.\sFix\sthe\swasm\sspeedtest1\sbuilds\sbroken\sby\syesterday's\srefactoring.
D 2024-09-24T12:16:05.567
C Minor\stweaks\sin\smkwasmbuilds.c.
D 2024-09-24T13:00:21.657
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -661,7 +661,7 @@ F ext/wasm/index-dist.html 564b5ec5669676482c5a25dea9e721d8eafed426ecb155f93d29a
F ext/wasm/index.html 4337f495416756802669f69f9f9f3df9f87ee4c1918e6718719b4b5718e4713a
F ext/wasm/jaccwabyt/jaccwabyt.js 1264710db3cfbcb6887d95665b7aeba60c1126eaef789ca4cf1a4a17d5bc7f54
F ext/wasm/jaccwabyt/jaccwabyt.md 59a20df389abcc3606eb4eaea7fb7ba14504beb3e345dbea9b99a0618ba3bec8
F ext/wasm/mkwasmbuilds.c c8906d4e54c605d8cddfce36f62723d6f0e89c3813ecebec9fec4a3fcb952003
F ext/wasm/mkwasmbuilds.c cd280876e43fb7d9a1bd55c55af9428304227885016f94c45c50ea97d98c0c2a
F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337
F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96
F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63
@ -2211,8 +2211,8 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 3b72a143431537ec275aefae739e56330c1d445c9ea80885882a2b9aa2201179
R 04e34f9a24dc7d45d5d906b5bbfab195
P 5d4a090230d1d7609e70b9c28d662dc8b0f8dd4d70a254f3ce6e449c68a25897
R a76d989228adf2ea2f12f585c2ad0411
U stephan
Z acb2af67fc0175d67098e0add512a294
Z 9712f926f8fbe47c6917bc9e17888ee6
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
5d4a090230d1d7609e70b9c28d662dc8b0f8dd4d70a254f3ce6e449c68a25897
cee43280727435440b9e01b302a790a1a102aea930bc821ebc737ea519458cef