depend on the modules each Sex unit reads

sexc writes the rule now (sex#40), so a module's change rebuilds the
units that read it rather than every Sex object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 18:24:03 +03:00
parent 1b6ac779a8
commit ce445ce27a

View File

@@ -13,15 +13,13 @@ B = build
all: $(B)/vsmv $(B)/vs-map-viewer
# sexc writes no dependency files, and an import pastes the imported
# module's public forms into the importer, so any Sex source may change
# any Sex object.
# TODO sex#40: depend on what each unit imports once sexc writes
# dependency files.
SEX_SRC := $(wildcard src/*.sex)
# An import pastes the imported module's public forms into the
# importer, so a Sex object depends on every module it reads; sexc
# names them in a .d beside the object.
$(B)/%.o: src/%.sex | $(B)
$(SEXC) $< -c -o $@ --depfile=$(@:.o=.d) -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS)
$(B)/%.o: src/%.sex $(SEX_SRC) | $(B)
$(SEXC) $< -c -o $@ -- $(CFLAGS) $(SEX_CFLAGS) $(CPPFLAGS)
-include $(wildcard $(B)/*.d)
$(B)/nk.o: src/nk.c src/nk.h | $(B)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@