From 1284a2fd08f8e41c86ad3bd667077998c11e1a0a Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Mon, 8 Apr 2013 20:41:38 +0200 Subject: [PATCH] Cleaned up the Makefile. revision.tex now gets removed after a successful build. --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a729e92..fc33a92 100644 --- a/Makefile +++ b/Makefile @@ -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)