tamm: add Darren as author
[ti-agile-manual/ti-agile-manual.git] / Makefile
index 0339567f1a8dea5b9ee0346d0f44f8eb18f35667..273acf9113db1732aedf8a55938e0e990328c29c 100644 (file)
--- 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
 
 all: pdf
 
-pdf:
-       pdflatex ti-agile.tex
-       bibtex ti-agile.aux
-       pdflatex ti-agile.tex
-       pdflatex ti-agile.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.pdf
+view: $(PDF)
+       $(QUIET_VIEW) $(VIEWER) $(PDF)
 
 clean:
 
 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