build: include rules.mak from source, drop the build-top copy

rules.mak has no @...@ substitutions, so there is no reason to copy it into
the build top.  Point all 38 subdir Makefile.in includes at the source copy
directly -- ${MAGICSRC}/rules.mak instead of ${MAGICDIR}/rules.mak -- and
remove AC_CONFIG_FILES([rules.mak:rules.mak]) from configure.  defs.mak (the
one make fragment with substitutions) remains the only generated file in the
build top.  readline/ and the top Makefile never included rules.mak, so they
are unaffected; AC_CONFIG_SRCDIR(rules.mak) (the srcdir sentinel) is kept.

Now editing rules.mak in the source tree takes effect without reconfiguring.

Verified rc=0, 375 files, both in-tree and out-of-tree; out-of-tree build
top has no rules.mak; distclean rc=0.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
Darryl L. Miles
2026-07-26 14:54:11 -04:00
committed by R. Timothy Edwards
co-authored by Claude Opus 4.8
parent 69dff2aaa8
commit 2b4fcf5968
42 changed files with 47 additions and 48 deletions
-3
View File
@@ -9396,8 +9396,6 @@ ac_config_files="$ac_config_files defs.mak:scripts/defs.mak.in"
ac_config_files="$ac_config_files scripts/makedbh:scripts/makedbh.in"
ac_config_files="$ac_config_files rules.mak:rules.mak"
ac_config_files="$ac_config_files tiles/Makefile:tiles/Makefile.in"
@@ -10217,7 +10215,6 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile:Makefile.in" ;;
"defs.mak") CONFIG_FILES="$CONFIG_FILES defs.mak:scripts/defs.mak.in" ;;
"scripts/makedbh") CONFIG_FILES="$CONFIG_FILES scripts/makedbh:scripts/makedbh.in" ;;
"rules.mak") CONFIG_FILES="$CONFIG_FILES rules.mak:rules.mak" ;;
"tiles/Makefile") CONFIG_FILES="$CONFIG_FILES tiles/Makefile:tiles/Makefile.in" ;;
"bplane/Makefile") CONFIG_FILES="$CONFIG_FILES bplane/Makefile:bplane/Makefile.in" ;;
"calma/Makefile") CONFIG_FILES="$CONFIG_FILES calma/Makefile:calma/Makefile.in" ;;
+3 -4
View File
@@ -1998,10 +1998,9 @@ dnl under build/scripts/ (matching ${SCRIPTS}/makedbh = ${MAGICDIR}/scripts).
AC_CONFIG_FILES([Makefile:Makefile.in])
AC_CONFIG_FILES([defs.mak:scripts/defs.mak.in])
AC_CONFIG_FILES([scripts/makedbh:scripts/makedbh.in], [chmod +x scripts/makedbh])
dnl Copy rules.mak into the build top (it has no @...@ substitutions; this just
dnl places it next to the generated defs.mak so a single ${MAGICDIR} resolves
dnl both `include`s in every subdir Makefile out-of-tree).
AC_CONFIG_FILES([rules.mak:rules.mak])
dnl rules.mak is included straight from the source tree (${MAGICSRC}/rules.mak),
dnl so it is NOT copied into the build top. Only defs.mak (which has @...@
dnl substitutions) is generated there.
dnl Per-module Makefiles (Makefile.in migration). Each converted module lists
dnl its Makefile here; config.status creates the build subdir and the Makefile.