From f4cbffb7ed25e076b34db69ed664364a8db09ce3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 8 Jun 2021 22:43:53 +0200 Subject: [PATCH] gv: fixed possible races during docs build MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In tclpkg/gv, the gv_doc_writer.tcl is run multiple times during the build. It is ineffective, but it shouldn't cause any troubles with the serial build. Unfortunately, this is not the case with the parallel builds where multiple parallel runs of the gv_doc_writer.tcl can cause races leading to empty corresponding ps and pdf files. The correct solution would be to use the Rules with Grouped Targets [1], unfortunately this GNU make feature has been introduced quite recently which would break backward compatibility. The proposed hack should cause the gv_doc_writer.tcl to be run only once during the build process and it should work also with the older 'make'. It is inspired by [2]. [1] https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html#Multiple-Targets [2] https://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file Signed-off-by: Jaroslav Å karvada --- tclpkg/gv/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index 476b0fcfc..14d7221f6 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -433,7 +433,10 @@ else pdf = endif -$(man): gv.i gv_doc_writer.tcl gv_doc_template.tcl gv_doc_langs.tcl +$(man): gv_doc_writer.intermediate ; + +.INTERMEDIATE: gv_doc_writer.intermediate +gv_doc_writer.intermediate: gv.i gv_doc_writer.tcl gv_doc_template.tcl gv_doc_langs.tcl $(TCLSH) $(srcdir)/gv_doc_writer.tcl "$(srcdir)" if ENABLE_MAN_PDFS -- 2.40.0