Cleaned up the Makefile.

revision.tex now gets removed after a successful build.
This commit is contained in:
Sebastian Hugentobler 2013-04-08 20:41:38 +02:00
parent ec49f099af
commit 1284a2fd08

View File

@ -1,6 +1,7 @@
OUTDIR=out
PDFDIR=pdf
FILE = sheet-music_tinwhistle
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
@ -14,7 +15,7 @@ VPATH = \
all: book
book: $(OUTDIR) $(PDFDIR) revision.tex
book: $(OUTDIR) $(PDFDIR) $(GITINFO)
cp headfoot.tex $(OUTDIR)/
cp settings.tex $(OUTDIR)/
cp -r license/ $(OUTDIR)/
@ -24,6 +25,7 @@ book: $(OUTDIR) $(PDFDIR) revision.tex
$(INDEX)
$(PDF)
cp $(CURDIR)/$(OUTDIR)/$(FILE).pdf $(CURDIR)/$(PDFDIR)/$(FILE).pdf
rm revision.tex
$(OUTDIR):
mkdir -p $(OUTDIR)
@ -31,9 +33,9 @@ $(OUTDIR):
$(PDFDIR):
mkdir -p $(PDFDIR)
revision.tex:
echo "% Autogenerated, do not edit" > revision.tex
echo "\\newcommand{\\revision}{`git log -1 --format=\"%h\"`}" >> revision.tex
$(GITINFO):
echo "% Autogenerated, do not edit" > $(GITINFO)
echo "\\newcommand{\\revision}{`git log -1 --format=\"%h\"`}" >> $(GITINFO)
clean:
rm -rf $(OUTDIR)