make: detect uncompiled sources and orphan .so in purge-stale
ober
014c6ac8d64d5a24a4e0516b27dae52851dd58ad
--- a/Makefile +++ b/Makefile @@ -47,10 +47,19 @@ purge-stale: src=$$(echo $$f | sed -e 's|^lib/|src/|' -e 's|\.so$$|.ss|' -e 's|\.wpo$$|.ss|'); \ sls=$$(echo $$f | sed 's|\.\(so\|wpo\)$$|.sls|'); \ if [ ! -f "$$src" ] && [ ! -f "$$sls" ]; then rm -f "$$f"; \ + elif [ ! -f "$$sls" ]; then rm -f "$$f"; \ elif [ -f "$$src" ] && [ "$$src" -nt "$$f" ]; then rm -f "$$f"; \ elif [ -f "$$sls" ] && [ "$$sls" -nt "$$f" ]; then rm -f "$$f"; \ fi; \ done + @for s in $$(find src -name '*.ss' 2>/dev/null); do \ + sls=$$(echo $$s | sed 's|^src/|lib/|;s|\.ss$$|.sls|'); \ + if [ ! -f "$$sls" ]; then \ + echo "purge-stale: $$s has no compiled output — invalidating .jerbuild-hashes"; \ + rm -f src/.jerbuild-hashes; \ + break; \ + fi; \ + done @rm -f vendor/chez-sqlite/src/chez-sqlite.so vendor/chez-sqlite/src/chez-sqlite.wpo # ── chez-sqlite shim build ──────────────────────────────────────────────────