website/Makefile

21 lines
594 B
Makefile
Raw Normal View History

SHELL = /bin/sh
SOURCES = $(shell find src/ -type f)
SITEMAP_INDEX_FILES = $(filter %/index.gmi, $(SOURCES))
all: subdirs $(SOURCES:src/%.gmi=html/%.html) $(SOURCES:src/%.gmi=gmi/%.gmi) gmi/sitemap.gmi
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
2023-04-30 16:23:13 +00:00
mawk -f tmpl/html.awk -- $< > $@
gmi/%.gmi: src/%.gmi tmpl/gemini.awk
2023-05-01 03:51:16 +00:00
mawk -f tmpl/gemini.awk -- $< > $@
gmi/sitemap.gmi: $(SITEMAP_INDEX_FILES) tmpl/sitemap_gmi.awk
mawk -f tmpl/sitemap_gmi.awk $(SITEMAP_INDEX_FILES) > $@