2012-11-14 09:31:44 +00:00
|
|
|
OUTDIR=out
|
|
|
|
PDFDIR=pdf
|
2013-08-12 18:14:29 +00:00
|
|
|
FILE = singalongs
|
2013-04-08 18:41:38 +00:00
|
|
|
GITINFO=revision.tex
|
2013-04-17 14:32:28 +00:00
|
|
|
LILY_PDF = lilypond-book --process="lilypond -dinclude-settings=lilysettings.ly" --pdf -o $(OUTDIR)
|
2013-04-08 08:13:07 +00:00
|
|
|
PDF=cd $(OUTDIR) && pdflatex --enable-pipes --shell-escape $(FILE).tex
|
2012-12-26 03:12:55 +00:00
|
|
|
INDEX=cd $(OUTDIR) && makeindex $(FILE).tex
|
2013-04-11 14:06:47 +00:00
|
|
|
REVISIONINFO = `git log -1 --format="%h"`
|
2012-11-14 09:31:44 +00:00
|
|
|
|
2013-08-08 22:01:04 +00:00
|
|
|
all: book booklet
|
2012-11-14 09:31:44 +00:00
|
|
|
|
2013-04-08 18:41:38 +00:00
|
|
|
book: $(OUTDIR) $(PDFDIR) $(GITINFO)
|
2013-08-12 18:14:29 +00:00
|
|
|
python assemble.py > $(OUTDIR)/$(FILE).lytex
|
2013-04-17 14:32:28 +00:00
|
|
|
cp lilysettings.ly $(OUTDIR)/
|
2012-11-14 09:31:44 +00:00
|
|
|
cp headfoot.tex $(OUTDIR)/
|
2013-03-07 14:42:26 +00:00
|
|
|
cp settings.tex $(OUTDIR)/
|
2012-11-14 09:31:44 +00:00
|
|
|
cp -r images/ $(OUTDIR)/
|
2013-04-11 09:06:25 +00:00
|
|
|
cp $(GITINFO) $(OUTDIR)/
|
2013-08-12 18:14:29 +00:00
|
|
|
$(LILY_PDF) $(OUTDIR)/$(FILE).lytex
|
2012-11-14 09:31:44 +00:00
|
|
|
$(PDF)
|
|
|
|
$(INDEX)
|
|
|
|
$(PDF)
|
|
|
|
cp $(CURDIR)/$(OUTDIR)/$(FILE).pdf $(CURDIR)/$(PDFDIR)/$(FILE).pdf
|
2013-04-11 13:47:13 +00:00
|
|
|
rm $(GITINFO)
|
|
|
|
|
2013-08-08 22:01:04 +00:00
|
|
|
booklet: book
|
|
|
|
pdf2ps $(OUTDIR)/$(FILE).pdf $(OUTDIR)/$(FILE).ps
|
|
|
|
psbook $(OUTDIR)/$(FILE).ps $(OUTDIR)/booklet_tmp.ps
|
|
|
|
pstops -pA4 '1:0@1.0(0cm,0cm)' $(OUTDIR)/booklet_tmp.ps $(OUTDIR)/booklet_tmp00.ps
|
|
|
|
psnup -2 $(OUTDIR)/booklet_tmp00.ps $(OUTDIR)/booklet.ps
|
|
|
|
ps2pdf $(OUTDIR)/booklet.ps $(OUTDIR)/$(FILE)_booklet.pdf
|
|
|
|
cp $(CURDIR)/$(OUTDIR)/$(FILE)_booklet.pdf $(CURDIR)/$(PDFDIR)/$(FILE)_booklet.pdf
|
|
|
|
|
2012-11-14 09:31:44 +00:00
|
|
|
$(OUTDIR):
|
|
|
|
mkdir -p $(OUTDIR)
|
|
|
|
|
|
|
|
$(PDFDIR):
|
|
|
|
mkdir -p $(PDFDIR)
|
2013-04-11 13:47:13 +00:00
|
|
|
|
|
|
|
$(GITINFO): FORCE
|
2013-04-15 13:07:24 +00:00
|
|
|
/bin/echo "\\newcommand{\\revision}{$(REVISIONINFO)}" > $(GITINFO)
|
2012-11-14 09:31:44 +00:00
|
|
|
|
|
|
|
clean:
|
2013-04-11 13:56:38 +00:00
|
|
|
rm -rf $(OUTDIR)
|
2013-04-11 13:47:13 +00:00
|
|
|
|
|
|
|
FORCE:
|