about summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2024-10-11 10:39:17 +0200
committerZach DeCook <zachdecook@librem.one>2024-10-11 07:41:49 -0400
commitbcdf076da805be287d8d8e49b9937352adf3646e (patch)
treebe5041eacec27fe2817848d87df2443218a580bd /Makefile
parent7cb7bdc2cab115ed0d8e2d670f56a42c635fd73b (diff)
downloadswipeGuess-bcdf076da805be287d8d8e49b9937352adf3646e.tar.gz
build: Use temp file when creating manpages
Otherwise we might end up with an empty file when e.g. scdoc is
missing since the target won't be rebuilt later on (as an empty
file is enough to make `make` happy).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d38c810..eeb0d6c 100644
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,11 @@ mapScore: mapScore.c
 	$(CC) mapScore.c -o mapScore
 docs: swipeGuess.1 mapScore.1
 swipeGuess.1: swipeGuess.1.scd
-	scdoc < swipeGuess.1.scd > swipeGuess.1
+	scdoc < swipeGuess.1.scd > $@.tmp
+	mv $@.tmp $@
 mapScore.1: mapScore.1.scd
-	scdoc < mapScore.1.scd > mapScore.1
+	scdoc < mapScore.1.scd > $@.tmp
+	mv $@.tmp $@
 
 words-qwerty-en: /usr/share/dict/american-english mapScore
 	grep ..  /usr/share/dict/american-english | ./mapScore map.qwerty.noapos.tsv bee  | sort -nr | cut -f2 > words-qwerty-en