Commit Graph

7 Commits

Author SHA1 Message Date
Darryl L. Miles f2c77ad927 build: nested-child Makefile.in use @srcdir@
Switch the 5 nested children (scmos/cif_template, doc/man, doc/tutcells,
doc/html, doc/latexfiles) to configure-provided substitution:
  srcdir   = @srcdir@
  VPATH    = @srcdir@
  MAGICDIR = @top_builddir@   (resolves to ../.. for these nested dirs)

Verified out-of-tree: full `make` rc=0; cif_template gets
srcdir=<src>/scmos/cif_template, doc/latexfiles MAGICDIR=../..; scmos
techs + 27/28 docs build.

With this, every module except readline/ is a configure-generated
Makefile.in using @srcdir@ substitution.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 14:54:11 -04:00
Darryl L. Miles d2650e4833 build: convert nested children + rewire parent recursion to native
Convert the last nested children to Makefile.in and switch their parents
from the -f fallback to native recursion (they now have generated build
Makefiles).  Rename and rewire are one unit: a pure rename would break the
parent's -f path to the (now-.in) child.

Converted (5): scmos/cif_template, doc/man, doc/tutcells, doc/html,
doc/latexfiles.  Pure renames -- still build via the srcdir derivation;
@srcdir@ substitution follows.

Rewired to native `make -C <child>` (config.status now creates the child
build dirs + Makefiles):
* scmos/Makefile.in: cif_template build + clean.
* doc/Makefile.in: install/install-tcl over man/tutcells/html/latexfiles.
* Makefile.in: the docs: target -> `make -k -C doc/latexfiles all`.
The `mkdir -p` and `-f ${MAGICSRC}/.../Makefile` are dropped in each.

* configure.in: AC_CONFIG_FILES for the 5 children; regenerated configure.
* .gitignore: ignore each generated child Makefile, same commit.

Verified out-of-tree: full `make && make install` rc=0, 376 files --
scmos recurses natively into cif_template (8 objs), docs regenerate via
native doc/latexfiles (27/28), man pages install via native doc/man.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 14:54:11 -04:00
Darryl L. Miles 4e967a4766 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-26 14:54:11 -04:00
Torleif Skår f76826eff8 cif_templates: Fix Makefile race condition with objs directory creation
Fixes racy-ness seen intermittently when building,
where the objs folder doesn't exist when
targets try to write to it.
2025-07-27 12:53:02 -04:00
Ryan Schmidt 4c4b0e301b Resolve -Wcomment warnings
Resolve -Wcomment warnings like:

./cifin-cmos14b.gen:2:1: warning: '/*' within block comment [-Wcomment]
2022-04-13 08:33:45 -04:00
Tim Edwards da7cc2096d Missed a number of Makefiles in directories two levels down. 2020-01-28 13:10:31 -05:00
Tim Edwards 231a299b16 Initial commit at Tue Apr 25 08:41:48 EDT 2017 by tim on stravinsky 2017-04-25 08:41:48 -04:00