aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2024-10-26 14:21:55 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2024-10-26 14:21:55 -0500
commitb13b9c1c2c0c0de05fe0e3a9e34ebcc2f250cb59 (patch)
treeeac5b16049e648112ec14a02e445a05475f96f20
parentd3d769b26a1aa49093c4d26ea1ba6a111bcccc31 (diff)
generalize shell scripts that generate markdown
-rw-r--r--Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 42d7d64..f5a72f0 100644
--- a/Makefile
+++ b/Makefile
@@ -3,22 +3,25 @@ BUILD_DIR ?= build
MARKDOWNFILES = $(wildcard md/*.md)
HTMLTARGETS = $(MARKDOWNFILES:md/%.md=$(BUILD_DIR)/stories/%.html)
-$(BUILD_DIR)/stories $(BUILD_DIR):
+GENFILES = $(wildcard gen/gen_*.sh)
+GENTARGETS = $(GENFILES:gen/gen_%.sh=$(BUILD_DIR)/%.html)
+
+$(BUILD_DIR)/stories $(BUILD_DIR): ## Requisite folders
mkdir -p $@
-$(BUILD_DIR)/stories/%.html: md/%.md | $(BUILD_DIR)/stories
+$(BUILD_DIR)/stories/%.html: md/%.md | $(BUILD_DIR)/stories ## MD Files -> HTML
pandoc "$<" \
--standalone \
--embed-resources \
--template template.html \
-o "$@"
-$(BUILD_DIR)/index.html: gen/gen_index.sh | $(BUILD_DIR)
+$(BUILD_DIR)/%.html: gen/gen_%.sh | $(BUILD_DIR) ## Shell Script -> MD Files -> HTML
bash $< | pandoc \
--standalone \
--embed-resources \
--template template.html \
-o "$@"
-all: $(HTMLTARGETS) $(BUILD_DIR)/index.html
+all: $(HTMLTARGETS) $(GENTARGETS)
.PHONY: all