diff --git a/Makefile b/Makefile
index 1634cf8..48da955 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,20 @@
-all:
-	mkdir -p ./_tmp
-	pandoc -f docx -t markdown ./srd/Cypher-System-Reference-Document-2024-09-26.docx -o ./_tmp/csrd.md --columns 120
-	cp -a ./_tmp/csrd.md ./_tmp/ccsrd.md
-	find patches/base -type f -name *.patch -print0 | xargs -0 -n 1 patch ./_tmp/ccsrd.md
+TMPDIR	:= ./_tmp
+CSRD	:= ./srd/Cypher-System-Reference-Document-2024-09-26.docx
+MD_CSRD	:= $(TMPDIR)/csrd.md
+CCSRD	:= $(TMPDIR)/ccsrd.md
+
+all:	$(MD_CSRD)
+	cp -a $(MD_CSRD) $(CCSRD)
+	find patches/base -type f -name *.patch -print0 | xargs -0 -n 1 patch $(CCSRD)
+
+$(MD_CSRD): | $(TMPDIR)
+	pandoc -f docx -t gfm $(CSRD) -o $(MD_CSRD) --columns 120
+
+$(TMPDIR):
+	mkdir -p $(TMPDIR)
 
 clean:
-	rm -rf ./_tmp
+	rm -rf $(TMPDIR)/ccsrd*
+
+distclean:
+	rm -rf $(TMPDIR)