UNAME = $(shell uname) BIBTEX ?=bibtex VIEWER ?=xpdf # acroread may be a better choice as a viewer # Uncommment MAKEINDEX definition if you are putting an index in your document # MAKEINDEX=makeindex # LATEX may be set to pdflatex or to latex # Here, I default to pdflatex on Max OS X, but latex otherwise. ifeq (${UNAME},Darwin) LATEX ?= pdflatex else LATEX ?=latex endif # If using latex rather than pdflatex, need conversion programs # through dvi and postscript: DVIPS ?=dvips PS2PDF ?=distill # Three choices for PS2PDF: # distill (run on ${DISTILL_HOST} if not available on this machine) # ps2pdf # pstill DISTILL_HOST ?= sundance # Generally # LATEX=latex PS2PDF=distill produces the smallest .pdf files # and accepts the most graphics types, but is slow to run. # LATEX=pdflatex is the quickest to run # LATEX=latex PS2PDF=ps2pdf produces larger files then pdflatex, # but can handle more graphics file types # LATEX=latex PS2PDF=pstill produces the largest pdf files ifeq (${LATEX},pdflatex) # construction using pdflatex %.pdf: %.tex ${LATEX} $< ifdef BIBTEX ${BIBTEX} $(<:.tex=) ${LATEX} $< endif ifdef $(MAKEINDEX) $(MAKEINDEX) $< ${LATEX} $< endif ${LATEX} $< else ifeq (${LATEX},latex) # construction using latex, dvips, and either ps2pdf or distill %.dvi: %.tex -${LATEX} $< ifdef BIBTEX ${BIBTEX} $(<:.tex=) ${LATEX} $< endif -${LATEX} $< %.ps: %.dvi dvips $* -D 600 -tletter -Ppdf -o $@ DISTILL_PARAM = -colorres 600 -grayres 600 -monores 600 ifeq (${PS2PDF},distill) ifneq ($(wildcard /usr/local/bin/distill*),) $(warning Using distiller at $(wildcard /usr/local/bin/distill*)) %.pdf: %.ps distill ${DISTILL_PARAM} $^ else $(warning No distill, trying ssh to ${DISTILL_HOST}) HERE := $(shell pwd) %.pdf: %.ps ssh -nTxv ${DISTILL_HOST} 'cd ${HERE}; distill ${DISTILL_PARAM} $^' endif else ifeq (${PS2PDF},pstill) PSTILL_PATH ?= /usr/local/pstill_dist ifeq ($(wildcard ${PSTILL_PATH}*),) PSTILL_PATH:= ${PCPR}/pstill_dist endif $(warning Using ${PSTILL_PATH}/pstill) %.pdf: %.ps set PSTILL_PATH=${PSTILL_PATH} ; ${PSTILL_PATH}/pstill -gip -o $@ $^ %.pdf: %.eps set PSTILL_PATH=${PSTILL_PATH} ; ${PSTILL_PATH}/pstill -gip -o $@ $^ else $(warning Using ${PS2PDF}) %.pdf: %.ps ${PS2PDF} $< $@ endif endif endif endif clean: -rm -f *.aux *.log *.blg *.bbl *~ %.eps: %.gnuplot echo "set terminal postscript eps color" \ | cat - $< \ | gnuplot \ >$@ %.pdf: %.gnuplot echo "set terminal pdf color" \ | cat - $< \ | gnuplot \ >$@ ifeq (${UNAME},Darwin) # NOTE: Mac OS X does not have "convert" installed to generate png # from pdf # This PNG generation technique is specific to Mac OS X: %.png: %.pdf qlmanage -t -s 1000 -o . $^ mv $^.png $@ else %.png: %.pdf convert -sample 600 $< $@ %.pdf: %.eps convert $< $@ %.eps: %.jpg convert -sample 1200 $< $@ endif