magic/tcltk/Makefile.in

121 lines
3.8 KiB
Makefile
Raw Normal View History

#
# rcsid $Header: /usr/cvsroot/magic-8.0/tcltk/Makefile,v 1.6 2010/06/24 12:37:56 tim Exp $
#
MODULE = tcltk
# Provided by configure: the module's source dir + the build top.
# defs.mak sees `srcdir` already set and skips its own srcdir derivation.
srcdir = @srcdir@
VPATH = @srcdir@
MAGICDIR = @top_builddir@
SRCS = tclmagic.c
OBJS = $(subst .c,.o,${SRCS})
include ${MAGICDIR}/defs.mak
DFLAGS += -DMAGIC_DATE="\"`date`\""
CLEANS += magic.sh magic.tcl magicexec magicdnull ext2spice.sh ext2sim.sh
TCL_FILES = \
tkcon.tcl \
tkshell.tcl \
wrapper.tcl \
toolbar.tcl \
reorderLayers.tcl \
console.tcl \
techbuilder.tcl \
cellmgr.tcl \
drcmgr.tcl \
libmgr.tcl \
texthelper.tcl \
tools.tcl \
mazeroute.tcl \
strip_reflibs.tcl \
toolkit.tcl \
toolkit_rev0.tcl \
bsitools.tcl \
socketcmd.tcl \
readspice.tcl \
magic.tcl
BIN_FILES = \
$(DESTDIR)${INSTALL_BINDIR}/magic.sh \
$(DESTDIR)${INSTALL_BINDIR}/ext2spice.sh \
$(DESTDIR)${INSTALL_BINDIR}/ext2sim.sh
tcl-main: magicexec magicdnull magic.tcl magic.sh ext2spice.sh ext2sim.sh
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
# In the WASM build the tcltk module ships only as libtcltk.o; there is no
# wish-like launcher binary, no magic.sh, etc. `make mains` iterates over
# PROGRAMS which now includes tcltk (because --with-tcl is on), so define a
# no-op `main` to keep that loop happy. The native build still uses tcl-main
# via `make all` → tcllibrary.
ifeq (${MAKE_WASM},1)
main:
@:
endif
install-tcl: magicexec magicdnull ${BIN_FILES} ${TCL_FILES}
${RM} $(DESTDIR)${INSTALL_TCLDIR}/magicexec
${CP} magicexec $(DESTDIR)${INSTALL_TCLDIR}/magicexec
${RM} $(DESTDIR)${INSTALL_TCLDIR}/magicdnull
${CP} magicdnull $(DESTDIR)${INSTALL_TCLDIR}/magicdnull
(cd $(DESTDIR)${INSTALL_TCLDIR}; ${RM} ${TCL_FILES})
for i in ${TCL_FILES}; do \
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
f=$$i; test -f $$f || f=$(srcdir)/$$i; \
${CP} $$f $(DESTDIR)${INSTALL_TCLDIR}; done
(cd $(DESTDIR)${INSTALL_TCLDIR}; chmod 0755 tkcon.tcl tkshell.tcl)
magicexec: magicexec.c ${MAGICDIR}/defs.mak
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} $< \
-o magicexec ${LD_RUN_PATH} ${LD_FIRST_LIBS} ${LIB_SPECS_NOSTUB} ${ZLIB_FLAG} \
${LIBS} ${GR_LIBS}
magicdnull: magicdnull.c ${MAGICDIR}/defs.mak
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} $< \
-o magicdnull ${LD_RUN_PATH} ${LD_FIRST_LIBS} ${LIB_SPECS_GRNULL} ${ZLIB_FLAG} \
${LIBS}
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
magic.tcl: magic.tcl.in ${MAGICDIR}/defs.mak ${MAGICSRC}/VERSION
${SED} -e /MAGIC_VERSION/s%MAGIC_VERSION%${MAGIC_VERSION}%g \
-e /MAGIC_REVISION/s%MAGIC_REVISION%${MAGIC_REVISION}%g \
-e /MAGIC_COMMIT/s%MAGIC_COMMIT%${MAGIC_COMMIT}%g \
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
$< > magic.tcl
magic.sh: magic.sh.in ${MAGICDIR}/defs.mak
${SED} -e /TCL_DIR/s%TCL_DIR%${TCLDIR}%g \
-e /TCLLIB_DIR/s%TCLLIB_DIR%${TCL_LIB_DIR}%g \
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
-e /WISH_EXE/s%WISH_EXE%${WISH_EXE}%g $< > magic.sh
ext2spice.sh: ext2spice.sh.in ${MAGICDIR}/defs.mak
${SED} -e /TCL_DIR/s%TCL_DIR%${TCLDIR}%g \
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
$< > ext2spice.sh
ext2sim.sh: ext2sim.sh.in ${MAGICDIR}/defs.mak
${SED} -e /TCL_DIR/s%TCL_DIR%${TCLDIR}%g \
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
$< > ext2sim.sh
$(DESTDIR)${INSTALL_TCLDIR}/%: %
${RM} $(DESTDIR)${INSTALL_TCLDIR}/$*
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
${CP} $< $(DESTDIR)${INSTALL_TCLDIR}/$*
$(DESTDIR)${INSTALL_BINDIR}/magic.sh: magic.sh
${RM} $(DESTDIR)${INSTALL_BINDIR}/magic.sh $(DESTDIR)${INSTALL_BINDIR}/magic
${CP} magic.sh $(DESTDIR)${INSTALL_BINDIR}/magic
(cd $(DESTDIR)${INSTALL_BINDIR}; chmod 0755 magic)
$(DESTDIR)${INSTALL_BINDIR}/ext2spice.sh: ext2spice.sh
${RM} $(DESTDIR)${INSTALL_BINDIR}/ext2spice
${CP} ext2spice.sh $(DESTDIR)${INSTALL_BINDIR}/ext2spice
(cd $(DESTDIR)${INSTALL_BINDIR}; chmod 0755 ext2spice)
$(DESTDIR)${INSTALL_BINDIR}/ext2sim.sh: ext2sim.sh
${RM} $(DESTDIR)${INSTALL_BINDIR}/ext2sim
${CP} ext2sim.sh $(DESTDIR)${INSTALL_BINDIR}/ext2sim
(cd $(DESTDIR)${INSTALL_BINDIR}; chmod 0755 ext2sim)
# An additional dependency on the VERSION file
build: out-of-tree outlier Makefiles — full make + install Fix the remaining non-standard Makefiles so a full out-of-tree `../configure && make && make install` builds and installs a complete magic TCL tree, sources read from the source tree, all outputs in the build tree. Shared linker/preprocessor paths (scripts/configure.in, regenerated scripts/configure): * --version-script=${MAGICDIR}/magic/symbol.map -> ${MAGICSRC}/... so every shared-library link (tclmagic.so, ...) finds the source map. * MCPP preproc.py path ${MAGICDIR}/scripts -> ${MAGICSRC}/scripts. Programs (built via tcllibrary, PROGRAMS = magic tcltk): * magic/Makefile: proto.magicrc, magicWasm.o and the bitmaps/.initrc/ magicps.pro install copies use $< / $(srcdir) instead of bare names. * tcltk/Makefile: magicexec/magicdnull compile $<; the sed'd launcher scripts (magic.tcl/.sh, ext2spice.sh, ext2sim.sh) read $<; VERSION dep -> ${MAGICSRC}; install-tcl copies each TCL file from the build dir if present else $(srcdir) (magic.tcl is generated, the rest are source). Techs (scmos): * scmos/Makefile: SC_PP template include -> $(srcdir)/extract_template; tech-file inputs (scmos.tech.in, *.tech.in) via $(srcdir)/$< ; recurse into cif_template with mkdir + -f ${MAGICSRC}/scmos/cif_template/Makefile; install copies from build-or-$(srcdir). * scmos/cif_template/Makefile: MKDIR -> ${MAGICSRC}/scripts/mkdirs; SC_CPP gains -I$(srcdir); cpp reads $(srcdir)/cif{in,out}.c so the .gen includes resolve; objs/ generated in the build tree. Data-file installs (source files copied from $(srcdir)): * graphics/Makefile: glyphs, outline fonts, and the X11 helper build. * windows/Makefile: glyphs and vector fonts. * doc/Makefile: recurse into man/tutcells/html/latexfiles build-aware; doc/man, doc/tutcells install with $< ; doc/html tars $(srcdir); doc/latexfiles reads pre-built PostScript from ${MAGICSRC}/doc/psfiles. Verified out-of-tree (mkdir _build; cd _build; ../configure): `make` returns rc=0 (33 module libs, tclmagic.so, magicexec/magicdnull, scmos tech files + cif_template objs, proto.magicrc), and `make install DESTDIR=...` returns rc=0 installing 376 files (bin/magic, tcl/tclmagic.so, sys/ glyphs+fonts+techs+dstyles), with the source tree left completely clean. Not exercised by the default TCL build/install and therefore not converted here: the standalone .so/program variants of lef/plot/router/ext2spice/ext2sim (their module libs do build), the disabled oa module (-I. -> -I$(srcdir) still needed if enabled), the WASM path, and doc/latexfiles PostScript *regeneration* (which still writes into the source psfiles dir). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:59:44 +02:00
${OBJS}: ${MAGICSRC}/VERSION
include ${MAGICDIR}/rules.mak