Fix include/version.h collision between hosted Makefile and Makefile.starkernel
The hosted Makefile writes include/version.h with FORCE as a prerequisite (always regenerates), but Makefile.starkernel's own rule had no prerequisite at all -- Make only rebuilds a target with no prerequisites when the file is missing. Since both Makefiles write the same path with incompatible content (the hosted version has no LITHOS_VERSION/ LITHOS_VERSION_STR at all), running a bare `make -f Makefile.starkernel` after a hosted `make` build silently reused the wrong file and failed deep in kernel_main.c with "LITHOS_VERSION_STR undeclared". Added FORCE (declared .PHONY, matching the hosted Makefile's own existing pattern) as include/version.h's prerequisite in Makefile.starkernel. Verified the fix directly: poisoned version.h with a hosted build, then ran a bare (non-clean) kernel build and confirmed it self-heals. Full three-architecture acceptance: amd64 (logs/20260922-215333/), aarch64 (logs/20260922-215803/), riscv64 (logs/20260922-220217/) -- all three reach [zuse@Hera] ok>, zero UNKNOWN WORD. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
2008c4596a
commit
2406158668
+10
-1
@@ -597,6 +597,7 @@ KERNEL_OBJS := \
|
||||
.PHONY: qemu qemu-esp qemu-gdb
|
||||
.PHONY: thumbdrive iso-usb
|
||||
.PHONY: info help
|
||||
.PHONY: FORCE
|
||||
|
||||
# ==============================================================================
|
||||
# MAIN TARGETS
|
||||
@@ -627,7 +628,15 @@ clean-kernel:
|
||||
# BUILD RULES
|
||||
# ==============================================================================
|
||||
|
||||
include/version.h:
|
||||
FORCE:
|
||||
|
||||
# FORCE prerequisite (matches the hosted Makefile's own pattern, Makefile:613/626):
|
||||
# this file is also written by the hosted Makefile with different, incompatible
|
||||
# content (no LITHOS_VERSION/LITHOS_VERSION_STR) -- without FORCE, a bare build
|
||||
# here after a hosted `make` run silently reuses that stale/wrong-flavored file
|
||||
# and fails with "LITHOS_VERSION_STR undeclared" deep in kernel_main.c, instead
|
||||
# of regenerating its own correct version.
|
||||
include/version.h: FORCE
|
||||
@mkdir -p include
|
||||
@BUILD_TS=$$(date -Iseconds 2>/dev/null || echo "unknown"); \
|
||||
printf '#ifndef STARFORTH_VERSION_H\n#define STARFORTH_VERSION_H\n\n' > $@; \
|
||||
|
||||
Reference in New Issue
Block a user