website/Makefile

24 lines
743 B
Makefile

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 # html/sitemap.html
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
mawk -f tmpl/html.awk -- $< > $@
gmi/%.gmi: src/%.gmi tmpl/gemini.awk
mawk -f tmpl/gemini.awk -- $< > $@
# html/sitemap.html: $(SITEMAP_INDEX_FILES) tmpl/sitemap_html.awk
# mawk -f tmpl/sitemap_html.awk $(SITEMAP_INDEX_FILES) > $@
gmi/sitemap.gmi: $(SITEMAP_INDEX_FILES) tmpl/sitemap_gmi.awk
mawk -f tmpl/sitemap_gmi.awk $(SITEMAP_INDEX_FILES) > $@