Simplify the build: one-file modules, a module graph read off the imports #67

Merged
alex-eg merged 20 commits from project-infrastructure-improvements into main 2026-10-26 23:24:24 +01:00
Showing only changes of commit 8488a58be1 - Show all commits

View File

@@ -53,11 +53,13 @@ endif
# imports, or a NAME.scm may have come to be the module an import
# names; but modules.mk is rewritten only when that changed, since make
# starts over each time it is, and a source dated in the future would
# have it start over for good
# have it start over for good. A stamp without modules.mk stands for
# nothing, and is redone whatever its date
modules.mk: modules.stamp ;
modules.stamp: $(SOURCES) $(filter-out %.import.scm,$(wildcard *.scm)) \
tools/module-deps.scm dependencies.txt Makefile
tools/module-deps.scm dependencies.txt Makefile \
alex-eg marked this conversation as resolved
Review

That is another list of files, that is easy to forget about. I don't know how to fix it, whether to make a variable somewhere on top of the makefile, or make it computable somehow. The fact is - we will forget about it someday.

That is another list of files, that is easy to forget about. I don't know how to fix it, whether to make a variable somewhere on top of the makefile, or make it computable somehow. The fact is - we will forget about it someday.
Review

That we will, but probably CI will save us. Or manual testing.

That we will, but probably CI will save us. Or manual testing.
$(if $(wildcard modules.mk),,FORCE)
$(CSI) -s tools/module-deps.scm $(PROGRAMS) > modules.mk.tmp \
|| { rm -f modules.mk.tmp; exit 1; }
if cmp -s modules.mk.tmp modules.mk; then rm modules.mk.tmp; \
@@ -114,4 +116,4 @@ clean:
rm -f *.link $(PROGRAM_OBJ:.o=.link)
rm -f $(PROGRAM_NAMES)
.PHONY: all check run-tests check-modules check-exit-code install install-strip installdirs uninstall clean
.PHONY: all check run-tests check-modules check-exit-code install install-strip installdirs uninstall clean FORCE