summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-03-31 11:25:12 -0300
committerEuAndreh <eu@euandre.org>2025-03-31 11:25:12 -0300
commit48d6c8829b8d5963dbc616700de43692b123fd60 (patch)
tree563eca0ec38f877f815927f1c53a892f2224bf12
parentMakefile: install.txt only depends on deps.mk and snippets! also nice (diff)
downloadeuandre.org-48d6c8829b8d5963dbc616700de43692b123fd60.tar.gz
euandre.org-48d6c8829b8d5963dbc616700de43692b123fd60.tar.xz
Makefile, mkdeps.sh: Derive index.html and feed.xml from more static "sortdata.txt" files
-rw-r--r--.gitignore1
-rw-r--r--Makefile9
-rw-r--r--deps.mk60
-rwxr-xr-xmkdeps.sh17
4 files changed, 37 insertions, 50 deletions
diff --git a/.gitignore b/.gitignore
index 0378764..a292462 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
*.indexentry
*.feedentry
*.sortdata
+sortdata.txt
index.htmlheader
index.htmlfooter
index.htmllisting
diff --git a/Makefile b/Makefile
index 5050e32..ba3e220 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ LDLIBS =
.SUFFIXES:
-.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml .xmldeps
+.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml
.SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html
.SUFFIXES: .gz
@@ -75,9 +75,7 @@ articles.sortdata = $(articles.adoc:.adoc=.sortdata)
listings.htmlheader = $(listings.adoc:.adoc=.htmlheader)
listings.htmlfooter = $(listings.adoc:.adoc=.htmlfooter)
listings.htmllisting = $(listings.adoc:.adoc=.htmllisting)
-listings.htmldeps = $(listings.adoc:.adoc=.htmldeps)
listings.html = $(listings.adoc:.adoc=.html)
-feeds.xmldeps = $(feeds.xml:.xml=.xmldeps)
sources = \
$(sources.adoc) \
@@ -131,8 +129,6 @@ derived-assets = \
$(listings.htmlheader) \
$(listings.htmlfooter) \
$(listings.htmllisting) \
- $(listings.htmldeps) \
- $(feeds.xmldeps) \
$(articles.indexentry) \
$(articles.feedentry) \
$(articles.sortdata) \
@@ -153,6 +149,7 @@ side-assets = \
src/collections/*/*/*/*/*.html.*.txt \
src/collections/*/*/*/*/*.html.*.txt.gz \
src/collections/*/index.html.*.txt \
+ src/collections/*/sortdata.txt \
src/collections/*/*.sortdata \
src/pages/*/*.html.*.txt \
src/content/.well-known/ \
@@ -176,7 +173,7 @@ $(listings.html):
cat $*.htmlheader $*.htmllisting $*.htmlbody $*.htmlfooter > $@
$(feeds.xml):
- ifok -o $@ mkwb feed src/global.conf $*.xmldeps
+ ifok -o $@ mkwb feed src/global.conf $(@D)/sortdata.txt
$(contents.gz):
gzip -9fk $*
diff --git a/deps.mk b/deps.mk
index 7ae0b7b..049dc01 100644
--- a/deps.mk
+++ b/deps.mk
@@ -530,11 +530,6 @@ src/content/pastebins/index.htmlheader src/content/pastebins/index.htmlfooter: s
src/content/podcasts/index.htmlheader src/content/podcasts/index.htmlfooter: src/content/podcasts/index.conf
src/content/screencasts/index.htmlheader src/content/screencasts/index.htmlfooter: src/content/screencasts/index.conf
src/content/tils/index.htmlheader src/content/tils/index.htmlfooter: src/content/tils/index.conf
-src/content/blog/index.htmllisting: src/content/blog/index.htmldeps
-src/content/pastebins/index.htmllisting: src/content/pastebins/index.htmldeps
-src/content/podcasts/index.htmllisting: src/content/podcasts/index.htmldeps
-src/content/screencasts/index.htmllisting: src/content/screencasts/index.htmldeps
-src/content/tils/index.htmllisting: src/content/tils/index.htmldeps
src/content/blog/index.html: src/content/blog/index.htmlheader src/content/blog/index.htmlfooter
src/content/pastebins/index.html: src/content/pastebins/index.htmlheader src/content/pastebins/index.htmlfooter
src/content/podcasts/index.html: src/content/podcasts/index.htmlheader src/content/podcasts/index.htmlfooter
@@ -569,13 +564,12 @@ articles.blog.adoc = \
articles.blog.sortdata = $(articles.blog.adoc:.adoc=.sortdata)
articles.blog.indexentry = $(articles.blog.adoc:.adoc=.indexentry)
articles.blog.feedentry = $(articles.blog.adoc:.adoc=.feedentry)
-src/content/blog/index.htmldeps: $(articles.blog.indexentry)
-src/content/blog/feed.xmldeps: $(articles.blog.feedentry)
-src/content/blog/index.htmldeps src/content/blog/feed.xmldeps: $(articles.blog.sortdata)
- @echo '# find ... > $@. Use -n of make(1) for full listing.'
- @find $(articles.blog.sortdata) > $@
+src/content/blog/sortdata.txt: deps.mk
+ printf '%s\n' $(articles.blog.sortdata) > $@
-src/content/blog/feed.xml: src/content/blog/feed.xmldeps
+src/content/blog/feed.xml src/content/blog/index.htmllisting: src/content/blog/sortdata.txt $(articles.blog.sortdata)
+src/content/blog/index.htmllisting: $(articles.blog.indexentry)
+src/content/blog/feed.xml: $(articles.blog.feedentry)
articles.pastebins.adoc = \
@@ -605,13 +599,12 @@ articles.pastebins.adoc = \
articles.pastebins.sortdata = $(articles.pastebins.adoc:.adoc=.sortdata)
articles.pastebins.indexentry = $(articles.pastebins.adoc:.adoc=.indexentry)
articles.pastebins.feedentry = $(articles.pastebins.adoc:.adoc=.feedentry)
-src/content/pastebins/index.htmldeps: $(articles.pastebins.indexentry)
-src/content/pastebins/feed.xmldeps: $(articles.pastebins.feedentry)
-src/content/pastebins/index.htmldeps src/content/pastebins/feed.xmldeps: $(articles.pastebins.sortdata)
- @echo '# find ... > $@. Use -n of make(1) for full listing.'
- @find $(articles.pastebins.sortdata) > $@
+src/content/pastebins/sortdata.txt: deps.mk
+ printf '%s\n' $(articles.pastebins.sortdata) > $@
-src/content/pastebins/feed.xml: src/content/pastebins/feed.xmldeps
+src/content/pastebins/feed.xml src/content/pastebins/index.htmllisting: src/content/pastebins/sortdata.txt $(articles.pastebins.sortdata)
+src/content/pastebins/index.htmllisting: $(articles.pastebins.indexentry)
+src/content/pastebins/feed.xml: $(articles.pastebins.feedentry)
articles.podcasts.adoc = \
@@ -620,13 +613,12 @@ articles.podcasts.adoc = \
articles.podcasts.sortdata = $(articles.podcasts.adoc:.adoc=.sortdata)
articles.podcasts.indexentry = $(articles.podcasts.adoc:.adoc=.indexentry)
articles.podcasts.feedentry = $(articles.podcasts.adoc:.adoc=.feedentry)
-src/content/podcasts/index.htmldeps: $(articles.podcasts.indexentry)
-src/content/podcasts/feed.xmldeps: $(articles.podcasts.feedentry)
-src/content/podcasts/index.htmldeps src/content/podcasts/feed.xmldeps: $(articles.podcasts.sortdata)
- @echo '# find ... > $@. Use -n of make(1) for full listing.'
- @find $(articles.podcasts.sortdata) > $@
+src/content/podcasts/sortdata.txt: deps.mk
+ printf '%s\n' $(articles.podcasts.sortdata) > $@
-src/content/podcasts/feed.xml: src/content/podcasts/feed.xmldeps
+src/content/podcasts/feed.xml src/content/podcasts/index.htmllisting: src/content/podcasts/sortdata.txt $(articles.podcasts.sortdata)
+src/content/podcasts/index.htmllisting: $(articles.podcasts.indexentry)
+src/content/podcasts/feed.xml: $(articles.podcasts.feedentry)
articles.screencasts.adoc = \
@@ -635,13 +627,12 @@ articles.screencasts.adoc = \
articles.screencasts.sortdata = $(articles.screencasts.adoc:.adoc=.sortdata)
articles.screencasts.indexentry = $(articles.screencasts.adoc:.adoc=.indexentry)
articles.screencasts.feedentry = $(articles.screencasts.adoc:.adoc=.feedentry)
-src/content/screencasts/index.htmldeps: $(articles.screencasts.indexentry)
-src/content/screencasts/feed.xmldeps: $(articles.screencasts.feedentry)
-src/content/screencasts/index.htmldeps src/content/screencasts/feed.xmldeps: $(articles.screencasts.sortdata)
- @echo '# find ... > $@. Use -n of make(1) for full listing.'
- @find $(articles.screencasts.sortdata) > $@
+src/content/screencasts/sortdata.txt: deps.mk
+ printf '%s\n' $(articles.screencasts.sortdata) > $@
-src/content/screencasts/feed.xml: src/content/screencasts/feed.xmldeps
+src/content/screencasts/feed.xml src/content/screencasts/index.htmllisting: src/content/screencasts/sortdata.txt $(articles.screencasts.sortdata)
+src/content/screencasts/index.htmllisting: $(articles.screencasts.indexentry)
+src/content/screencasts/feed.xml: $(articles.screencasts.feedentry)
articles.tils.adoc = \
@@ -672,10 +663,9 @@ articles.tils.adoc = \
articles.tils.sortdata = $(articles.tils.adoc:.adoc=.sortdata)
articles.tils.indexentry = $(articles.tils.adoc:.adoc=.indexentry)
articles.tils.feedentry = $(articles.tils.adoc:.adoc=.feedentry)
-src/content/tils/index.htmldeps: $(articles.tils.indexentry)
-src/content/tils/feed.xmldeps: $(articles.tils.feedentry)
-src/content/tils/index.htmldeps src/content/tils/feed.xmldeps: $(articles.tils.sortdata)
- @echo '# find ... > $@. Use -n of make(1) for full listing.'
- @find $(articles.tils.sortdata) > $@
+src/content/tils/sortdata.txt: deps.mk
+ printf '%s\n' $(articles.tils.sortdata) > $@
-src/content/tils/feed.xml: src/content/tils/feed.xmldeps
+src/content/tils/feed.xml src/content/tils/index.htmllisting: src/content/tils/sortdata.txt $(articles.tils.sortdata)
+src/content/tils/index.htmllisting: $(articles.tils.indexentry)
+src/content/tils/feed.xml: $(articles.tils.feedentry)
diff --git a/mkdeps.sh b/mkdeps.sh
index 8815426..35c2c5c 100755
--- a/mkdeps.sh
+++ b/mkdeps.sh
@@ -58,7 +58,6 @@ articles | sed 's/^\(.*\)\.adoc$/\1.sortdata:\t\1.conf/'
printf '\n'
listings | sed 's/^\(.*\)\.adoc$/\1.htmlheader\t\1.htmlfooter:\t\1.conf/'
-listings | sed 's/^\(.*\)\.adoc$/\1.htmllisting:\t\1.htmldeps/'
listings | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.htmlheader\t\1.htmlfooter/'
listings | sed 's/^\(.*\)\.adoc$/\1.html:\t\1.htmllisting\t\1.htmlbody/'
@@ -76,13 +75,13 @@ for colllink in src/collections/*; do
"$name" 'feedentry ' "$name" 'feedentry'
- printf '%s/index.htmldeps: $(articles.%s.indexentry)\n' "$c" "$name"
- printf '%s/feed.xmldeps: $(articles.%s.feedentry)\n' "$c" "$name"
+ printf '%s/sortdata.txt: deps.mk\n' "$c"
+ printf '\tprintf %s $(articles.%s.sortdata) > $@\n\n' \
+ "'%s\n'" "$name"
- printf '%s/index.htmldeps %s/feed.xmldeps: $(articles.%s.sortdata)\n' \
- "$c" "$c" "$name"
- printf '\t@echo %s# find ... > $@.' "'"
- printf ' Use -n of make(1) for full listing.%s\n' "'"
- printf '\t@find $(articles.%s.sortdata) > $@\n\n' "$name"
- printf '%s/feed.xml:\t%s/feed.xmldeps\n' "$c" "$c"
+ printf '%s/feed.xml\t%s/index.htmllisting:' "$c" "$c"
+ printf '\t%s/sortdata.txt\t$(articles.%s.sortdata)\n' "$c" "$name"
+
+ printf '%s/index.htmllisting:\t$(articles.%s.indexentry)\n' "$c" "$name"
+ printf '%s/feed.xml:\t$(articles.%s.feedentry)\n' "$c" "$name"
done