just for readability Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
67 lines
1.4 KiB
Makefile
67 lines
1.4 KiB
Makefile
TMPDIR := ./_tmp
|
|
CSRD := ./srd/Cypher-System-Reference-Document-2024-09-26.docx
|
|
MD_CSRD := $(TMPDIR)/csrd.md
|
|
CCSRD := $(TMPDIR)/ccsrd.md
|
|
WEBDIR := ./incorporealcms-instance
|
|
PAGESDIR := $(TMPDIR)/$(WEBDIR)/pages
|
|
|
|
BASE_PATCH_DIR := ./patches/base
|
|
BASE_PATCHES := $(wildcard $(BASE_PATCH_DIR)/*.patch)
|
|
BASE_PATCHES_OUT := $(subst $(BASE_PATCH_DIR),$(TMPDIR),$(BASE_PATCHES))
|
|
|
|
WEB_PATCH_DIR := ./patches/web
|
|
WEB_PATCHES := $(wildcard $(WEB_PATCH_DIR)/*.patch)
|
|
WEB_PATCHES_OUT := $(subst $(WEB_PATCH_DIR),$(TMPDIR),$(WEB_PATCHES))
|
|
|
|
# DEFAULT BUILD
|
|
|
|
all: base
|
|
|
|
# CCSRD VERSIONS
|
|
|
|
base: $(CCSRD) $(BASE_PATCHES_OUT)
|
|
web: base $(WEB_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 $@
|
|
|
|
$(TMPDIR)/%.patch: $(WEB_PATCH_DIR)/%.patch
|
|
$(info >>> WEB '$<')
|
|
@patch $(CCSRD) $< --quiet
|
|
@touch $@
|
|
|
|
# OUTPUTS
|
|
|
|
http: base web
|
|
cp -a $(WEBDIR) $(TMPDIR)/
|
|
mkdir -p $(PAGESDIR)
|
|
cp $(CCSRD) $(PAGESDIR)/index.md
|
|
incorporealcms-build $(TMPDIR)/$(WEBDIR) /var/www/localhost/incorporealcms-testing/root
|
|
|
|
# BUILD STEPS
|
|
|
|
# generate the basic markdown file
|
|
$(MD_CSRD): $(CSRD) | $(TMPDIR)
|
|
pandoc -f docx -t gfm $(CSRD) -o $(MD_CSRD) --columns 120
|
|
|
|
# create the markdown file to patch
|
|
$(CCSRD): $(MD_CSRD)
|
|
cp -a $(MD_CSRD) $(CCSRD)
|
|
|
|
# create the build dir
|
|
$(TMPDIR):
|
|
mkdir -p $(TMPDIR)
|