From f1a5ecb18e0d7f3ffc6567319749ddae1e435348 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20A=2E=20Holm?= Date: Sat, 16 Nov 2024 18:46:50 +0100 Subject: [PATCH] Makefile: `%.pdf`: Don't create the new file directly, use tempfile If the `make` process is aborted, avoid having partial files around. Also, ignore and clean up `README.html.tmp`. 53f30166-a443-11ef-8c83-83850402c3ce --- Lib/std/c/.gitignore | 2 ++ Lib/std/c/Makefile | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Lib/std/c/.gitignore b/Lib/std/c/.gitignore index a3ce2a70..6c65229f 100644 --- a/Lib/std/c/.gitignore +++ b/Lib/std/c/.gitignore @@ -1,3 +1,5 @@ /README.html +/README.html.tmp /README.pdf +/README.pdf.tmp /tags diff --git a/Lib/std/c/Makefile b/Lib/std/c/Makefile index 1b16ab61..dd5e869b 100644 --- a/Lib/std/c/Makefile +++ b/Lib/std/c/Makefile @@ -28,15 +28,16 @@ all: %.pdf: FORCE $(MAKE) $*.html - wkhtmltopdf $*.html $@ + wkhtmltopdf $*.html $@.tmp + mv $@.tmp $@ tags: src/*.[ch] ctags src/*.[ch] .PHONY: clean clean: - rm -f README.html - rm -f README.pdf + rm -f README.html README.html.tmp + rm -f README.pdf README.pdf.tmp cd src && $(MAKE) $@ .PHONY: edit -- 2.11.4.GIT