From 99b182f57940bc70868758fa9126af10642646be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Fri, 18 Sep 2026 11:29:24 +0200 Subject: [PATCH] utils.mk: give write_rc a do- sibling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flow/Makefile states the convention where it generates the copy rules: "a do- sibling rule that copies the file unconditionally". do-klayout, do-synth-report, do-step and do-copy all follow it. The file target decides whether to run and delegates with $(UNSET_AND_MAKE), and the do- target is the single place the invocation lives. write_rc is the one that conflates the two, so a caller doing its own dependency checking cannot ask for just the operation. The file target delegates rather than keeping a second copy of the $(RUN_CMD) line, which is the same shape as every other do- pair. Make's dependency checking is unchanged. Co-Authored-By: Claude Opus 5 (1M context) Signed-off-by: Øyvind Harboe --- flow/util/utils.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flow/util/utils.mk b/flow/util/utils.mk index c3b56a1e78..be7e2db138 100644 --- a/flow/util/utils.mk +++ b/flow/util/utils.mk @@ -113,6 +113,14 @@ write_rc: $(RESULTS_DIR)/6_nets_rc.csv $(RESULTS_DIR)/6_segments_rc.csv # A pattern rule to write both files with a single run, as the grouped target # syntax requires GNU Make 4.3. %_nets_rc.csv %_segments_rc.csv: + $(UNSET_AND_MAKE) do-write_rc + +# The do- sibling, following do-synth-report and the do-step/do-copy +# families: the file target above decides *whether* to run and delegates +# here, and this rule is the only place the invocation lives. A caller +# doing its own dependency checking asks for this one directly. +.PHONY: do-write_rc +do-write_rc: $(RUN_CMD) --log $(LOG_DIR)/6_write_rc.log --tee -- $(OPENROAD_CMD) $(UTILS_DIR)/write_rc.tcl .PHONY: correlate_rc