summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-01-10 16:13:33 -0300
committerEuAndreh <eu@euandre.org>2022-01-10 16:13:33 -0300
commit629e30484a1806fb402b537012d5ffe5264215db (patch)
tree0874a5cf9c58a739d7774cbc47e469497be0bf23
parentTODOs.md: Add #td-ca621da2-2e94-ae6f-0e3d-db744c00a656 (diff)
downloadeuandre.org-629e30484a1806fb402b537012d5ffe5264215db.tar.gz
euandre.org-629e30484a1806fb402b537012d5ffe5264215db.tar.xz
_plugins/generate-lilypond.rb: Build lilypond files inside Makefile instead of Jekyll
-rw-r--r--Makefile37
-rw-r--r--_plugins/generate-lilypond.rb28
2 files changed, 34 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 9afb336..978a0dc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,34 @@
.POSIX:
-all:
+
+.SUFFIXES:
+.SUFFIXES: .ly .flac .midi .ogg .pdf
+
+.ly.midi:
+ lilypond -o $* $<
+
+.midi.ogg:
+ timidity -Ov $<
+
+
+lilypond.ly = \
+ music/choro-da-saudade.ly \
+ music/dengoso.ly \
+ music/marcha-dos-marinheiros.ly
+lilypond.pdf = $(lilypond.ly:.ly=.pdf)
+lilypond.midi = $(lilypond.ly:.ly=.midi)
+lilypond.ogg = $(lilypond.midi:.midi=.ogg)
+lilypond = \
+ $(lilypond.pdf) \
+ $(lilypond.midi) \
+ $(lilypond.ogg)
+
+
+all: $(lilypond)
+
+
+$(lilypond.pdf): $(lilypond.midi)
+
+
check:
sh aux/assert-shellcheck.sh
sh aux/workflow/assert-todos.sh
@@ -10,9 +39,11 @@ check:
dev-check: check
clean:
- rm -rf public/
+ rm -rf \
+ public/ \
+ $(lilypond)
-public:
+public: all
jekyll build
publish: public
diff --git a/_plugins/generate-lilypond.rb b/_plugins/generate-lilypond.rb
deleted file mode 100644
index c0c1a13..0000000
--- a/_plugins/generate-lilypond.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-module Jekyll
- class LilyPondGenerator < Generator
- safe true
- priority :high
-
- def generate(site)
- site.config['musics'].each do |music|
- ref = music['ref']
- file = "music/#{ref}"
- ly = "#{file}.ly"
- pdf = "#{file}.pdf"
- unless File.exist? pdf then
- puts "Missing '#{pdf}', generating..."
- puts `lilypond -o #{file} #{ly}`
- site.static_files << Jekyll::StaticFile.new(site, site.source, '', pdf)
- end
-
- ogg = "#{file}.ogg"
- midi = "#{file}.midi"
- unless File.exist? ogg then
- puts "Missing '#{ogg}', generating..."
- puts `timidity -Ov #{midi}`
- site.static_files << Jekyll::StaticFile.new(site, site.source, '', ogg)
- end
- end
- end
- end
-end