From 162db537d890079c61a98fe88ac901d0413e2bef Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Wed, 22 Jul 2026 18:31:10 +0000 Subject: [PATCH] build: magic/tcltk/scmos/doc/lisp Makefile.in use @srcdir@ Switch the 5 top-level outlier modules to configure-provided substitution (same template as the rest): srcdir = @srcdir@ VPATH = @srcdir@ MAGICDIR = @top_builddir@ Their custom rules and ${MAGICDIR}/${MAGICSRC} references keep working: ${MAGICDIR} = @top_builddir@ (build top), $(srcdir) now from @srcdir@. scmos/doc still recurse into their (static) children via -f. Verified out-of-tree: full `make` rc=0 -- magic gets srcdir=/magic, tclmagic.so + scmos techs + 27/28 docs build. Co-Authored-By: Claude Opus 4.8 (1M context) --- doc/Makefile.in | 6 +++++- lisp/Makefile.in | 6 +++++- magic/Makefile.in | 7 +++++-- scmos/Makefile.in | 7 +++++-- tcltk/Makefile.in | 6 +++++- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/doc/Makefile.in b/doc/Makefile.in index d611b2de..e43419b0 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -2,7 +2,11 @@ # makefile for Magic documentation # -MAGICDIR = .. +# 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@ PSDIR = psfiles include ${MAGICDIR}/defs.mak diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 3cf97029..9816f644 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -3,7 +3,11 @@ # MODULE = lisp -MAGICDIR = .. +# 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 = lispMain.c lispEval.c lispPrint.c lispParse.c lispA-Z.c \ lispGC.c lispFrame.c lispTrace.c lispMagic.c lispArith.c \ lispString.c lispIO.c diff --git a/magic/Makefile.in b/magic/Makefile.in index 541e5fbe..88523e3a 100644 --- a/magic/Makefile.in +++ b/magic/Makefile.in @@ -3,8 +3,11 @@ # MODULE = magic -MAGICDIR = .. - +# 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@ include ${MAGICDIR}/defs.mak SRCS = magicTop.c diff --git a/scmos/Makefile.in b/scmos/Makefile.in index e225d1c3..c0564351 100644 --- a/scmos/Makefile.in +++ b/scmos/Makefile.in @@ -13,8 +13,11 @@ # ####################################################################### -MAGICDIR = .. - +# 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@ include ${MAGICDIR}/defs.mak SC_PP = ${MCPP} -I$(srcdir)/extract_template diff --git a/tcltk/Makefile.in b/tcltk/Makefile.in index c457c8f9..ddaa4f99 100644 --- a/tcltk/Makefile.in +++ b/tcltk/Makefile.in @@ -3,7 +3,11 @@ # MODULE = tcltk -MAGICDIR = .. +# 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})