#
# ___
#
-# © 2022 Lady [@ Lady’s Computer]
+# © 2022–2023 Lady [@ Lady’s Computer]
#
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
BASEIRI = http://example.com
DATETIME = $(shell date -Iseconds)
+FEED_EXT = .atom
+SOURCE_EXT = .xml
TRANSFORM = transform.xslt
XSLT = xsltproc
XSLTOPTS =
footers := $(wildcard *-footer.xml)
override prerequisites := $(TRANSFORM) $(headers) $(footers)
-override indexsources := $(wildcard sources/index.xml sources/index-*.xml)
-override indices := $(patsubst sources/%.xml,public/%.html,$(indexsources))
+override indexsources := $(wildcard sources/index$(SOURCE_EXT) sources/index-*$(SOURCE_EXT))
+override indices := $(patsubst sources/%$(SOURCE_EXT),public/%.html,$(indexsources))
-override pagesources := $(filter-out $(indexsources),$(wildcard sources/*.xml sources/*/*.xml))
-override pages := $(patsubst sources/%.xml,public/%/index.html,$(pagesources))
+override pagesources := $(filter-out $(indexsources),$(wildcard sources/*$(SOURCE_EXT) sources/*/*$(SOURCE_EXT)))
+override pages := $(patsubst sources/%$(SOURCE_EXT),public/%/index.html,$(pagesources))
override resourcesources := $(wildcard $(addsuffix /*,$(basename $(pagesources))))
override resources := $(patsubst sources/%,public/%,$(resourcesources))
-override feedsources := $(filter-out $(resourcesources),$(wildcard sources/*.atom sources/*/*.atom))
-override feeds := $(patsubst sources/%.atom,public/%.atom,$(feedsources))
+override feedsources := $(filter-out $(resourcesources),$(wildcard sources/*$(FEED_EXT) sources/*/*$(FEED_EXT)))
+override feeds := $(patsubst sources/%$(FEED_EXT),public/%.atom,$(feedsources))
override content := $(indices) $(pages)
all: $(content) $(resources) $(feeds);
-$(indices): public/%.html: sources/%.xml $(prerequisites)
+$(indices): public/%.html: sources/%$(SOURCE_EXT) $(prerequisites)
@echo "Generating $@…"
@mkdir -p $(dir $@)
@$(call makexslt,$<,$@)
-$(pages): public/%/index.html: sources/%.xml $(prerequisites)
+$(pages): public/%/index.html: sources/%$(SOURCE_EXT) $(prerequisites)
@echo "Generating $@…"
@mkdir -p $(dir $@)
@$(call makexslt,$<,$@)
@mkdir -p $(dir $@)
@cp $< $@
-$(feeds): public/%.atom: sources/%.atom $(TRANSFORM)
+$(feeds): public/%.atom: sources/%$(FEED_EXT) $(TRANSFORM)
@echo "Generating $@…"
@mkdir -p $(dir $@)
@$(call makexslt,$<,$@)