47 lines
1.3 KiB
Makefile
47 lines
1.3 KiB
Makefile
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"`
|
|
|
|
all: book booklet
|
|
|
|
book: $(OUTDIR) $(PDFDIR) $(GITINFO)
|
|
python assemble.py > $(OUTDIR)/$(FILE).lytex
|
|
cp lilysettings.ly $(OUTDIR)/
|
|
cp headfoot.tex $(OUTDIR)/
|
|
cp settings.tex $(OUTDIR)/
|
|
cp -r images/ $(OUTDIR)/
|
|
cp $(GITINFO) $(OUTDIR)/
|
|
$(LILY_PDF) $(OUTDIR)/$(FILE).lytex
|
|
$(PDF)
|
|
$(INDEX)
|
|
$(PDF)
|
|
cp $(CURDIR)/$(OUTDIR)/$(FILE).pdf $(CURDIR)/$(PDFDIR)/$(FILE).pdf
|
|
rm $(GITINFO)
|
|
|
|
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
|
|
|
|
$(OUTDIR):
|
|
mkdir -p $(OUTDIR)
|
|
|
|
$(PDFDIR):
|
|
mkdir -p $(PDFDIR)
|
|
|
|
$(GITINFO): FORCE
|
|
/bin/echo "\\newcommand{\\revision}{$(REVISIONINFO)}" > $(GITINFO)
|
|
|
|
clean:
|
|
rm -rf $(OUTDIR)
|
|
|
|
FORCE:
|