all : pubs.html bib.html pm.zip annotes.html

all_cp : all abstract_vis.js linkify_bib.awk makefile pubshead.html pubstail.html \
				pdf_icon.gif ps_icon.gif pubs.css
	cp pubs.html bib.html abstract_vis.js pubs.css ASCIIMathML.js pm.zip annotes.html \
				othersp.html ../web

pubs.aux : pubs.tex
	rm -rf pubs.bbl; latex pubs

pubs.html : me.bib pubs.aux unsrt_htm.bst pubshead.html pubstail.html
	bibtex pubs
	cat pubs.bbl | sed "s/two papers above/two papers below/"  > tmp$$.html
	cat pubshead.html tmp$$.html pubstail.html > pubs.html
	rm tmp$$.html

bib.html : me.bib linkify_bib.awk
	cat me.bib | awk -f linkify_bib.awk  > bib.html

pm.zip : pubs.tex me.bib annotes.aux pubs.css abstract_vis.js unsrt_htm.bst \
			linkify_bib.awk makefile pubshead.html pubstail.html pdf_icon.gif \
			ps_icon.gif pubs.css annotes.bib annoteshead.html alpha_htm.bst othersp.bib \
			ASCIIMathML.js
	zip pm.zip pubs.tex me.bib pubs.css abstract_vis.js unsrt_htm.bst \
		linkify_bib.awk makefile pubshead.html pubstail.html pdf_icon.gif \
		ps_icon.gif annotes.aux annotes.bib annoteshead.html alpha_htm.bst \
		ASCIIMathML.js othersp.bib

annotes.html : annotes.aux annotes.bib annoteshead.html alpha_htm.bst othersp.bib
	bibtex annotes
	cat annoteshead.html annotes.bbl > annotes.html







cite_me.tex : me.bib
	cat me.bib | grep ^@ me.bib | grep -v string | sed 's/@.*{//' | sed 's/,//' | awk '{printf("\\nocite{me}{%s}\n", $$1);}' | grep -v "{enets}" > cite_me.tex


pers.pdf : pers.aux me.bbl notme.bbl cite_me.tex
	pdflatex pers


pers.aux notme.aux : pers.tex cite_me.tex me_c.bib othersp_c.bib
	pdflatex pers

me_c.bib : me.bib
	cat me.bib | sed "s/\`/$$/g" > me_c.bib

othersp_c.bib : othersp.bib
	cat othersp.bib | sed "s/\`/$$/g" > othersp_c.bib

me.bbl : pers.tex me.aux me.bib
	bibtex me

notme.bbl othersp.html : pers.tex notme.aux
	bibtex notme
	cat notme.aux | sed 's/salpha/alpha_htm/' > notme_f.aux
	bibtex notme_f
	cat othersphead.html notme_f.bbl othersptail.html > othersp.html


clean	:
	rm -rf pubs.html pubs.bbl pubslong.html bib.html pm.zip annotes.bbl annotes.html
