Skip to content

Commit

Permalink
mk: handle stale files when scdoc fails
Browse files Browse the repository at this point in the history
If scdoc fails for any reason, for example because a user hasn't
installed it yet, the `> $$@` redirection will still create an empty
destination file. On re-runs gmake will see the empty file and assume
the target has already completed. This led to installing a blank
man page.

Use the GNU Make '.DELETE_ON_ERROR' special target which automatically
deletes the target if a recipe fails.

Link: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html#index-removing-targets-on-failure
Signed-off-by: Brandon Maier <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
blmaier authored and rjarry committed Jul 2, 2024
1 parent 44b14eb commit 00bbc18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,5 @@ $(eval $(call install_file,contrib/carddav-query,755,$(DESTDIR)$(BINDIR)))

$(sort $(dirs)):
mkdir -p $@

.DELETE_ON_ERROR:

0 comments on commit 00bbc18

Please sign in to comment.