2017-04-25 14:41:48 +02:00
|
|
|
#
|
|
|
|
|
# rcsid $Header: /usr/cvsroot/magic-8.0/Makefile,v 1.1.1.1 2008/02/03 20:43:49 tim Exp $
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
MAGICDIR = .
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
# Absolute path to the source tree (config.status substitutes @abs_top_srcdir@).
|
2026-07-22 18:48:24 +02:00
|
|
|
# For an in-tree build this is the same directory as the build top. Recursion
|
|
|
|
|
# into subdirectories goes through $(submake) (defined below).
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
MAGICSRC = @abs_top_srcdir@
|
2017-04-25 14:41:48 +02:00
|
|
|
PROGRAMS = magic
|
2024-10-16 19:31:19 +02:00
|
|
|
TECHS = scmos
|
2017-04-25 14:41:48 +02:00
|
|
|
LIBRARIES = database utils extflat
|
2019-03-23 00:58:47 +01:00
|
|
|
MODULES = bplane cmwind commands database dbwind debug drc extflat \
|
|
|
|
|
extract graphics netmenu plow resis select sim textio tiles \
|
|
|
|
|
utils windows wiring
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-17 22:15:30 +02:00
|
|
|
# This was `cat VERSION`
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
VERSION := $(shell cat ${MAGICSRC}/VERSION)
|
2024-10-17 22:15:30 +02:00
|
|
|
|
2017-04-25 14:41:48 +02:00
|
|
|
MAKEFLAGS =
|
2024-10-16 19:31:19 +02:00
|
|
|
INSTALL_CAD_DIRS = windows doc ${TECHS}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2020-02-24 23:30:18 +01:00
|
|
|
-include defs.mak
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2026-07-22 17:02:51 +02:00
|
|
|
# "docs" when configure found latex+dvips (regenerate PostScript from .tex into
|
|
|
|
|
# the build tree), empty otherwise (the pre-built PostScript is installed as-is).
|
|
|
|
|
DOCS_TARGET = @DOCS_TARGET@
|
|
|
|
|
|
2026-07-23 18:45:12 +02:00
|
|
|
# $(call submake,<dir>,<goal>) -- recurse into a build subdirectory. Every module
|
|
|
|
|
# is a configure-generated Makefile, so config.status already created
|
|
|
|
|
# the build subdir with its Makefile; recurse into it natively.
|
2026-07-22 18:48:24 +02:00
|
|
|
define submake
|
2026-07-23 18:45:12 +02:00
|
|
|
$(MAKE) -C $(1) $(2)
|
2026-07-22 18:48:24 +02:00
|
|
|
endef
|
|
|
|
|
|
2026-07-22 17:02:51 +02:00
|
|
|
all: $(ALL_TARGET) techs $(DOCS_TARGET)
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2025-07-24 15:44:50 +02:00
|
|
|
standard: mains
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2025-07-24 15:44:50 +02:00
|
|
|
tcl: tcllibrary
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2025-07-24 15:57:39 +02:00
|
|
|
force:
|
|
|
|
|
@${MAKE} clean
|
|
|
|
|
@${MAKE} all
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
defs.mak:
|
|
|
|
|
@echo No \"defs.mak\" file found. Run "configure" to make one.
|
2024-10-21 15:31:50 +02:00
|
|
|
@exit 1
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
config:
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
${MAGICSRC}/configure
|
2017-04-25 14:41:48 +02:00
|
|
|
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
# Declarative subdir recursion.
|
|
|
|
|
#
|
|
|
|
|
# Each (phase, dir) pair is a PHONY target "<phase>@<dir>" whose recipe recurses
|
2026-07-23 18:45:12 +02:00
|
|
|
# into <dir> with that phase's goal via $(submake). A phase aggregate (modules,
|
|
|
|
|
# libs, ...) is then just a list
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# of its per-dir targets as prerequisites -- no shell `for` loops, no FORCE
|
|
|
|
|
# pattern-rule hack. Ordering between phases is expressed as prerequisites on the
|
build: address code-review findings (low-risk cleanups)
From an independent review of the branch:
* Makefile.in: `tcltk` is in both INSTALL_CAD_DIRS and PROGRAMS (Tcl build),
so install@tcltk / install-tcl@tcltk were defined twice -> "given more than
once" warnings on every command. Wrap both install lists in $(sort ...) to
dedup (as CLEAN_TARGETS already does). Also fix a stale comment (module@ now
waits for ${DATABASE_H}, not a `depend` phase).
* toolchains/emscripten/defs.mak: the scmos display-file embed globbed
`mos.*.dstyle`, which misses mos.7bit.mraster_dstyle (an underscore, not a
dot) -- so the mono-raster style was not embedded in WASM, and the comment
wrongly called that file non-existent. Glob `mos.*dstyle` to cover both.
* npm/build.sh: sed_strip_cr wrote the file back unconditionally, bumping the
mtimes of configure and every scripts/ file on each WASM build (contradicting
the "source never mutated" guarantee and able to force a coexisting native
rebuild). Only write back when a CR was actually stripped.
* graphics/Makefile.in: remove the dead DEPSRCS block left behind by retiring
the Depend machinery (it also referenced an undefined ${THREE_D_SRCS}).
* scripts/defs.mak.in: clarify that only the SOURCE_DATE_EPOCH branch is UTC.
Verified: 0 duplicate-target warnings, wildcard now lists mos.7bit.mraster_dstyle,
full Tcl build+install rc=0 (375 files), graphics lib builds, build.sh syntax OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 17:19:22 +02:00
|
|
|
# per-dir targets (e.g. every module@ waits for the generated header ${DATABASE_H}),
|
|
|
|
|
# so the graph is correct under `make -jN`, not just left-to-right in a serial
|
|
|
|
|
# build. '@' never appears
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# in a real target name, so it is a safe namespace separator.
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
# main@<prog> / tcl-main@<prog>: link the final program(s) (PROGRAMS is "magic").
|
|
|
|
|
MAIN_TARGETS := $(addprefix main@,${PROGRAMS})
|
|
|
|
|
TCLMAIN_TARGETS := $(addprefix tcl-main@,${PROGRAMS})
|
|
|
|
|
.PHONY: $(MAIN_TARGETS) $(TCLMAIN_TARGETS)
|
|
|
|
|
$(MAIN_TARGETS): main@%: ${DATABASE_H} modules libs
|
|
|
|
|
@$(call submake,$*,main)
|
|
|
|
|
$(TCLMAIN_TARGETS): tcl-main@%: ${DATABASE_H} modules
|
|
|
|
|
@$(call submake,$*,tcl-main)
|
|
|
|
|
|
|
|
|
|
.PHONY: tcllibrary mains
|
|
|
|
|
tcllibrary: $(TCLMAIN_TARGETS)
|
|
|
|
|
mains: $(MAIN_TARGETS)
|
2017-04-25 14:41:48 +02:00
|
|
|
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
# makedbh is the one generated helper script; it lives in the *build* tree.
|
2026-07-22 17:49:58 +02:00
|
|
|
# ${DATABASE_H} is $(builddir)/database/database.h in-tree, or
|
|
|
|
|
# $(builddir)/include/database/database.h when relocated (see defs.mak GENINC).
|
|
|
|
|
${DATABASE_H}: ${MAGICSRC}/database/database.h.in
|
|
|
|
|
@echo --- making header file ${DATABASE_H}
|
|
|
|
|
@mkdir -p $(dir ${DATABASE_H})
|
|
|
|
|
${MAGICDIR}/scripts/makedbh ${MAGICSRC}/database/database.h.in ${DATABASE_H}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2026-07-22 17:53:36 +02:00
|
|
|
# "prepare" is the stable, path-independent way to (re)generate the build-time
|
|
|
|
|
# headers (currently database.h) before compiling -- use it instead of naming
|
|
|
|
|
# the header directly (its path depends on in-tree vs relocated; see GENINC).
|
|
|
|
|
# It is .PHONY so the name is always valid, but its prerequisite ${DATABASE_H}
|
|
|
|
|
# is a real file target, so the header is regenerated only when out of date.
|
|
|
|
|
.PHONY: prepare
|
|
|
|
|
prepare: ${DATABASE_H}
|
|
|
|
|
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# module@<dir> builds <dir>/lib<dir>.o; lib@<dir> builds <dir>/lib<dir>.a.
|
2026-07-23 16:49:37 +02:00
|
|
|
# The only thing they must wait for is the generated header (${DATABASE_H}).
|
|
|
|
|
# Header *dependencies* are now discovered automatically per source (.deps, see
|
|
|
|
|
# rules.mak), so there is no separate `depend` phase to gate on -- modules start
|
|
|
|
|
# compiling in parallel immediately.
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
MODULE_TARGETS := $(addprefix module@,${MODULES})
|
|
|
|
|
LIB_TARGETS := $(addprefix lib@,${MODULES})
|
|
|
|
|
.PHONY: $(MODULE_TARGETS) $(LIB_TARGETS)
|
2026-07-23 16:49:37 +02:00
|
|
|
$(MODULE_TARGETS): module@%: ${DATABASE_H}
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
@$(call submake,$*,module)
|
2026-07-23 18:18:43 +02:00
|
|
|
# lib@X depends on module@X (its OWN module): main@ pulls both `modules` and
|
|
|
|
|
# `libs`, so without this `make -C X module` and `make -C X lib` can run in the
|
|
|
|
|
# same directory at once under -j and race on X's shared *.o (each recipe does
|
|
|
|
|
# `rm $*.o; cc -c $*.o`). Serializing them per-dir removes the race; module@X
|
|
|
|
|
# builds the objects and lib@X then just archives them. Cross-dir parallelism is
|
|
|
|
|
# unaffected (lib@X only waits on module@X, not the whole modules phase).
|
|
|
|
|
$(LIB_TARGETS): lib@%: ${DATABASE_H} module@%
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
@$(call submake,$*,lib)
|
2025-07-24 15:50:17 +02:00
|
|
|
|
2026-07-22 21:59:42 +02:00
|
|
|
# Cross-module archive edge (-j correctness): libdatabase.a physically archives
|
|
|
|
|
# tiles/libtiles.o and utils/libutils.o (database/Makefile.in: LIB_OBJS += ...),
|
|
|
|
|
# so lib@database must not run until those module objects exist. A serial build
|
|
|
|
|
# got this from prerequisite order; under -j it needs the explicit edge. No other
|
|
|
|
|
# default-built module archives another module's objects.
|
|
|
|
|
lib@database: module@tiles module@utils
|
|
|
|
|
|
2025-10-04 00:32:54 +02:00
|
|
|
.PHONY: modules
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
modules: $(MODULE_TARGETS)
|
2025-07-24 15:50:17 +02:00
|
|
|
|
2025-10-04 00:32:54 +02:00
|
|
|
.PHONY: libs
|
2026-07-22 21:59:42 +02:00
|
|
|
libs: $(LIB_TARGETS)
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2024-10-16 10:49:10 +02:00
|
|
|
#
|
|
|
|
|
# extcheck - utility tool
|
|
|
|
|
# net2ir - utility tool
|
|
|
|
|
# oa - disabled (needs 'clean' target renaming)
|
|
|
|
|
SUBDIRS = bplane cmwind commands database dbwind debug drc extflat extract graphics \
|
|
|
|
|
magic netmenu plow resis select sim textio tiles utils windows wiring
|
|
|
|
|
|
2026-07-23 18:45:12 +02:00
|
|
|
BUNDLED_MODULES = lisp
|
2024-10-16 10:49:10 +02:00
|
|
|
|
2026-07-23 16:49:37 +02:00
|
|
|
# Unique, deduplicated subdir list (used by the clean fan-out below).
|
2024-10-16 10:49:10 +02:00
|
|
|
SUBDIRS_FILTERED := $(shell echo ${MODULES} ${PROGRAMS} ${SUBDIRS} | tr ' ' '\n' | sort | uniq)
|
|
|
|
|
|
2026-07-23 16:49:37 +02:00
|
|
|
# Dependencies are generated automatically as a side effect of compiling (see
|
|
|
|
|
# rules.mak .deps); there is no depend phase to run. "make depend" is kept as a
|
|
|
|
|
# no-op so callers that still invoke it (e.g. the WASM build script) do not error.
|
2024-10-16 10:49:10 +02:00
|
|
|
.PHONY: depend
|
2026-07-23 16:49:37 +02:00
|
|
|
depend:
|
|
|
|
|
@echo "--- dependencies are generated automatically during compilation"
|
2017-04-25 14:41:48 +02:00
|
|
|
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# tech@<dir>: build a technology dir (goal "all").
|
|
|
|
|
TECH_TARGETS := $(addprefix tech@,${TECHS})
|
|
|
|
|
.PHONY: $(TECH_TARGETS)
|
2026-07-23 16:49:37 +02:00
|
|
|
$(TECH_TARGETS): tech@%: ${DATABASE_H}
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
@$(call submake,$*,all)
|
|
|
|
|
|
2024-10-16 19:31:19 +02:00
|
|
|
.PHONY: techs
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
techs: $(TECH_TARGETS)
|
2024-10-16 19:31:19 +02:00
|
|
|
|
2026-07-22 17:02:51 +02:00
|
|
|
# Regenerate the PostScript documentation from its .tex sources (only reached
|
2026-07-22 21:59:42 +02:00
|
|
|
# from "all" when configure found latex+dvips; see DOCS_TARGET). Force -j1: the
|
|
|
|
|
# latexfiles rules share per-run aux files (.aux/.log) in one directory and are
|
|
|
|
|
# not parallel-safe, so under a parallel top-level build they would race and drop
|
|
|
|
|
# documents. Doc regeneration is best-effort anyway (pre-built PostScript is the
|
|
|
|
|
# install fallback), so serializing it costs nothing and keeps -j deterministic.
|
2026-07-22 17:02:51 +02:00
|
|
|
.PHONY: docs
|
|
|
|
|
docs:
|
|
|
|
|
@echo --- making documentation
|
2026-07-22 21:59:42 +02:00
|
|
|
@${MAKE} -j1 -k -C doc/latexfiles all || \
|
2026-07-22 17:02:51 +02:00
|
|
|
echo "--- WARNING: some documents did not regenerate; the pre-built PostScript will be used for those at 'make install'"
|
|
|
|
|
|
2017-04-25 14:41:48 +02:00
|
|
|
install: $(INSTALL_TARGET)
|
|
|
|
|
|
|
|
|
|
install-magic:
|
2020-01-28 18:17:22 +01:00
|
|
|
@echo --- installing executable to $(DESTDIR)${INSTALL_BINDIR}
|
|
|
|
|
@echo --- installing runtime files to $(DESTDIR)${INSTALL_LIBDIR}
|
2022-03-29 22:52:01 +02:00
|
|
|
@${MAKE} install-real
|
2017-04-25 14:41:48 +02:00
|
|
|
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# install@<dir>: install one subdir's artifacts (CAD dirs, then the programs).
|
build: address code-review findings (low-risk cleanups)
From an independent review of the branch:
* Makefile.in: `tcltk` is in both INSTALL_CAD_DIRS and PROGRAMS (Tcl build),
so install@tcltk / install-tcl@tcltk were defined twice -> "given more than
once" warnings on every command. Wrap both install lists in $(sort ...) to
dedup (as CLEAN_TARGETS already does). Also fix a stale comment (module@ now
waits for ${DATABASE_H}, not a `depend` phase).
* toolchains/emscripten/defs.mak: the scmos display-file embed globbed
`mos.*.dstyle`, which misses mos.7bit.mraster_dstyle (an underscore, not a
dot) -- so the mono-raster style was not embedded in WASM, and the comment
wrongly called that file non-existent. Glob `mos.*dstyle` to cover both.
* npm/build.sh: sed_strip_cr wrote the file back unconditionally, bumping the
mtimes of configure and every scripts/ file on each WASM build (contradicting
the "source never mutated" guarantee and able to force a coexisting native
rebuild). Only write back when a CR was actually stripped.
* graphics/Makefile.in: remove the dead DEPSRCS block left behind by retiring
the Depend machinery (it also referenced an undefined ${THREE_D_SRCS}).
* scripts/defs.mak.in: clarify that only the SOURCE_DATE_EPOCH branch is UTC.
Verified: 0 duplicate-target warnings, wildcard now lists mos.7bit.mraster_dstyle,
full Tcl build+install rc=0 (375 files), graphics lib builds, build.sh syntax OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 17:19:22 +02:00
|
|
|
INSTALL_TARGETS := $(addprefix install@,$(sort ${INSTALL_CAD_DIRS} ${PROGRAMS}))
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
.PHONY: $(INSTALL_TARGETS)
|
|
|
|
|
$(INSTALL_TARGETS): install@%: install-dirs
|
|
|
|
|
@$(call submake,$*,install)
|
|
|
|
|
|
|
|
|
|
install-real: $(INSTALL_TARGETS)
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-tcl-dirs:
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
${SCRIPTS}/mkdirs $(DESTDIR)${INSTALL_BINDIR} \
|
2020-01-28 19:10:31 +01:00
|
|
|
$(DESTDIR)${INSTALL_MANDIR} $(DESTDIR)${INSTALL_SYSDIR} \
|
|
|
|
|
$(DESTDIR)${INSTALL_TCLDIR} $(DESTDIR)${INSTALL_TCLDIR}/bitmaps
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-dirs:
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
${SCRIPTS}/mkdirs $(DESTDIR)${INSTALL_BINDIR} \
|
2020-01-28 19:10:31 +01:00
|
|
|
$(DESTDIR)${INSTALL_MANDIR} $(DESTDIR)${INSTALL_SYSDIR} \
|
|
|
|
|
$(DESTDIR)${INSTALL_SCMDIR}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
install-tcl:
|
2020-01-28 18:17:22 +01:00
|
|
|
@echo --- installing executable to $(DESTDIR)${INSTALL_BINDIR}
|
|
|
|
|
@echo --- installing runtime files to $(DESTDIR)${INSTALL_LIBDIR}
|
2022-03-29 22:52:01 +02:00
|
|
|
@${MAKE} install-tcl-real
|
2017-04-25 14:41:48 +02:00
|
|
|
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
# install-tcl@<dir>: install one subdir's Tcl-flavoured artifacts.
|
build: address code-review findings (low-risk cleanups)
From an independent review of the branch:
* Makefile.in: `tcltk` is in both INSTALL_CAD_DIRS and PROGRAMS (Tcl build),
so install@tcltk / install-tcl@tcltk were defined twice -> "given more than
once" warnings on every command. Wrap both install lists in $(sort ...) to
dedup (as CLEAN_TARGETS already does). Also fix a stale comment (module@ now
waits for ${DATABASE_H}, not a `depend` phase).
* toolchains/emscripten/defs.mak: the scmos display-file embed globbed
`mos.*.dstyle`, which misses mos.7bit.mraster_dstyle (an underscore, not a
dot) -- so the mono-raster style was not embedded in WASM, and the comment
wrongly called that file non-existent. Glob `mos.*dstyle` to cover both.
* npm/build.sh: sed_strip_cr wrote the file back unconditionally, bumping the
mtimes of configure and every scripts/ file on each WASM build (contradicting
the "source never mutated" guarantee and able to force a coexisting native
rebuild). Only write back when a CR was actually stripped.
* graphics/Makefile.in: remove the dead DEPSRCS block left behind by retiring
the Depend machinery (it also referenced an undefined ${THREE_D_SRCS}).
* scripts/defs.mak.in: clarify that only the SOURCE_DATE_EPOCH branch is UTC.
Verified: 0 duplicate-target warnings, wildcard now lists mos.7bit.mraster_dstyle,
full Tcl build+install rc=0 (375 files), graphics lib builds, build.sh syntax OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 17:19:22 +02:00
|
|
|
INSTALLTCL_TARGETS := $(addprefix install-tcl@,$(sort ${INSTALL_CAD_DIRS} ${PROGRAMS}))
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
.PHONY: $(INSTALLTCL_TARGETS)
|
|
|
|
|
$(INSTALLTCL_TARGETS): install-tcl@%: install-tcl-dirs
|
|
|
|
|
@$(call submake,$*,install-tcl)
|
|
|
|
|
|
|
|
|
|
install-tcl-real: $(INSTALLTCL_TARGETS)
|
|
|
|
|
|
|
|
|
|
# clean@<dir>: clean one subdir if it exists. Must not create dirs (skip absent
|
2026-07-23 18:45:12 +02:00
|
|
|
# ones) and must not fail the build (|| true).
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
CLEAN_TARGETS := $(addprefix clean@,$(sort ${SUBDIRS_FILTERED} ${TECHS} ${BUNDLED_MODULES}))
|
|
|
|
|
.PHONY: $(CLEAN_TARGETS)
|
|
|
|
|
$(CLEAN_TARGETS): clean@%:
|
2026-07-23 18:45:12 +02:00
|
|
|
@test -d $* || exit 0; ${MAKE} -C $* clean || true
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
clean: $(CLEAN_TARGETS)
|
2020-10-15 23:31:20 +02:00
|
|
|
${RM} *.tmp */*.tmp *.sav */*.sav *.log TAGS tags
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
|
touch defs.mak
|
|
|
|
|
@${MAKE} clean
|
2026-07-22 21:11:10 +02:00
|
|
|
# rules.mak is no longer copied into the build top (subdir Makefiles include
|
|
|
|
|
# ${MAGICSRC}/rules.mak straight from the source tree), so there is nothing to
|
|
|
|
|
# remove for it here; defs.mak is the only generated make fragment.
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
${RM} defs.mak old.defs.mak
|
|
|
|
|
${RM} scripts/makedbh scripts/default.conf
|
|
|
|
|
${RM} config.log config.status
|
2026-07-22 17:49:58 +02:00
|
|
|
${RM} ${DATABASE_H}
|
2024-10-17 22:15:30 +02:00
|
|
|
${RM} scripts/magic.spec magic-${VERSION} magic-${VERSION}.tgz
|
2024-10-16 10:49:10 +02:00
|
|
|
${RM} *.log
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
dist:
|
2024-10-17 22:15:30 +02:00
|
|
|
${RM} scripts/magic.spec magic-${VERSION} magic-${VERSION}.tgz
|
2025-01-08 10:02:35 +01:00
|
|
|
${SED} -e /@VERSION@/s%@VERSION@%${VERSION}% \
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
${MAGICSRC}/scripts/magic.spec.in > scripts/magic.spec
|
2025-01-08 09:58:55 +01:00
|
|
|
${LN} -nsf . magic-${VERSION}
|
2024-10-17 22:15:30 +02:00
|
|
|
tar zchvf magic-${VERSION}.tgz --exclude CVS \
|
|
|
|
|
--exclude magic-${VERSION}/magic-${VERSION} \
|
|
|
|
|
--exclude magic-${VERSION}/magic-${VERSION}.tgz \
|
|
|
|
|
magic-${VERSION}
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
clean-mains:
|
build: declarative subdir recursion, no for-loops/FORCE
Replace the shell `for dir` loops and the FORCE pattern-rule hack with a
uniform per-directory PHONY target scheme: each (phase, dir) is a target
"<phase>@<dir>" that recurses into <dir> with that phase's goal via
$(submake), and each phase aggregate (depend, modules, libs, techs,
install, install-tcl, clean, mains, tcllibrary) is just the list of its
per-dir targets as prerequisites.
Inter-phase ordering moves from the aggregate onto the per-dir targets
(module@/lib@/tech@ each require `depend`; main@ requires modules+libs),
so the dependency graph is correct under `make -jN`, not only in a
left-to-right serial build. '@' is a safe namespace char (never in a real
target name). readline/ still takes the -f path inside $(submake).
The `depend` rule is left as real file targets (<dir>/Depend) so Depend is
still regenerated incrementally, not on every build. clean-mains loses its
one-iteration shell loop too.
The one cross-module edge (libdatabase.a needs tiles/utils modules first)
is preserved by prerequisite order for serial builds here; its explicit
-j edge is fixed in the following commit.
Verified serial rc=0, 375 files, identical installs in-tree and
out-of-tree; --without-tcl builds readline + magic.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 21:54:10 +02:00
|
|
|
${RM} $(foreach p,${PROGRAMS},$p/$p)
|
2017-04-25 14:41:48 +02:00
|
|
|
|
|
|
|
|
tags:
|
|
|
|
|
${RM} tags
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
cd ${MAGICSRC} && find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs ctags -o $(CURDIR)/tags
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2020-05-23 01:00:05 +02:00
|
|
|
TAGS:
|
2017-04-25 14:41:48 +02:00
|
|
|
${RM} TAGS
|
build: top Makefile.in + build-dir orchestration (out-of-tree)
Make a plain `make` in a build directory build every module into the
build tree. The top Makefile becomes a configure-generated Makefile.in,
and each recursion drives a build subdirectory (created on demand) using
the module Makefile from the source tree.
Makefile -> Makefile.in (config.status generates Makefile in the build
top via AC_CONFIG_FILES([Makefile:Makefile.in])):
* Add MAGICSRC = @abs_top_srcdir@; read VERSION and re-run configure from
${MAGICSRC}.
* Every descent `(cd $$dir && ${MAKE} <goal>)` and `${MAKE} -C $(dir $@)
<goal>` becomes:
mkdir -p <builddir> && ${MAKE} -C <builddir> \
-f ${MAGICSRC}/<dir>/Makefile <goal>
so the build subdir need not pre-exist and the source Makefile is used.
Applied to modules/libs/depend pattern rules and the
tcllibrary/mains/techs/install/clean loops.
* database/database.h: generate from ${MAGICSRC}/.../database.h.in into
the build tree (mkdir -p database), via the generated build-tree
${MAGICDIR}/scripts/makedbh.
* install-dirs/install-tcl-dirs use ${SCRIPTS}/mkdirs (now source-tree);
clean skips absent build subdirs; distclean/dist/tags updated for the
split source/build layout.
scripts/defs.mak.in:
* SCRIPTS now points at the source tree (${MAGICSRC}/scripts) for the
static helpers (mkdirs, printmans, ...); the one generated helper,
makedbh, is referenced directly at ${MAGICDIR}/scripts (build tree).
* Guard VPATH so it is set only inside module subdirectories, never at
the build top -- a top-level VPATH into the source tree could let a
stale source database/database.h shadow the build-tree copy.
scripts/configure.in: AC_CONFIG_FILES([Makefile:Makefile.in]); regenerated
scripts/configure.
Verified out-of-tree: `../configure && make modules && make libs` builds
all 33 module libraries (lib*.o and lib*.a) plus the generated
database/database.h into the build tree, with no errors and the source
tree left clean. A full `make` (link the magic program, build techs)
still needs the later outlier fixes (magic/, scmos/, ...).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 14:42:35 +02:00
|
|
|
cd ${MAGICSRC} && find . ${MODULES} ${PROGRAMS} -name "*.[ch]" -maxdepth 1 | xargs etags -o $(CURDIR)/TAGS
|
2020-05-23 01:00:05 +02:00
|
|
|
|
2020-05-23 23:01:30 +02:00
|
|
|
setup-git:
|
|
|
|
|
git config --local include.path ../.gitconfig
|
|
|
|
|
git stash save
|
2025-01-08 10:01:47 +01:00
|
|
|
${RM} .git/index
|
2020-05-23 23:01:30 +02:00
|
|
|
git checkout HEAD -- "$$(git rev-parse --show-toplevel)"
|
|
|
|
|
git stash pop
|