45 lines
871 B
Makefile
45 lines
871 B
Makefile
OUTDIR=out
|
|
PDFDIR=pdf
|
|
FILE = music_booklet
|
|
GITINFO=revision.tex
|
|
LILY_PDF = lilypond-book --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"`
|
|
|
|
.SUFFIXES: .lytex .tex .ly .pdf
|
|
|
|
VPATH = \
|
|
$(CURDIR)/lyrics \
|
|
$(CURDIR)/notes \
|
|
$(CURDIR)/pdf \
|
|
|
|
all: book
|
|
|
|
book: $(OUTDIR) $(PDFDIR) $(GITINFO)
|
|
cp headfoot.tex $(OUTDIR)/
|
|
cp settings.tex $(OUTDIR)/
|
|
cp -r license/ $(OUTDIR)/
|
|
cp -r images/ $(OUTDIR)/
|
|
cp $(GITINFO) $(OUTDIR)/
|
|
$(LILY_PDF) $(FILE).lytex
|
|
$(PDF)
|
|
$(INDEX)
|
|
$(PDF)
|
|
cp $(CURDIR)/$(OUTDIR)/$(FILE).pdf $(CURDIR)/$(PDFDIR)/$(FILE).pdf
|
|
rm $(GITINFO)
|
|
|
|
$(OUTDIR):
|
|
mkdir -p $(OUTDIR)
|
|
|
|
$(PDFDIR):
|
|
mkdir -p $(PDFDIR)
|
|
|
|
$(GITINFO): FORCE
|
|
/bin/echo "\\newcommand{\\revision}{$(REVISIONINFO)}" > $(GITINFO)
|
|
|
|
clean:
|
|
rm -rf $(OUTDIR)
|
|
|
|
FORCE:
|