website/Makefile

32 lines
1.0 KiB
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)
2023-05-07 11:51:33 +00:00
all: subdirs \
$(SOURCES:src/%.gmi=html/%.html) \
$(SOURCES:src/%.gmi=gmi/%.gmi) \
gmi/sitemap.gmi \
gmi/feed.atom \
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 scripts/html.awk
mawk -f scripts/common_functions.awk -f scripts/html.awk -- $< > $@
gmi/%.gmi: src/%.gmi scripts/gemini.awk
mawk -f scripts/common_functions.awk -f scripts/gemini.awk -- $< > $@
2023-05-01 03:51:16 +00:00
gmi/sitemap.gmi: $(SITEMAP_INDEX_FILES) scripts/sitemap_gmi.awk
mawk -f scripts/common_functions.awk -f scripts/sitemap_gmi.awk -- $(SITEMAP_INDEX_FILES) > $@
html/sitemap.html: $(SITEMAP_INDEX_FILES) scripts/sitemap_html.awk
mawk -f scripts/common_functions.awk -f scripts/sitemap_html.awk -- $(SITEMAP_INDEX_FILES) > $@
gmi/feed.atom: src/feed.ass scripts/feed.awk
mawk -f scripts/common_functions.awk -f scripts/feed.awk -- $< > $@