aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-06-01 20:33:47 -0300
committerEuAndreh <eu@euandre.org>2022-06-01 20:33:51 -0300
commitd42d6fc45f50a09d36d912c0d68ee0794ac1e520 (patch)
treec1d2dfc0dccd5438892b83e4099868552f1a917d
parentsrc/development/frontmatter-env.sh: Use single quote for heredoc marker (diff)
downloadeuandre.org-d42d6fc45f50a09d36d912c0d68ee0794ac1e520.tar.gz
euandre.org-d42d6fc45f50a09d36d912c0d68ee0794ac1e520.tar.xz
Move files.mk and deps.mk into generated.mk
Make torrent files dynamic instead of listed in Makefile.
Diffstat (limited to '')
-rw-r--r--Makefile40
-rw-r--r--dynamic.mk15
-rwxr-xr-xsrc/development/dynmake.sh42
3 files changed, 48 insertions, 49 deletions
diff --git a/Makefile b/Makefile
index fd63df5..9624c56 100644
--- a/Makefile
+++ b/Makefile
@@ -28,26 +28,11 @@ lilypond = \
favicons = static/lord-favicon.png static/lord-favicon.ico favicon.ico
-podcasts.flac = \
- resources/podcasts/2020-12-19-a-test-entry.flac
-podcasts.ogg = $(podcasts.flac:.flac=.ogg)
-
-screencasts.webm = \
- resources/screencasts/2021-02-07-autoqemu-automate-installation-and-ssh-setup-of-iso-os-images.webm
-
-torrents-in = \
- $(podcasts.flac) \
- $(podcasts.ogg) \
- $(screencasts.webm)
-
-torrents = $(torrents-in:=.torrent)
-
derived-assets = \
$(pastebins) \
$(lilypond) \
$(favicons) \
$(podcasts.ogg) \
- $(torrents) \
TODOs.html \
@@ -57,36 +42,18 @@ all: public dynamic
dynamic: generated.mk
$(MAKE) -f dynamic.mk all
-JEKYLL_COMPAT: deps.mk files.mk
- sh src/development/JEKYLL_COMPAT/copy-content.sh
-
generated.mk: ALWAYS JEKYLL_COMPAT
sh src/development/dynmake.sh > $@
+JEKYLL_COMPAT:
+ sh src/development/JEKYLL_COMPAT/copy-content.sh
+
# NOOP rule to assert that the targets that depend on it are
# always considered stale.
ALWAYS:
$(lilypond.pdf): $(lilypond.midi)
-
-torrent-files.txt: $(torrents-in)
- echo $(torrents-in) | tr ' ' '\n' > $@
-
-files.mk: torrent-files.txt
- printf '' > $@
- printf 'torrent-files = \\\n' >> $@
- sed -e 's/^/\t/' -e 's/$$/.torrent \\/' < torrent-files.txt >> $@
- printf '\n\n' >> $@
-
-deps.mk: torrent-files.txt
- printf '' > $@
- awk '{ printf "%s.torrent: %s\n", $$1, $$1 }' torrent-files.txt >> $@
-
-$(torrents): files.mk deps.mk
- $(MAKE) generated.mk
- $(MAKE) -f dynamic.mk torrents
-
static/lord-favicon.png: static/lord-favicon.svg
inkscape -o $@ -w 2048 -h 2048 -b white static/lord-favicon.svg
@@ -115,7 +82,6 @@ clean:
rm -rf \
public/ .jekyll-cache \
$(derived-assets) \
- torrent-files.txt files.mk deps.mk \
src/content/ generated.mk \
diff --git a/dynamic.mk b/dynamic.mk
index c02d934..d16d99b 100644
--- a/dynamic.mk
+++ b/dynamic.mk
@@ -1,5 +1,6 @@
.POSIX:
+.SUFFIXES:
.SUFFIXES: .md .env .html
.md.env:
@@ -8,18 +9,14 @@
.md.html:
sh src/development/genhtml.sh $< > $@
-include files.mk
-include deps.mk
-
-torrents: $(torrent-files)
-
-$(torrent-files): files.mk deps.mk
- mktorrent -f -v -d -n $@ -o $@ -c '' "$$(echo $@ | sed 's/\.torrent$$//')"
-
include generated.mk
+
pastebins.env = $(pastebins.md:.md=.env)
pastebins.html = $(pastebins.md:.md=.html)
-all: $(pastebins.env) $(pastebins.html)
+all: $(pastebins.env) $(pastebins.html) $(torrent-files)
+
+$(torrent-files):
+ mktorrent -f -v -d -n $@ -o $@ -c '' "$(@D)/`basename $@ .torrent`"
diff --git a/src/development/dynmake.sh b/src/development/dynmake.sh
index 9c60b88..9b74a9f 100755
--- a/src/development/dynmake.sh
+++ b/src/development/dynmake.sh
@@ -56,11 +56,47 @@ assert_arg() {
-printf 'pastebins.md = \\\n'
-find src/content/pastebin -name '*.md' |
+varlist() {
sed -e 's/^/ /' \
-e 's/$/ \\/'
+}
+
+#
+# Pastebins
+#
+
+pastebins() {
+ find src/content/pastebin -name '*.md'
+}
+
+printf 'pastebins.md = \\\n'
+pastebins |
+ varlist
+
printf '\n'
-find src/content/pastebin -name '*.md' |
+pastebins |
sed 's/^\(.*\)\.md$/\1.html: \1.env/'
+
+
+
+#
+# torrent files
+#
+
+torrents() {
+ find resources \
+ -name '*.flac' -or \
+ -name '*.ogg' -or \
+ -name '*.webm'
+}
+
+printf 'torrent-files = \\\n'
+
+torrents |
+ sed 's|$|.torrent|' |
+ varlist
+
+printf '\n'
+
+torrents | awk '{ printf "%s.torrent: %s\n", $0, $0 }'