#! gnumake
#

HEAD = chapter10

EPS = ch10_3pi_energybcal2.eps ch10_etax_energybcal.eps ch10_3pi_energylg.eps ch10_etay_energybcal.eps ch10_acceptGJ_eta3pi.eps ch10_lost_event.eps ch10_acceptGJ_eta_piz_piz.eps ch10_mass_accept.eps ch10_acceptGJ_omega_piz_pip.eps ch10_mcflow.eps ch10_acceptGJ_pip_pip_pim.eps ch10_rho.eps ch10_delta_energybcal2.eps ch10_total.eps ch10_dataflow.eps

DOC  = chapter10.tex ch10_main.tex ch10_acceptance.tex ch10_frame.tex ch10_geometry.tex ch10_hdfast.tex ch10_hdgeant.tex ch10_main.tex ch10_mcgen.tex ch10_resolution.tex ch10_weights.tex chapter10.bbl

CNT  = halld.bib standard_symbols.tex

chapter:
	cp -pf ../halld.bib halld.bib
	cp -pf ../standard_symbols.tex standard_symbols.tex
	latex $(HEAD).tex	
	latex $(HEAD).tex	
	dvips -o $(HEAD).ps $(HEAD).dvi
	ps2pdf $(HEAD).ps $(HEAD).pdf
	rm -f $(HEAD).ps.gz
	gzip  $(HEAD).ps

bibliography:
	cp -pf ../halld.bib halld.bib
	cp -pf ../standard_symbols.tex standard_symbols.tex
	rm -f $(HEAD).bbl
	rm -f $(HEAD).blg
	latex $(HEAD).tex
	bibtex $(HEAD)	
	latex $(HEAD).tex	

tarball:
	rm -f $(HEAD).tar.gz
	rm -f $(HEAD).zip
	cp -pf ../halld.bib halld.bib
	cp -pf ../standard_symbols.tex standard_symbols.tex
	tar cfz $(HEAD).tar.gz $(DOC) $(CNT) $(EPS) Makefile
	zip $(HEAD).zip $(DOC) $(CNT) $(EPS) Makefile
	@rm -f halld.bib standard_symbols.tex

distclean:
	@rm -f *.dvi *.ps *.pdf *~ *.aux *.log *.lot *.lof *.gz *.toc *.zip
	@rm -f *.blg
	@rm -f halld.bib standard_symbols.tex

clean:
	@rm -f *.dvi *.ps *~ *.aux *.log *.lot *.lof *.toc *.blg
	@rm -f halld.bib standard_symbols.tex
