sing-alongs/Makefile

55 lines
1.4 KiB
Makefile
Raw Normal View History

2012-11-14 09:31:44 +00:00
OUTDIR=out
PDFDIR=pdf
FILE = singalongs
GITINFO=revision.tex
LILY_PDF = lilypond-book --process="lilypond -dinclude-settings=lilysettings.ly" --pdf -o $(OUTDIR)
PDF=cd $(OUTDIR) && pdflatex --enable-pipes --shell-escape $(FILE).tex
INDEX=cd $(OUTDIR) && makeindex $(FILE).tex
REVISIONINFO = `git log -1 --format="%h"`
2012-11-14 09:31:44 +00:00
.SUFFIXES: .lytex .tex .ly .pdf
VPATH = \
$(CURDIR)/lyrics \
$(CURDIR)/notes \
$(CURDIR)/pdf \
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
book: $(OUTDIR) $(PDFDIR) $(GITINFO)
python assemble.py > $(OUTDIR)/$(FILE).lytex
cp lilysettings.ly $(OUTDIR)/
2012-11-14 09:31:44 +00:00
cp headfoot.tex $(OUTDIR)/
cp settings.tex $(OUTDIR)/
cp -r license/ $(OUTDIR)/
2012-11-14 09:31:44 +00:00
cp -r images/ $(OUTDIR)/
cp $(GITINFO) $(OUTDIR)/
$(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
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)
$(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)
FORCE: