summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-26 13:57:45 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-26 13:57:45 +0200
commit7a66a773ee262e28e0acdcce85a0f950832fc92e (patch)
treee8ce7a735c1e81ba3b8309cf244735864a13609c
parent06546f7cfb1ac66ca04649f4b54db81437074d80 (diff)
downloadhurrycurry-7a66a773ee262e28e0acdcce85a0f950832fc92e.tar
hurrycurry-7a66a773ee262e28e0acdcce85a0f950832fc92e.tar.bz2
hurrycurry-7a66a773ee262e28e0acdcce85a0f950832fc92e.tar.zst
fix shell redirects in makefiles writing empty files on error; fixes #340
-rw-r--r--book/GNUmakefile2
-rw-r--r--data/makefile8
2 files changed, 5 insertions, 5 deletions
diff --git a/book/GNUmakefile b/book/GNUmakefile
index 09dcdcec..9661290c 100644
--- a/book/GNUmakefile
+++ b/book/GNUmakefile
@@ -27,7 +27,7 @@ out:
@mkdir -p out
book.json: book.js
- DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@
+ DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@~ && cp $@~ $@
$(wordlist 2,99,$(png_pages)): $(word 1,$(png_pages))
out/book_01.%.png: book.typ book.json locale/%.ini out
diff --git a/data/makefile b/data/makefile
index fe4ab583..9b4dec4e 100644
--- a/data/makefile
+++ b/data/makefile
@@ -29,15 +29,15 @@ book.json: ../book/book.json
recipes/none.yaml:
echo > $@
recipes/anticurry.yaml: recipes/default.yaml
- recipes/anticurry.sed <$<>$@
+ recipes/anticurry.sed < $< > $@~ && cp $@~ $@
recipes/default.yaml: recipes/default.js
- DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@
+ DENO_NO_UPDATE_CHECK=1 $(JSR) $< > $@~ && cp $@~ $@
recipes/%.gv.txt: recipes/%.yaml
- { cd .. && cargo $(CARGOFLAGS) run --release --bin graph $(patsubst recipes/%.yaml,%,$<); } > $@
+ { cd .. && cargo $(CARGOFLAGS) run --release --bin graph $(patsubst recipes/%.yaml,%,$<); } > $@~ && cp $@~ $@
recipes/%.svg: recipes/%.gv.txt
- dot -Tsvg -Kdot >$@<$<
+ dot -Tsvg -Kdot < $< > $@~ && cp $@~ $@
clean:
$(RM) $(ALL)