From e4aff82df4aa2ce9e1c15080372a9f7ceb2fdfa5 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Tue, 28 Mar 2023 13:01:15 -0700 Subject: Don't generate .pdf output unless build succeeds --- build/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build') diff --git a/build/Makefile b/build/Makefile index 79643a9..192668c 100644 --- a/build/Makefile +++ b/build/Makefile @@ -20,15 +20,19 @@ SRCDIR := ../src priv: priv-isa-asciidoc.pdf priv-isa-asciidoc.pdf: $(SRCDIR)/riscv-privileged.adoc - @echo "Building Privilege ISA" - asciidoctor-pdf $(ASCIIDOCTOR_OPTS) --out-file=$@ $< + @echo "Building Privileged ISA" + rm -f $@.tmp + asciidoctor-pdf $(ASCIIDOCTOR_OPTS) --out-file=$@.tmp $< + mv $@.tmp $@ # Unprivileged ISA unpriv: unpriv-isa-asciidoc.pdf unpriv-isa-asciidoc.pdf: $(SRCDIR)/riscv-isa-unpr-conv-review.adoc - @echo "Building Unprivilege ISA" - asciidoctor-pdf $(ASCIIDOCTOR_OPTS) --out-file=$@ $< + @echo "Building Unprivileged ISA" + rm -f $@.tmp + asciidoctor-pdf $(ASCIIDOCTOR_OPTS) --out-file=$@.tmp $< + mv $@.tmp $@ clean: @if [ -f priv-isa-asciidoc.pdf ]; then \ -- cgit v1.1