# 1-Oct-90 modified for some IRIX additions jim@KAOS.Stanford.EDU

AWFLIB = /local/lib/awf	# beware, awf itself knows this
BIN = /local/bin
MAN = /usr/catman/local/man1
CP = common dev.dumb mac.man mac.ms pass1 pass2.base pass2.man pass2.ms pass3
DTR = README COPYRIGHT Makefile awf awf.1 awf.1.out common dev.dumb mac.man \
	mac.ms pass1 pass2.base pass2.man pass2.ms pass3
# System V brain damage
SHELL = /bin/sh

r:	awf.1
	chmod +x awf
	AWFLIB=. awf -man awf.1 >tmp
	cmp tmp awf.1.out
	chmod +x sgi-awf-fakes
	rm tmp

install:
	-if test ! -d $(AWFLIB) ; then mkdir $(AWFLIB) ; fi
	cp $(CP) $(AWFLIB)
	cp awf $(BIN)
	cp awf.1 $(MAN)
	@echo Do '"make install.fakes"' to install fake nroff, neqn and tbl.

install.fakes:
	@if [ -d /usr/lib/tmac ]; then \
	    echo It appears you have SGIs Documenters Workbench installed.; \
	    echo Please install fakes manually. ;\
	    exit 1023 ; \
	fi
	rm -i $(BIN)/neqn $(BIN)/tbl $(BIN)/nroff
	cp sgi-awf-fakes $(BIN)/neqn
	ln $(BIN)/neqn $(BIN)/nroff
	ln $(BIN)/neqn $(BIN)/tbl

rr:	r testm tests.Z tests.out.Z
	AWFLIB=. awf -man testm >tmp
	cmp tmp testm.out
	rm tmp
	uncompress <tests.Z | AWFLIB=. awf -ms >tmp
	uncompress <tests.out.Z | cmp - tmp
	rm tmp

dtr:	$(DTR)
	makedtr $(DTR) >$@

tar:	$(DTR)
	tar cvf awf.tar $(DTR)
	compress -v awf.tar

clean:
	rm -f tmp tests tests.out dtr awf.tar awf.tar.Z j*
