magic/toolchains/emscripten/defs.mak

74 lines
4.0 KiB
Makefile
Raw Normal View History

Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
# WASM-specific make additions — append to the configure-generated defs.mak.
#
# Usage (matches what the CI workflow does):
#
# source <emsdk>/emsdk_env.sh
# CFLAGS="--std=c17 -D_DEFAULT_SOURCE=1 -DEMSCRIPTEN=1 -g" \
# LDFLAGS="-gsource-maps" \
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
# emconfigure ./configure --without-cairo --without-opengl --without-x \
# --without-tk --without-tcl \
# --disable-readline --disable-compression \
# --target=asmjs-unknown-emscripten
# cat toolchains/emscripten/defs.mak >> defs.mak
# emmake make depend
# emmake make -j$(nproc) modules libs
# emmake make techs
# emmake make mains
# Activate the WASM link target in magic/Makefile.
MAKE_WASM = 1
# Preserve DWARF debug info through emcc -r (partial-link) steps.
# Without -g, emcc -r defaults to GENERATE_DWARF=0, which causes building.py
# to add --strip-debug to wasm-ld, discarding the DWARF produced by -g in
# CFLAGS. That leaves magic.wasm without debug sections, making -gsource-map
# produce an empty source map at the final link.
LINK = $(LD) -r $(LDFLAGS)
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
# Emscripten linker flags.
#
# INCOMING_MODULE_JS_API is emscripten's default list plus `wasmBinary`.
# Our JS loaders (npm/examples/*.js) pass Module.wasmBinary to embed the .wasm,
# but emscripten 6.0.2 dropped wasmBinary (and a batch of GL/SDL members) from
# the default INCOMING_MODULE_JS_API. With ASSERTIONS=1 that turns into a hard
# runtime abort: "`Module.wasmBinary` was supplied but `wasmBinary` not included
# in INCOMING_MODULE_JS_API". We spell out the full default list (so external
# consumers passing locateFile/arguments/etc. keep working) and re-add
# wasmBinary. Keep this in sync with emscripten's default if it grows.
#
# The link step runs from the magic/ build subdirectory. Embed-file inputs
# must name the *right tree*: generated data (the scmos tech files, produced by
# `make techs`) lives in the build tree, so use ${MAGICDIR} (the build top);
# verbatim data (the window glyphs, shipped as source) lives in the source tree,
# so use ${MAGICSRC}. In-tree the two coincide.
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
TOP_EXTRA_LIBS += \
${TOP_FIRST_LIBS_WASM} \
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
-sWASM=1 \
-sMODULARIZE=1 \
-sEXPORT_ES6=1 \
Add TCL-embedded WASM build variant alongside the existing non-TCL build Bump VERSION to 8.3.645. magic.wasm can now be built as two variants packaged in the same npm release: notcl/ (legacy, magic's own parser) and tcl/ (intubun/tcl 9.x statically linked, commands evaluated by Tcl_EvalEx). The TCL fork is pinned via npm/tcl.ref and cloned/built by magic itself — the tcl/ checkout is treated as read-only and built out-of-source into magic/build-tcl-wasm/. Configure layer: - New usingTk variable decoupled from usingTcl in scripts/configure.in + scripts/configure, so --with-tcl --without-tk is finally a valid combination. Native Linux Tcl+Tk builds keep their previous behaviour (both flags default to enabled). - When usingTk is empty, configure passes -DMAGIC_NO_TK so the small number of remaining Tk callsites in tcltk/tclmagic.{h,c} compile out, and TKCOMMON_SRCS / USE_TK_STUBS are omitted from the link. WASM build orchestration: - toolchains/emscripten/build-tcl-wasm.sh builds libtcl9.x.a + libtclstub.a + tclConfig.sh out-of-source from a pristine intubun/tcl checkout. - npm/build.sh grew a --variant=<tcl|notcl|both> flag and writes its outputs into npm/tcl/ and npm/notcl/. It also clones intubun/tcl with autocrlf=false at the SHA pinned by npm/tcl.ref. - magic/Makefile (WASM block only): magicWasm.o is now compiled with DFLAGS_NOSTUB so Tcl_CreateInterp resolves to libtcl9.x directly before tclStubsPtr is set. magic.js link pulls in LIB_SPECS_NOSTUB and -ltclstub. After rules.mak include, magic: is a phony alias for magic.js so the generic ${MODULE} recipe doesn't fight it. - toolchains/emscripten/defs.mak: add -sUSE_ZLIB=1 (libtcl9 references zlib), replace -sSTACK_SIZE=N with -Wl,-z,stack-size=N (emcc >=5 rejects the setting form). - magic/magicWasm.c bootstraps the embedded interp under MAGIC_WRAPPER (Tcl_CreateInterp -> Tcl_Init -> Tclmagic_Init) and routes run_command through Tcl_EvalEx. - magic/magicTop.c: gate MagicVersion/Revision/CompileTime on !MAGIC_WRAPPER so they don't collide with the copies in tcltk/tclmagic.c when both objects land in the same wasm binary. npm package: - Subpath exports: ".", "./tcl", "./notcl". Default import keeps the pre-existing non-TCL behaviour for backward compatibility. - examples/smoke-tcl.mjs exercises the TCL variant. CI: - main-wasm.yml clones intubun/tcl at the pinned ref, builds both variants via npm/build.sh --variant=both, runs the existing notcl test suite and the new TCL smoke test, and publishes only on a v<x.y.z>... git tag. Tag name (minus the leading v) becomes the npm version.
2026-05-17 21:41:03 +02:00
-sUSE_ZLIB=1 \
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
-sEXPORTED_FUNCTIONS=_magic_wasm_init,_magic_wasm_run_command,_magic_wasm_source_file,_magic_wasm_update \
-sEXPORTED_RUNTIME_METHODS=cwrap,ccall,FS,setValue,getValue \
-sINCOMING_MODULE_JS_API=ENVIRONMENT,arguments,canvas,dynamicLibraries,elementPointerLock,instantiateWasm,locateFile,monitorRunDependencies,noExitRuntime,noInitialRun,onAbort,onExit,onRuntimeInitialized,postRun,preInit,preRun,print,printErr,setStatus,statusMessage,stderr,stdin,stdout,thisProgram,wasm,websocket,wasmBinary \
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
-sALLOW_MEMORY_GROWTH=1 \
-sINITIAL_MEMORY=67108864 \
-Wl,-z,stack-size=10485760 \
Add WASM entry point and Emscripten build wiring The pieces that make Magic actually buildable as a WASM library. * magic/magicWasm.c — new headless entry point exporting four functions used by the JS wrapper: - magic_wasm_init() idempotent initialisation - magic_wasm_run_command(s) dispatch one Magic command - magic_wasm_source_file(p) execute a script from the VFS - magic_wasm_update() drive a display-update cycle Sets CAD_ROOT=/ if unset, so embedded technology files under /magic/sys/ resolve correctly. Centers the command point inside GrScreenRect so commands route to the layout window client rather than the border/window-management client. * utils/main.c, utils/main.h — split magicMain() into magicMainInit() + the dispatch loop. magicMainInit is idempotent (a static flag guards against re-initialisation) so JS callers can call any of the four wasm entry points first without sequencing. * magic/Makefile — adds the WASM link target, gated by MAKE_WASM=1 set from toolchains/emscripten/defs.mak. Conditionally compiles magicWasm.c into the main binary, links to magic.js and runs post-build.sh on the result. * toolchains/emscripten/defs.mak — Emscripten linker flags (WASM=1, MODULARIZE, EXPORT_ES6, ALLOW_MEMORY_GROWTH, INITIAL_MEMORY=32M, STACK_SIZE=5M), the four EXPORTED_FUNCTIONS, and the embed-file bindings for the technology files under /magic/sys/. * toolchains/emscripten/post-build.sh — patches Emscripten's ESM output so it works in pure Node.js ESM: aliases require() through createRequire, injects __filename / __dirname shims, and resyncs the ___emscripten_embedded_file_data constant from the wasm global section if Emscripten emitted a stale value. Idempotent and pinned to emsdk 3.1.56 (see WARNING in the header). * toolchains/emscripten/README.md — full build documentation: quick-start via npm/build.sh, manual build, list of embedded files, exported C API, JavaScript usage example, and notes on CAD_ROOT, DISPLAY_SUSPEND, and the signal-API stubs. * .gitignore — adds the WASM artefacts (magic.js, magic.wasm, magic.symbols), tightens the editor/OS cruft list, and keeps toolchains/emscripten/defs.mak tracked despite the `defs.mak` ignore rule.
2026-05-04 13:31:41 +02:00
-sENVIRONMENT=node,web,worker \
-sFORCE_FILESYSTEM=1 \
${TOP_EXTRA_LIBS_WASM} \
--embed-file ${MAGICDIR}/scmos@/magic/sys/current \
--embed-file ${MAGICSRC}/windows/windows7.glyphs@/magic/sys/windows7.glyphs \
--embed-file ${MAGICSRC}/windows/windows7.glyphs@/magic/sys/bw.glyphs
# The ${MAGICDIR}/scmos dir embed above supplies the *generated* tech files, but a
# technology's "styles" section also needs the display styles + colour maps
2026-07-23 17:19:22 +02:00
# (scmos ${FILES}). Those are *source* files, so out of source they are not in
# the build tree and the embed misses them -- init then fails with "Couldn't open
# color map file mos.7bit.std.cmap" / "Cannot load technology". Embed each from
# the source tree into the same VFS dir. Match `mos.*dstyle` (no dot) so both the
# `.dstyle` files and mos.7bit.mraster_dstyle (an underscore, not a dot) are
# covered, plus the `mos.*.cmap` colour maps. $(wildcard) matches only files that
# exist, so it never lists a name that would break the link.
SCMOS_DISPLAY := $(wildcard ${MAGICSRC}/scmos/mos.*dstyle ${MAGICSRC}/scmos/mos.*.cmap)
TOP_EXTRA_LIBS += $(foreach f,$(SCMOS_DISPLAY),--embed-file $(f)@/magic/sys/current/$(notdir $(f)))