# $Id: Makefile,v 1.4 2008/10/01 22:36:29 pasyuk Exp $
#
# Makefile to latex document, uncompress .ps files etc...
# original version : Mark Ito
# modified:
#     use for g1c piplus paper - EAP July/2008
#
#
#TEX_FILES_0 = PID_and_yield SAID_analysis acceptance authorList conclusion \
#              data_reduction experiment introduction normalization \
#              piplusPaper references res_parameters results \
#              uncertainties

TEX_FILES = $(addsuffix .tex,$(TEX_FILES_0)) # add .tex suffix

#EPS_FILES_0 = pho_time2 pid_all fcut_show mm one_fit_pic fit.1400 aa01M \
#              aa02M aa03M aa04M fig5a fig5b fig6a fig6b fig6c eff_unc \
#              sector_dcs_800 thrown bin_mig_est \
#              y2aM y2eM y2gM y2hM y2oM y2pM \
#              y2wM y2xM y2cM y2kM y2mM y2nM y2tM y2uM y2vM y22M y23M \
#              bump_show1 bump_show2 acc_1025_7

EPS_FILES = $(addsuffix .eps,$(EPS_FILES_0)) # add .eps suffix

PS_FILES = $(addsuffix .ps,$(PS_FILES_0)) # add .ps suffix

all: fields1 fields1.ps fields1.pdf

fields1.dvi : $(TEX_FILES) $(PS_FILES) $(EPS_FILES) # make the dvi file
	latex fields1
	latex fields1

%.ps : %.dvi
	dvips -t letter -o $*.ps $*

fields1.pdf : fields1.ps
	ps2pdf fields1.ps

%.dvi : %.tex
	latex $*
	latex $*

%.eps : %.eps.gz
	gunzip -l $*.eps.gz
	rm -f $*.eps
	gunzip -c $*.eps.gz > $*.eps

%.ps : %.ps.gz
	gunzip -l $*.ps.gz
	rm -f $*.ps
	gunzip -c $*.ps.gz > $*.ps

#
#
% : %.dvi
	@rm -rf $*
#	latex2html $*      # produce html pages



clean: 
	-rm -f fields1.log 
	-rm -f fields1.dvi 
	-rm -f fields1.ps 
	-rm -f fields1.pdf
