TARGET = g5user.pdf g5nbuser.pdf g7install.pdf hibref.pdf g5user-j.pdf g5nbuser-j.pdf g7install-j.pdf
FIGS = g7photo.eps 12Vphoto.eps 6pin12Vphoto.eps usbblasterphoto.eps sys100.eps sys300.eps sys600.eps sys800.eps sysg5.eps sysg5nb.eps m10012Vphoto.eps

doc:	$(TARGET) 00readme-j

%.pdf:	%.ps
	ps2pdf13 $<

%.ps:	%.dvi
	pdvips -o $@ $<

%.dvi:	%.tex
	platex $<;
	platex $<;
	platex $<;

clean:
	-rm *.aux *.log *.dvi *.toc *~ core \
	$(patsubst %.pdf,%.ps,$(TARGET))


00readme-j:	00readme-j.template
	chmod a+w $@
	./genreadme $< >$@
	chmod a-w $@

00readme:	00readme.template
	chmod a+w $@
	./genreadme $< >$@
	chmod a-w $@

#
# GRAPE-7 installation guide
#
g7install.dvi:	g7install.tex g7overview.tex g5pipeoverview.tex g5nbpipeoverview.tex $(FIGS)

g7install-j.dvi:	g7install-j.tex g7overview-j.tex g5pipeoverview-j.tex g5nbpipeoverview-j.tex $(FIGS)

#
# G5 user's guide
#
g5user.dvi:	g5user.tex g7overview.tex g5pipeoverview.tex $(FIGS)

g5user-j.dvi:	g5user-j.tex g7overview-j.tex g5pipeoverview-j.tex $(FIGS)

#
# G5nb user's guide
#
g5nbuser.dvi:	g5nbuser.tex  g5nbpipeoverview.tex $(FIGS)

g5nbuser-j.dvi:	g5nbuser-j.tex  g5nbpipeoverview-j.tex $(FIGS)

#
# figures and photos
#
g7photo.eps:	g7photo.obj
	tgif -print -eps -reqcolor g7photo.obj

12Vphoto.eps:	12Vphoto.jpg
	convert 12Vphoto.jpg 12Vphoto.eps

6pin12Vphoto.eps:	6pin12Vphoto.jpg
	convert 6pin12Vphoto.jpg 6pin12Vphoto.eps

usbblasterphoto.eps:	usbblasterphoto.jpg
	convert usbblasterphoto.jpg usbblasterphoto.eps

m10012Vphoto.eps:	m10012Vphoto.jpg
	convert m10012Vphoto.jpg m10012Vphoto.eps

sys100.eps sys300.eps sys600.eps sys800.eps: %.eps:	%.obj
	tgif -print -eps $<

sysg5.eps sysg5nb.eps:	%.eps:	%.obj
	tgif -print -eps $<
