website/Makefile

63 lines
2.3 KiB
Makefile
Raw Normal View History

SHELL = /bin/sh
SOURCES = $(shell find src/ -type f)
SITEMAP_INDEX_FILES = $(wildcard src/*/*)
2023-05-07 11:51:33 +00:00
all: subdirs \
$(SOURCES:src/%.gmi=html/%.html) \
$(SOURCES:src/%.png=html/%.png) \
$(SOURCES:src/%.webp=html/%.webp) \
$(SOURCES:src/%.gmi=gmi/%.gmi) \
$(SOURCES:src/%.png=gmi/%.png) \
$(SOURCES:src/%.webp=gmi/%.webp) \
2023-05-07 11:51:33 +00:00
gmi/sitemap.gmi \
gmi/feed.atom \
html/sitemap.html \
2023-05-10 10:19:06 +00:00
html/feed.atom \
html/style.css
2023-05-10 10:19:06 +00:00
upload:
scp -r gmi/* techn0path@vern.cc:public_gemini
scp -r html/* techn0path@vern.cc:public_html
test: testing/input.gmi testing/input_feed.txt
2023-09-27 08:52:52 +00:00
mawk -f lib/navbar.awk -f lib/path.awk -f scripts/html.awk -v 'sourcePath=src/' -v 'outputPath=testing/' -- testing/input.gmi > testing/output.html
mawk -f lib/navbar.awk -f lib/path.awk -f scripts/gemini.awk -v 'sourcePath=src/' -v 'outputPath=testing/' -- testing/input.gmi > testing/output.gmi
2023-09-23 04:08:27 +00:00
mawk -f lib/path.awk -f scripts/feed.awk -- testing/input_feed.txt > testing/output.atom
2023-06-21 11:38:20 +00:00
html5validator testing/output.html
subdirs:
find src -mindepth 1 -type d -printf '%P\0' | xargs -0 -I{} mkdir -p gmi/{} html/{}
html/%.png: src/%.png
cp $< $@
gmi/%.png: src/%.png
cp $< $@
html/%.webp: src/%.webp
cp $< $@
gmi/%.webp: src/%.webp
cp $< $@
html/style.css: src/style.css
cp $< $@
2023-09-23 04:08:27 +00:00
html/%.html: src/%.gmi scripts/html.awk lib/navbar.awk
2023-09-27 08:52:52 +00:00
mawk -f lib/navbar.awk -f lib/path.awk -v 'sourcePath=src/' -v 'outputPath=html/' -f scripts/html.awk -- $< > $@
2023-09-23 04:08:27 +00:00
gmi/%.gmi: src/%.gmi scripts/gemini.awk lib/navbar.awk
2023-09-27 08:52:52 +00:00
mawk -f lib/navbar.awk -f lib/path.awk -v 'sourcePath=src/' -v 'outputPath=gmi/' -f scripts/gemini.awk -- $< > $@
2023-09-23 09:36:34 +00:00
html/sitemap.html: $(SITEMAP_INDEX_FILES) scripts/sitemap_html.awk lib/navbar.awk
2023-09-27 08:52:52 +00:00
mawk -f lib/navbar.awk -f lib/path.awk -v 'sourcePath=src/' -v 'outputPath=html/' -f scripts/sitemap_html.awk -- $(SITEMAP_INDEX_FILES) > $@
2023-09-23 09:36:34 +00:00
gmi/sitemap.gmi: $(SITEMAP_INDEX_FILES) scripts/sitemap_gmi.awk lib/navbar.awk
2023-09-27 08:52:52 +00:00
mawk -f lib/navbar.awk -f lib/path.awk -v 'sourcePath=src/' -v 'outputPath=gmi/' -f scripts/sitemap_gmi.awk -- $(SITEMAP_INDEX_FILES) > $@
2023-05-10 10:19:06 +00:00
2023-08-03 13:42:22 +00:00
html/feed.atom: scripts/feed.awk
2023-09-23 04:08:27 +00:00
git log --diff-filter=A --pretty=format:'%aI "%s"' --name-only src/ | mawk -v 'willConvertLinks=1' -f lib/path.awk -f scripts/feed.awk -- - > $@
2023-09-23 04:05:17 +00:00
gmi/feed.atom: scripts/feed.awk
2023-09-23 04:08:27 +00:00
git log --diff-filter=A --pretty=format:'%aI "%s"' --name-only src/ | mawk -f lib/path.awk -f scripts/feed.awk -- - > $@