website/Makefile

24 lines
979 B
Makefile
Raw Normal View History

SHELL = /bin/sh
SOURCES = $(shell find src/ -type f)
2023-05-02 11:26:37 +00:00
SITEMAP_INDEX_FILES = $(wildcard src/*/index.gmi)
all: subdirs $(SOURCES:src/%.gmi=html/%.html) $(SOURCES:src/%.gmi=gmi/%.gmi) gmi/sitemap.gmi gmi/feed.atom
clean:
rm -rf html/* gmi/*
subdirs:
find src -mindepth 1 -type d -printf '%P\0' | xargs -0 -I{} mkdir -p gmi/{} html/{}
html/%.html: src/%.gmi tmpl/html.awk tmpl/common_functions.awk
mawk -f tmpl/common_functions.awk -f tmpl/html.awk -- $< > $@
gmi/%.gmi: src/%.gmi tmpl/gemini.awk tmpl/common_functions.awk
mawk -f tmpl/common_functions.awk -f tmpl/gemini.awk -- $< > $@
2023-05-01 03:51:16 +00:00
gmi/sitemap.gmi: $(SITEMAP_INDEX_FILES) tmpl/sitemap_gmi.awk tmpl/common_functions.awk
mawk -f tmpl/common_functions.awk -f tmpl/sitemap_gmi.awk -- $(SITEMAP_INDEX_FILES) > $@
gmi/feed.atom: src/feed.ass tmpl/feed.awk tmpl/common_functions.awk
git log --pretty=format:"/hash %s%n/date %cI%n/title %s%n/body %b%n/end%n" | mawk -f tmpl/common_functions.awk -f tmpl/feed.awk -- - > $@