From: Felipe Balbi Date: Fri, 12 Apr 2013 13:33:52 +0000 (+0300) Subject: Makefile improvements X-Git-Url: https://git.ti.com/gitweb?p=ti-agile-manual%2Fti-agile-manual.git;a=commitdiff_plain;h=d720632aeb223de652ca6935fc286c5f1d2da949;hp=6f472b3d6c9a96ddc55467010696a394fd6bcbf3 Makefile improvements Output is a lot more terse and running make multiple times won't remake if it's not necessary to. Signed-off-by: Felipe Balbi --- diff --git a/Makefile b/Makefile index 8679222..273acf9 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,32 @@ +PDFLATEX ?= $(shell which pdflatex) +BIBTEX ?= $(shell which bibtex) +VIEWER ?= $(shell which evince) + +OPTS = -halt-on-error -file-line-error \ + -interaction=batchmode + +SOURCE = ti-agile-methodology-manual.tex +PDF = $(SOURCE:.tex=.pdf) + +V = @ +Q = $(V:1=) +QUIET_BIBTEX = $(Q:@=@echo ' BIBTEX '$@;) +QUIET_LATEX = $(Q:@=@echo ' LATEX '$@;) +QUIET_CLEAN = $(Q:@=@echo ' CLEAN '$@;) +QUIET_VIEW = $(Q:@=@echo ' VIEW '$@;) + all: pdf -pdf: - pdflatex ti-agile-methodology-manual.tex - bibtex ti-agile-methodology-manual.aux - pdflatex ti-agile-methodology-manual.tex - pdflatex ti-agile-methodology-manual.tex +pdf: $(PDF) + +$(PDF): $(SOURCE) + $(QUIET_LATEX) $(PDFLATEX) $(OPTS) $< + $(QUIET_BIBTEX) $(BIBTEX) $(<:.tex=.aux) + $(QUIET_LATEX) $(PDFLATEX) $(OPTS) $< + $(QUIET_LATEX) $(PDFLATEX) $(OPTS) $< -view: pdf - evince ti-agile-methodology-manual.pdf +view: $(PDF) + $(QUIET_VIEW) $(VIEWER) $(PDF) clean: - @rm -f *.log *.aux *.lot *.lof *.toc *.tex~ *.pdf *.out *.idx *.href *.url *.bbl *.blg + $(QUIET_CLEAN) rm -f *.log *.aux *.lot *.lof *.toc *.tex~ *.pdf *.out *.idx *.href *.url *.bbl *.blg