From 1115a3fc34164f927a154de3c844c78cb1b62ef8 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 30 Nov 2015 18:26:30 +0100 Subject: [PATCH] rewrite buildsystem with make --- .gitignore | 8 +- Makefile | 99 ++++++++++ README.md | 7 - lib/lyluatex.lua | 186 ++++++++++++++++++ lib/lyluatex.sty | 69 +++++++ lilysettings.ly | 11 -- make.py | 156 --------------- headfoot.tex => src/headfoot.tex | 0 {images => src/images}/title.png | Bin {lyrics => src/lyrics}/AllForMeGrog.tex | 0 {lyrics => src/lyrics}/AuldLangSyne.tex | 0 {lyrics => src/lyrics}/BlackVelvetBand.tex | 0 {lyrics => src/lyrics}/Buergerlied.tex | 0 {lyrics => src/lyrics}/DrunkenSailor.tex | 0 {lyrics => src/lyrics}/FinnegansWake.tex | 0 {lyrics => src/lyrics}/FoggyDew.tex | 0 .../lyrics}/ImARoverSeldomSober.tex | 0 {lyrics => src/lyrics}/IrishRover.tex | 0 .../lyrics}/JohnnyIHardlyKnewYe.tex | 0 {lyrics => src/lyrics}/KerryRecruit.tex | 0 .../lyrics}/MacPhersonsFarewell.tex | 0 {lyrics => src/lyrics}/MollyMalone.tex | 0 {lyrics => src/lyrics}/MuirsheenDurkin.tex | 0 {lyrics => src/lyrics}/NationOnceAgain.tex | 0 {lyrics => src/lyrics}/PartingGlass.tex | 0 {lyrics => src/lyrics}/RisingOfTheMoon.tex | 0 {lyrics => src/lyrics}/SpancilHill.tex | 0 .../lyrics}/StarOfTheCountyDown.tex | 0 {lyrics => src/lyrics}/WhiskeyInTheJar.tex | 0 {lyrics => src/lyrics}/WildRover.tex | 0 {scores => src/scores}/AllForMeGrog.ly | 4 +- {scores => src/scores}/AuldLangSyne.ly | 0 {scores => src/scores}/BlackVelvetBand.ly | 0 {scores => src/scores}/Buergerlied.ly | 0 {scores => src/scores}/DrunkenSailor.ly | 0 {scores => src/scores}/FinnegansWake.ly | 0 {scores => src/scores}/FoggyDew.ly | 0 {scores => src/scores}/ImARoverSeldomSober.ly | 0 {scores => src/scores}/IrishRover.ly | 0 {scores => src/scores}/JohnnyIHardlyKnewYe.ly | 0 {scores => src/scores}/KerryRecruit.ly | 0 {scores => src/scores}/MacPhersonsFarewell.ly | 0 {scores => src/scores}/MollyMalone.ly | 0 {scores => src/scores}/MuirsheenDurkin.ly | 0 {scores => src/scores}/NationOnceAgain.ly | 0 {scores => src/scores}/PartingGlass.ly | 0 {scores => src/scores}/RisingOfTheMoon.ly | 0 {scores => src/scores}/SpancilHill.ly | 0 {scores => src/scores}/StarOfTheCountyDown.ly | 0 {scores => src/scores}/WhiskeyInTheJar.ly | 0 {scores => src/scores}/WildRover.ly | 0 settings.tex => src/settings.tex | 0 singalongs.tex => src/singalongs.tex | 2 +- title.tex => src/title.tex | 2 +- 54 files changed, 362 insertions(+), 182 deletions(-) create mode 100644 Makefile create mode 100644 lib/lyluatex.lua create mode 100644 lib/lyluatex.sty delete mode 100644 lilysettings.ly delete mode 100755 make.py rename headfoot.tex => src/headfoot.tex (100%) rename {images => src/images}/title.png (100%) rename {lyrics => src/lyrics}/AllForMeGrog.tex (100%) rename {lyrics => src/lyrics}/AuldLangSyne.tex (100%) rename {lyrics => src/lyrics}/BlackVelvetBand.tex (100%) rename {lyrics => src/lyrics}/Buergerlied.tex (100%) rename {lyrics => src/lyrics}/DrunkenSailor.tex (100%) rename {lyrics => src/lyrics}/FinnegansWake.tex (100%) rename {lyrics => src/lyrics}/FoggyDew.tex (100%) rename {lyrics => src/lyrics}/ImARoverSeldomSober.tex (100%) rename {lyrics => src/lyrics}/IrishRover.tex (100%) rename {lyrics => src/lyrics}/JohnnyIHardlyKnewYe.tex (100%) rename {lyrics => src/lyrics}/KerryRecruit.tex (100%) rename {lyrics => src/lyrics}/MacPhersonsFarewell.tex (100%) rename {lyrics => src/lyrics}/MollyMalone.tex (100%) rename {lyrics => src/lyrics}/MuirsheenDurkin.tex (100%) rename {lyrics => src/lyrics}/NationOnceAgain.tex (100%) rename {lyrics => src/lyrics}/PartingGlass.tex (100%) rename {lyrics => src/lyrics}/RisingOfTheMoon.tex (100%) rename {lyrics => src/lyrics}/SpancilHill.tex (100%) rename {lyrics => src/lyrics}/StarOfTheCountyDown.tex (100%) rename {lyrics => src/lyrics}/WhiskeyInTheJar.tex (100%) rename {lyrics => src/lyrics}/WildRover.tex (100%) rename {scores => src/scores}/AllForMeGrog.ly (87%) rename {scores => src/scores}/AuldLangSyne.ly (100%) rename {scores => src/scores}/BlackVelvetBand.ly (100%) rename {scores => src/scores}/Buergerlied.ly (100%) rename {scores => src/scores}/DrunkenSailor.ly (100%) rename {scores => src/scores}/FinnegansWake.ly (100%) rename {scores => src/scores}/FoggyDew.ly (100%) rename {scores => src/scores}/ImARoverSeldomSober.ly (100%) rename {scores => src/scores}/IrishRover.ly (100%) rename {scores => src/scores}/JohnnyIHardlyKnewYe.ly (100%) rename {scores => src/scores}/KerryRecruit.ly (100%) rename {scores => src/scores}/MacPhersonsFarewell.ly (100%) rename {scores => src/scores}/MollyMalone.ly (100%) rename {scores => src/scores}/MuirsheenDurkin.ly (100%) rename {scores => src/scores}/NationOnceAgain.ly (100%) rename {scores => src/scores}/PartingGlass.ly (100%) rename {scores => src/scores}/RisingOfTheMoon.ly (100%) rename {scores => src/scores}/SpancilHill.ly (100%) rename {scores => src/scores}/StarOfTheCountyDown.ly (100%) rename {scores => src/scores}/WhiskeyInTheJar.ly (100%) rename {scores => src/scores}/WildRover.ly (100%) rename settings.tex => src/settings.tex (100%) rename singalongs.tex => src/singalongs.tex (98%) rename title.tex => src/title.tex (86%) diff --git a/.gitignore b/.gitignore index ec7df04..539b41a 100755 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ -*.pdf *~ *.*~ -out/* -pdf/* -revision.tex +out/ +pdf/ +midi/ +music/ .DS_Store diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cbd46f0 --- /dev/null +++ b/Makefile @@ -0,0 +1,99 @@ +SHELL = /bin/sh + +MIDITEMPO = 120 + +LILYPOND = lilypond +LUALATEX = lualatex +MAKEINDEX = makeindex +TIMIDITY = timidity +OPUSENC = opusenc +PDF2PS = pdf2ps +PSBOOK = psbook +PSTOPS = pstops +PSNUP = psnup +PS2PDF = ps2pdf +SED = sed +RM = rm +MKDIR = mkdir +CD = cd +CP = cp + +SRCDIR = src +OUTDIR = out +PDFDIR = pdf +MIDIDIR = midi +OPUSDIR = music +SCORESDIR = $(SRCDIR)/scores +LYRICSDIR = $(SRCDIR)/lyrics + +OUTPUTFILE = $(OUTDIR)/singalongs.tex + +SCORES = $(wildcard $(SCORESDIR)/*.ly) +PDFS = $(patsubst %.ly,$(PDFDIR)/%.pdf,$(notdir $(SCORES))) +MIDIS = $(patsubst %.ly,$(MIDIDIR)/%.midi,$(notdir $(SCORES))) +OPUSFILES = $(patsubst %.ly,$(OPUSDIR)/%.opus,$(notdir $(SCORES))) + +LILYPONDSUBST = $(foreach score,$(SCORES), \\\\chapter {$(shell grep title "$(score)" | awk -F '"|"' '{print $$2}')} \\\\includely[staffsize=18]{$(abspath $(score))} ~\\\\\\\\ ~\\\\\\\\ \\\\input{$(abspath $(LYRICSDIR)/$(notdir $(basename $(score)))).tex}) + +BOOKPDF = $(PDFDIR)/book.pdf +BOOKLETPDF = $(PDFDIR)/booklet.pdf + +all: pdfs midis opus book booklet + +pdfs: $(PDFS) + +midis: pdfs $(MIDIS) + +opus: midis $(OPUSFILES) + +book: $(BOOKPDF) + +booklet: $(BOOKLETPDF) + +$(BOOKPDF): | $(PDFDIR) $(OUTDIR) + @$(CP) $(SRCDIR)/*.tex $(OUTDIR)/ + @$(CP) -r lib/* $(OUTDIR)/ + @$(CP) -r $(SRCDIR)/images $(OUTDIR)/images + + @$(SED) "s;\musicbooklet;$(LILYPONDSUBST);g" $(SRCDIR)/singalongs.tex > $(OUTPUTFILE) + @$(SED) -i '' 's;\input{revision.tex};\newcommand{\\revision}{ $(shell git log -1 --format="%h") };g' $(OUTPUTFILE) + + @$(CD) $(OUTDIR); \ + $(LUALATEX) -shell-escape singalongs.tex; \ + $(MAKEINDEX) singalongs.tex; \ + $(LUALATEX) -shell-escape singalongs.tex + + @$(CP) $(OUTDIR)/singalongs.pdf $(PDFDIR)/$(@F) + +$(BOOKLETPDF): $(BOOKPDF) + $(PDF2PS) $(BOOKPDF) - | $(PSBOOK) | $(PSTOPS) -pa4 '1:0@1.0(-1.25cm,0cm)' | $(PSNUP) -2 | $(PS2PDF) - $(PDFDIR)/$(@F) + +$(PDFDIR)/%.pdf: $(SCORESDIR)/%.ly | $(PDFDIR) $(OUTDIR) + @$(SED) 's/%title/title/g' $< > $(OUTDIR)/$(notdir $<) + @$(SED) -i '' 's/\header {/\paper{indent=0\\mm} \\header { tagline=""/g' $(OUTDIR)/$(notdir $<) + @$(LILYPOND) --output=$(PDFDIR)/$(basename $(@F)) $(OUTDIR)/$(notdir $<) + +$(MIDIDIR)/%.midi: $(SCORESDIR)/%.ly | $(MIDIDIR) $(OUTDIR) + @$(SED) 's/\layout { }/\midi{ \\tempo 4 = $(MIDITEMPO) }/g' $< > $(OUTDIR)/$(notdir $<) + @$(SED) -i '' 's/\header/\include "articulate.ly" \\header/g' $(OUTDIR)/$(notdir $<) + @$(SED) -i '' 's/< 1 else 'build' - globals()[action]() diff --git a/headfoot.tex b/src/headfoot.tex similarity index 100% rename from headfoot.tex rename to src/headfoot.tex diff --git a/images/title.png b/src/images/title.png similarity index 100% rename from images/title.png rename to src/images/title.png diff --git a/lyrics/AllForMeGrog.tex b/src/lyrics/AllForMeGrog.tex similarity index 100% rename from lyrics/AllForMeGrog.tex rename to src/lyrics/AllForMeGrog.tex diff --git a/lyrics/AuldLangSyne.tex b/src/lyrics/AuldLangSyne.tex similarity index 100% rename from lyrics/AuldLangSyne.tex rename to src/lyrics/AuldLangSyne.tex diff --git a/lyrics/BlackVelvetBand.tex b/src/lyrics/BlackVelvetBand.tex similarity index 100% rename from lyrics/BlackVelvetBand.tex rename to src/lyrics/BlackVelvetBand.tex diff --git a/lyrics/Buergerlied.tex b/src/lyrics/Buergerlied.tex similarity index 100% rename from lyrics/Buergerlied.tex rename to src/lyrics/Buergerlied.tex diff --git a/lyrics/DrunkenSailor.tex b/src/lyrics/DrunkenSailor.tex similarity index 100% rename from lyrics/DrunkenSailor.tex rename to src/lyrics/DrunkenSailor.tex diff --git a/lyrics/FinnegansWake.tex b/src/lyrics/FinnegansWake.tex similarity index 100% rename from lyrics/FinnegansWake.tex rename to src/lyrics/FinnegansWake.tex diff --git a/lyrics/FoggyDew.tex b/src/lyrics/FoggyDew.tex similarity index 100% rename from lyrics/FoggyDew.tex rename to src/lyrics/FoggyDew.tex diff --git a/lyrics/ImARoverSeldomSober.tex b/src/lyrics/ImARoverSeldomSober.tex similarity index 100% rename from lyrics/ImARoverSeldomSober.tex rename to src/lyrics/ImARoverSeldomSober.tex diff --git a/lyrics/IrishRover.tex b/src/lyrics/IrishRover.tex similarity index 100% rename from lyrics/IrishRover.tex rename to src/lyrics/IrishRover.tex diff --git a/lyrics/JohnnyIHardlyKnewYe.tex b/src/lyrics/JohnnyIHardlyKnewYe.tex similarity index 100% rename from lyrics/JohnnyIHardlyKnewYe.tex rename to src/lyrics/JohnnyIHardlyKnewYe.tex diff --git a/lyrics/KerryRecruit.tex b/src/lyrics/KerryRecruit.tex similarity index 100% rename from lyrics/KerryRecruit.tex rename to src/lyrics/KerryRecruit.tex diff --git a/lyrics/MacPhersonsFarewell.tex b/src/lyrics/MacPhersonsFarewell.tex similarity index 100% rename from lyrics/MacPhersonsFarewell.tex rename to src/lyrics/MacPhersonsFarewell.tex diff --git a/lyrics/MollyMalone.tex b/src/lyrics/MollyMalone.tex similarity index 100% rename from lyrics/MollyMalone.tex rename to src/lyrics/MollyMalone.tex diff --git a/lyrics/MuirsheenDurkin.tex b/src/lyrics/MuirsheenDurkin.tex similarity index 100% rename from lyrics/MuirsheenDurkin.tex rename to src/lyrics/MuirsheenDurkin.tex diff --git a/lyrics/NationOnceAgain.tex b/src/lyrics/NationOnceAgain.tex similarity index 100% rename from lyrics/NationOnceAgain.tex rename to src/lyrics/NationOnceAgain.tex diff --git a/lyrics/PartingGlass.tex b/src/lyrics/PartingGlass.tex similarity index 100% rename from lyrics/PartingGlass.tex rename to src/lyrics/PartingGlass.tex diff --git a/lyrics/RisingOfTheMoon.tex b/src/lyrics/RisingOfTheMoon.tex similarity index 100% rename from lyrics/RisingOfTheMoon.tex rename to src/lyrics/RisingOfTheMoon.tex diff --git a/lyrics/SpancilHill.tex b/src/lyrics/SpancilHill.tex similarity index 100% rename from lyrics/SpancilHill.tex rename to src/lyrics/SpancilHill.tex diff --git a/lyrics/StarOfTheCountyDown.tex b/src/lyrics/StarOfTheCountyDown.tex similarity index 100% rename from lyrics/StarOfTheCountyDown.tex rename to src/lyrics/StarOfTheCountyDown.tex diff --git a/lyrics/WhiskeyInTheJar.tex b/src/lyrics/WhiskeyInTheJar.tex similarity index 100% rename from lyrics/WhiskeyInTheJar.tex rename to src/lyrics/WhiskeyInTheJar.tex diff --git a/lyrics/WildRover.tex b/src/lyrics/WildRover.tex similarity index 100% rename from lyrics/WildRover.tex rename to src/lyrics/WildRover.tex diff --git a/scores/AllForMeGrog.ly b/src/scores/AllForMeGrog.ly similarity index 87% rename from scores/AllForMeGrog.ly rename to src/scores/AllForMeGrog.ly index e660b6c..79b5b0c 100644 --- a/scores/AllForMeGrog.ly +++ b/src/scores/AllForMeGrog.ly @@ -12,7 +12,7 @@ global = { chordNames = \chordmode { \global - s8 g1 c2 g1. d1 g1 c2 g1 d2 d2:7 g4. + s8 g1 c2 g1. d1 g1 c2 g1 d2 d2:7 g4. } melody = \relative d' { @@ -25,7 +25,7 @@ melody = \relative d' { d(e) d b g4 g8 fis | e a g e d4 g8 a | b d c b b a g fis | - a2 g4( g8) \bar "|." + a2 g4( g8) \bar "|." } \score { diff --git a/scores/AuldLangSyne.ly b/src/scores/AuldLangSyne.ly similarity index 100% rename from scores/AuldLangSyne.ly rename to src/scores/AuldLangSyne.ly diff --git a/scores/BlackVelvetBand.ly b/src/scores/BlackVelvetBand.ly similarity index 100% rename from scores/BlackVelvetBand.ly rename to src/scores/BlackVelvetBand.ly diff --git a/scores/Buergerlied.ly b/src/scores/Buergerlied.ly similarity index 100% rename from scores/Buergerlied.ly rename to src/scores/Buergerlied.ly diff --git a/scores/DrunkenSailor.ly b/src/scores/DrunkenSailor.ly similarity index 100% rename from scores/DrunkenSailor.ly rename to src/scores/DrunkenSailor.ly diff --git a/scores/FinnegansWake.ly b/src/scores/FinnegansWake.ly similarity index 100% rename from scores/FinnegansWake.ly rename to src/scores/FinnegansWake.ly diff --git a/scores/FoggyDew.ly b/src/scores/FoggyDew.ly similarity index 100% rename from scores/FoggyDew.ly rename to src/scores/FoggyDew.ly diff --git a/scores/ImARoverSeldomSober.ly b/src/scores/ImARoverSeldomSober.ly similarity index 100% rename from scores/ImARoverSeldomSober.ly rename to src/scores/ImARoverSeldomSober.ly diff --git a/scores/IrishRover.ly b/src/scores/IrishRover.ly similarity index 100% rename from scores/IrishRover.ly rename to src/scores/IrishRover.ly diff --git a/scores/JohnnyIHardlyKnewYe.ly b/src/scores/JohnnyIHardlyKnewYe.ly similarity index 100% rename from scores/JohnnyIHardlyKnewYe.ly rename to src/scores/JohnnyIHardlyKnewYe.ly diff --git a/scores/KerryRecruit.ly b/src/scores/KerryRecruit.ly similarity index 100% rename from scores/KerryRecruit.ly rename to src/scores/KerryRecruit.ly diff --git a/scores/MacPhersonsFarewell.ly b/src/scores/MacPhersonsFarewell.ly similarity index 100% rename from scores/MacPhersonsFarewell.ly rename to src/scores/MacPhersonsFarewell.ly diff --git a/scores/MollyMalone.ly b/src/scores/MollyMalone.ly similarity index 100% rename from scores/MollyMalone.ly rename to src/scores/MollyMalone.ly diff --git a/scores/MuirsheenDurkin.ly b/src/scores/MuirsheenDurkin.ly similarity index 100% rename from scores/MuirsheenDurkin.ly rename to src/scores/MuirsheenDurkin.ly diff --git a/scores/NationOnceAgain.ly b/src/scores/NationOnceAgain.ly similarity index 100% rename from scores/NationOnceAgain.ly rename to src/scores/NationOnceAgain.ly diff --git a/scores/PartingGlass.ly b/src/scores/PartingGlass.ly similarity index 100% rename from scores/PartingGlass.ly rename to src/scores/PartingGlass.ly diff --git a/scores/RisingOfTheMoon.ly b/src/scores/RisingOfTheMoon.ly similarity index 100% rename from scores/RisingOfTheMoon.ly rename to src/scores/RisingOfTheMoon.ly diff --git a/scores/SpancilHill.ly b/src/scores/SpancilHill.ly similarity index 100% rename from scores/SpancilHill.ly rename to src/scores/SpancilHill.ly diff --git a/scores/StarOfTheCountyDown.ly b/src/scores/StarOfTheCountyDown.ly similarity index 100% rename from scores/StarOfTheCountyDown.ly rename to src/scores/StarOfTheCountyDown.ly diff --git a/scores/WhiskeyInTheJar.ly b/src/scores/WhiskeyInTheJar.ly similarity index 100% rename from scores/WhiskeyInTheJar.ly rename to src/scores/WhiskeyInTheJar.ly diff --git a/scores/WildRover.ly b/src/scores/WildRover.ly similarity index 100% rename from scores/WildRover.ly rename to src/scores/WildRover.ly diff --git a/settings.tex b/src/settings.tex similarity index 100% rename from settings.tex rename to src/settings.tex diff --git a/singalongs.tex b/src/singalongs.tex similarity index 98% rename from singalongs.tex rename to src/singalongs.tex index f6aaee8..4e9de30 100644 --- a/singalongs.tex +++ b/src/singalongs.tex @@ -8,6 +8,7 @@ \usepackage{geometry} \usepackage[unicode]{hyperref} \usepackage{multicol} +\usepackage{lyluatex} \input{revision.tex} \input{settings.tex} @@ -45,4 +46,3 @@ \musicbooklet \end{document} - diff --git a/title.tex b/src/title.tex similarity index 86% rename from title.tex rename to src/title.tex index 0f87436..aa888d3 100644 --- a/title.tex +++ b/src/title.tex @@ -10,7 +10,7 @@ \begin{minipage}{0.5\textwidth} \begin{flushleft} \large \emph{Project Website:} \\ - \href{https://code.vanwa.ch/shu/sing-alongs}{code.vanwa.ch/shu/sing-alongs} \\ + \href{https://code.vanwa.ch/sing-alongs}{code.vanwa.ch/sing-alongs} \\ \end{flushleft} \end{minipage} \begin{minipage}{0.4\textwidth}