Commit 7bc84c64
7bc84c64dc36Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified
Description
Drop the spinelc make rule; all depends on $(SPINEL) directly
The spinelc: phony alias only existed because all listed it instead of
$(SPINEL) (SPINEL was defined below all, and prerequisites expand as the
rule is read, so $(SPINEL) there expanded to empty). Move the SPINEL
definition above all and have all depend on $(SPINEL) directly, then
remove the now-unused spinelc rule and its .PHONY entry. make spinelc
is gone; make / make all build build/spinel as before.
make check: 846 pass, 0 fail.
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
Details
- Commit
- 7bc84c64dc36
- Parent
- 37e5ad6f2091
MakefilemodifiedView file
@@ -38,7 +38,7 @@
3838
RBS_OBJ = $(patsubst $(RBS_DIR)/src/%.c,build/rbs/%.o,$(RBS_SRC))3939
RBS_LIB = build/librbs.a4040
41-
.PHONY: all parse spinelc legacy bootstrap codegen regexp rbs_extract rbs-test \41+
.PHONY: all parse legacy bootstrap codegen regexp rbs_extract rbs-test \4242
analyze-fail-test test test-run clean-test-results regen-rbs-expected \4343
regen-expected bench optcarrot gate check gate-legs gate-test gate-bench \4444
gate-optcarrot clean install uninstall deps@@ -51,10 +51,11 @@
5151
RBS_EXTRACT_TARGET =5252
endif5353
54-
# Note: use the phony `spinelc` alias here, not `$(SPINEL)` directly -- SPINEL55-
# is defined further down, and prerequisites are expanded when this line is56-
# read (it would expand to empty here).57-
all: parse regexp spinelc $(RBS_EXTRACT_TARGET)54+
# The single Spinel binary (compiler + cc driver). Defined here, before the55+
# `all` rule, because a rule's prerequisites are expanded as it is read.56+
SPINEL = build/spinel$(EXE)57+
58+
all: parse regexp $(SPINEL) $(RBS_EXTRACT_TARGET)5859
5960
# ---- Dependencies ----6061
deps: vendor/prism/include/prism/diagnostic.h vendor/rbs/include/rbs/parser.h@@ -126,8 +127,8 @@
126127
# Reuses spinel_parse.c's Prism walk (compiled with -DSPINEL_PARSE_AS_LIB so127128
# its standalone main() drops out and sp_parse_file_to_text is exposed).128129
# `spinel` is the single binary: it emits C and then drives cc to link it.130+
# (SPINEL itself is defined above, just before the `all` target.)129131
130-
SPINEL = build/spinel$(EXE)131132
SPINEL_HDRS = src/node_table.h src/codegen.h src/codegen_internal.h src/types.h src/compiler.h src/analyze.h src/analyze_internal.h132133
SPINEL_OBJ = build/csrc/node_table.o build/csrc/types.o build/csrc/compiler.o \133134
build/csrc/analyze.o build/csrc/analyze_util.o build/csrc/analyze_infer.o \@@ -149,9 +150,6 @@
149150
@# Dev convenience: a repo-root `./spinel` pointing at the built binary150151
@# (the installed command is `spinel` too). Best-effort; gitignored.151152
@ln -sf $@ spinel 2>/dev/null || cp $@ spinel 2>/dev/null || true152-
153-
# Backward-compatible alias for `make spinelc` (the binary is build/spinel now).154-
spinelc: $(SPINEL)155153
156154
# ---- Legacy Ruby compiler (regression oracle) ----157155
# Lives in legacy/ with its own Makefile; these are thin delegators.