67 lines
2.9 KiB
Makefile
67 lines
2.9 KiB
Makefile
SHELL = /bin/sh
|
|
SOURCES = $(shell find src/ -type f)
|
|
|
|
all: subdirs \
|
|
$(SOURCES:src/%.gmi=build/html/%.html) \
|
|
$(SOURCES:src/%.png=build/html/%.png) \
|
|
$(SOURCES:src/%.webp=build/html/%.webp) \
|
|
$(SOURCES:src/%.gmi=build/gmi/%.gmi) \
|
|
$(SOURCES:src/%.png=build/gmi/%.png) \
|
|
$(SOURCES:src/%.webp=build/gmi/%.webp) \
|
|
build/gmi/sitemap.gmi \
|
|
build/gmi/feed.atom \
|
|
build/html/sitemap.html \
|
|
build/html/feed.atom \
|
|
build/html/style.css
|
|
|
|
upload:
|
|
scp -r build/gmi/* techn0path@vern.cc:public_gemini
|
|
scp -r build/html/* techn0path@vern.cc:public_html
|
|
|
|
test: testing/input/index.gmi testing/input/feed.txt
|
|
echo '' | mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -f scripts/test.awk > testing/output/functionOutputs.txt
|
|
mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -f scripts/html.awk -v 'sourcePath=testing/input' -v 'destPath=testing/output' -- testing/input/index.gmi > testing/output/index.html
|
|
mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -f scripts/gemini.awk -v 'sourcePath=testing/input' -v 'destPath=testing/output' -- testing/input/index.gmi > testing/output/index.gmi
|
|
mawk -f scripts/lib/path.awk -f scripts/feed.awk -- testing/input/feed.txt > testing/output/feed.atom
|
|
|
|
traverse:
|
|
find src/ \
|
|
\(-mindepth 1 -type d -fprintf tmp/directories '%P\0'\) , \
|
|
\(-type f -fprintf tmp/sources\) | xargs -0 -I{} mkdir -p build/gmi/{} build/html/{}
|
|
|
|
subdirs:
|
|
find src -mindepth 1 -type d -printf '%P\0' | xargs -0 -I{} mkdir -p build/gmi/{} build/html/{}
|
|
|
|
build/html/%.png: src/%.png
|
|
cp $< $@
|
|
|
|
build/gmi/%.png: src/%.png
|
|
cp $< $@
|
|
|
|
build/html/%.webp: src/%.webp
|
|
cp $< $@
|
|
|
|
build/gmi/%.webp: src/%.webp
|
|
cp $< $@
|
|
|
|
build/html/style.css: src/style.scss
|
|
sass $< > $@
|
|
|
|
build/html/%.html: src/%.gmi scripts/html.awk scripts/lib/navbar.awk
|
|
mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -v 'sourcePath=src/' -v 'destPath=build/html/' -f scripts/html.awk -- $< > $@
|
|
|
|
build/gmi/%.gmi: src/%.gmi scripts/gemini.awk scripts/lib/navbar.awk
|
|
mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -v 'sourcePath=src/' -v 'destPath=build/html/' -f scripts/gemini.awk -- $< > $@
|
|
|
|
build/html/sitemap.html: $(SOURCES) scripts/sitemap_html.awk scripts/lib/navbar.awk
|
|
mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -v 'sourcePath=src/' -v 'destPath=build/html/' -f scripts/sitemap_html.awk -- $(SOURCES) > $@
|
|
|
|
build/gmi/sitemap.gmi: $(SOURCES) scripts/sitemap_gmi.awk scripts/lib/navbar.awk
|
|
mawk -f scripts/lib/navbar.awk -f scripts/lib/path.awk -v 'sourcePath=src/' -v 'destPath=build/html/' -f scripts/sitemap_gmi.awk -- $(SOURCES) > $@
|
|
|
|
build/html/feed.atom: scripts/feed.awk
|
|
git log --diff-filter=A --pretty=format:'%aI "%s"' --name-only src/ | mawk -v 'willConvertLinks=1' -f scripts/lib/path.awk -f scripts/feed.awk -- - > $@
|
|
|
|
build/gmi/feed.atom: scripts/feed.awk
|
|
git log --diff-filter=A --pretty=format:'%aI "%s"' --name-only src/ | mawk -f scripts/lib/path.awk -f scripts/feed.awk -- - > $@
|