# $Id: Makefile,v 1.16 2006-01-16 01:11:40 eugene Exp $

# WARNING : pdflatex does not do .ps
# 
DO_PDFLATEX = 1
DO_BIBTEX = 1

help:
	@echo "USAGE: make (target)"
	@echo "  targets:  all pdf tgz"

test: test.pdf

all: pdf tgz 
pdf: analysis.pdf

journal: analysis.journal.tgz
arxiv: analysis.arxiv.tgz

quick: analysis.quick.pdf

BIBLIB = ../inputs/lib.bib

PDFPICS = \
pics/peaks.pdf \
pics/FWHM.smooth.trend.ps1.pdf \
pics/radial.profiles.pdf \
pics/moment.class.pdf \
pics/mag.resid.psf.pdf \
pics/mag.resid.aper.pdf \
pics/galaxy.exp.complete.pdf \
pics/galaxy.dev.complete.pdf \
pics/galaxy.exp.params.pdf \
pics/galaxy.dev.params.pdf

PNGPICS = \
pics/peaks.pdf \
pics/FWHM.smooth.trend.ps1.png \
pics/radial.profiles.png \
pics/moment.class.png \
pics/mag.resid.psf.png \
pics/mag.resid.aper.png \
pics/galaxy.exp.complete.png \
pics/galaxy.dev.complete.png \
pics/galaxy.exp.params.png \
pics/galaxy.dev.params.png

FILES = \
../inputs/astro.sty \
../inputs/code.sty \
../inputs/apj.bst \
analysis.tex

pics/%.pdf : pics/%.ps
	echo $^
	echo $<
	echo $@
	echo $*
	ps2pdf -dEPSCrop $< $@

pdfpics: $(PDFPICS)

analysis.pdf: $(FILES) $(BIBLIB) $(PDFPICS)

analysis.journal.tgz: $(FILES) $(PDFPICS) analysis.bbl
analysis.arxiv.tgz: $(FILES) $(PNGPICS) analysis.bbl

include ../Makefile.Common

# generate PDF for editing
# ** set DO_BIBTEX to 1 above
# ** set \picdir to pics in latex file
# ** set \plotext to pdf or png as desired
# ** make pdf (or make quick)

# generate PDF for arxiv
# ** set DO_BIBTEX to 0 above (make sure bbl file was generated earlier)
# ** swap from biblograph{lib} to input bbl in latex file
# ** set \plotext to png
# ** make pdf (confirm PDF file succeeds)

# generate TGZ for arxiv
# ** follow steps above for PDF
# ** set \picdir to . in latex file
# ** make arxiv
# ** test by extracting into local directory 
# ** ltx -pdf analysis

# generate PDF for journal
# ** set DO_BIBTEX to 0 above (make sure bbl file was generated earlier)
# ** swap from biblograph{lib} to input bbl in latex file
# ** set \plotext to pdf
# ** make pdf (confirm PDF file succeeds)

# generate TGZ for journal
# ** follow steps above for PDF
# ** set \picdir to . in latex file
# ** make journal
# ** test by extracting into local directory 
# ** ltx -pdf analysis

