if this branch makes it to core, it's because this was a far easier thing to keep patches up to date with than having to hack the DOCX SRD apart and back together again. naturally, I went through all of that work and then CSRD updates happened and everything unraveled. this is hopefully a better way to do things, by leaning on the existing community's work anyway, this creates the CCSRD based on the OG-CSRD and omits the incorporeal-cms parts of this, since my project doesn't understand Pandoc Markdown, but Pandoc does (naturally)
55 lines
987 B
Makefile
55 lines
987 B
Makefile
TMPDIR := ./_tmp
|
|
CSRD := ./og-csrd/index.html
|
|
MD_CSRD := $(TMPDIR)/og-csrd.md
|
|
CCSRD := $(TMPDIR)/ccsrd.md
|
|
WEBDIR := $(TMPDIR)/web
|
|
HTML_OUT := $(WEBDIR)/index.html
|
|
|
|
BASE_PATCH_DIR := ./patches/base
|
|
BASE_PATCHES := $(wildcard $(BASE_PATCH_DIR)/*.patch)
|
|
BASE_PATCHES_OUT := $(subst $(BASE_PATCH_DIR),$(TMPDIR),$(BASE_PATCHES))
|
|
|
|
# DEFAULT BUILD
|
|
|
|
all: base
|
|
|
|
# CCSRD VERSIONS
|
|
|
|
base: $(CCSRD) $(BASE_PATCHES_OUT)
|
|
|
|
# CLEANUPS
|
|
|
|
clean:
|
|
rm -rf $(TMPDIR)/ccsrd*
|
|
rm -rf $(TMPDIR)/*.patch
|
|
|
|
distclean:
|
|
rm -rf $(TMPDIR)
|
|
|
|
# PATCHERS
|
|
|
|
$(TMPDIR)/%.patch: $(BASE_PATCH_DIR)/%.patch
|
|
$(info >>> BASE '$<')
|
|
@patch $(CCSRD) $< --quiet
|
|
@touch $@
|
|
|
|
# OUTPUTS
|
|
|
|
web: $(CCSRD)
|
|
mkdir -p $(WEBDIR)
|
|
pandoc $(CCSRD) -s -o $(HTML_OUT)
|
|
|
|
# BUILD STEPS
|
|
|
|
# create the build dir
|
|
$(TMPDIR):
|
|
mkdir -p $(TMPDIR)
|
|
|
|
# generate the root markdown file
|
|
$(MD_CSRD): $(CSRD) | $(TMPDIR)
|
|
pandoc $(CSRD) -o $(MD_CSRD) --columns 120
|
|
|
|
# create the markdown file to patch
|
|
$(CCSRD): $(MD_CSRD)
|
|
cp -a $(MD_CSRD) $(CCSRD)
|