From 1123c9779f062aba02961f93d848a6e0c530c23a Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Fri, 29 Nov 2019 22:02:04 -0800
Subject: [PATCH] Improve Makefile for signing windows release candidates.

---
 windows/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/windows/Makefile b/windows/Makefile
index 0a442fbef..354c1b37c 100644
--- a/windows/Makefile
+++ b/windows/Makefile
@@ -1,5 +1,10 @@
-version?=$(shell grep '^[Vv]ersion:' ../pandoc.cabal | awk '{print $$2;}')
+UNSIGNED=$(wildcard pandoc-*-UNSIGNED.msi)
+SIGNED=$(patsubst %-UNSIGNED.msi, %.msi, $(UNSIGNED))
 
-pandoc-$(version)-windows-%.msi: pandoc-windows-%-UNSIGNED.msi
-	osslsigncode sign -pkcs12 $$HOME/Private/SectigoCodeSigning.exp2023.p12 -in $< -i http://johnmacfarlane.net/ -t http://timestamp.comodoca.com/ -out $@ -askpass
+all: $(SIGNED)
+
+.PHONY: all
+
+pandoc-%.msi: pandoc-%-UNSIGNED.msi
+	osslsigncode sign -pkcs12 $$HOME/Private/SectigoCodeSigning.exp2023.p12 -in $< -i http://johnmacfarlane.net/ -t http://timestamp.comodoca.com/ -out $@ -askpass && rm $<