.SUFFIXES: .idx .ind .tex .dvi .ps $(.SUFFIXES)

TEX=	front.tex intro.tex procnotation.tex syscalls.tex network.tex \
	strings.tex awk.tex miscprocs.tex running.tex todo.tex


man.dvi: $(TEX) man.ind
man.ind: man.idx
 
.dvi.ps:
	dvips -o $@ $<

.tex.dvi:
	latex $<
	rm $*.log

.idx.ind:
	makeindex $<

clean:
	-rm *.log

INSTALL_DATA= install -c -m 644

tar:
	tar cf - *.tex sty | gzip > man.tar.gz


install: man.ps
	@echo WARNING:
	@echo WARNING: this depends on /u/su/scsh/scsh 
	@echo WARNING: pointing to the current release
	@echo WARNING:
	$(INSTALL_DATA) cheat.txt /u/su/scsh/scsh/doc/
	$(INSTALL_DATA) man.ps /u/su/scsh/scsh/doc/scsh-manual.ps
	$(INSTALL_DATA) $(TEX) /u/su/scsh/scsh/doc/scsh-manual/
	$(INSTALL_DATA) sty/* /u/su/scsh/scsh/doc/scsh-manual/sty/
