aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-22 21:53:54 +0200
committeruser <user@clank>2026-09-22 21:53:54 +0200
commit1e9604bb7f794fcea8edf2ce69d5701fb6e0fb3e (patch)
tree93a2166ddcf4b35e4a01af9a8f3d565a57ad791f
parentsched: SchedYield must preserve HL - link-less boots warm-rebooted every ~11s (diff)
downloadgbos-1e9604bb7f794fcea8edf2ce69d5701fb6e0fb3e.tar.gz
gbos-1e9604bb7f794fcea8edf2ce69d5701fb6e0fb3e.tar.xz
gbos-1e9604bb7f794fcea8edf2ce69d5701fb6e0fb3e.zip
build: rebuild every object when include/*.inc changes
The pattern rule listed no header dependency, so editing a constant in include/gbos.inc rebuilt only the .asm files that had themselves changed. Bumping MAX_SOCKS left the kernel half-built against the old value - a socket table sized 6 in socket.asm while dmesg still printed "4 sockets" - and the resulting misbehaviour looked exactly like a logic bug in the new socket code, which cost real time to chase.
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 71ade40..dd7a679 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,13 @@ FIXFLAGS := -v -C -m MBC5+RAM+BATTERY -r 4 -p 0xFF -t GBOS
all: $(ROM)
-$(BUILD)/%.o: src/%.asm | $(BUILD)
+# Every .asm INCLUDEs include/gbos.inc, so a change there must rebuild all of
+# them: without this, editing a constant (MAX_SOCKS, SK_*, PROG_*) silently
+# left every untouched object built against the OLD value, and the kernel ran
+# with two different ideas of the same number.
+INCS := $(wildcard include/*.inc)
+
+$(BUILD)/%.o: src/%.asm $(INCS) | $(BUILD)
rgbasm $(ASFLAGS) -o $@ $<
# Userland C programs (usr/): compiled with SDCC into ROM-bank blobs under