Skip to content

Commit 8ed3693

Browse files
authored
Merge pull request #1612 from Pinata-Consulting/makefile-move-tmp-log-to-log
makefile: move foo.tmp.log to foo.log in the case of failure
2 parents e8d9ea4 + 8edc04b commit 8ed3693

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flow/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,9 @@ $(if $(5),$(5),$(RESULTS_DIR))/$(1)$(if $(4),$(4),.odb): $(2)
542542

543543
.PHONY: do-$(1)
544544
do-$(1):
545-
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/$(3).tcl -metrics $(LOG_DIR)/$(1).json) 2>&1 | tee $(LOG_DIR)/$(1).tmp.log
546-
mv $(LOG_DIR)/$(1).tmp.log $(LOG_DIR)/$(1).log
545+
(trap 'mv $(LOG_DIR)/$(1).tmp.log $(LOG_DIR)/$(1).log' EXIT; \
546+
$(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/$(3).tcl -metrics $(LOG_DIR)/$(1).json) 2>&1 | \
547+
tee $(LOG_DIR)/$(1).tmp.log
547548
endef
548549

549550
# generate make rules to copy a file, if a dependency change and

0 commit comments

Comments
 (0)