From ec8bf0c2f3686e5b077bb5f9c9fa1edc5a653612 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 4 Apr 2025 08:16:45 -0500 Subject: [PATCH] modularize the Makefile a bit for testing Signed-off-by: Brian S. Stephan --- Makefile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) 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)