#
# Makefile for /usr/catman/local to create formatted, compressed man
# pages in cat? from the nroff originals in man? under SGI/IRIX.
#
# N.B. Under IRIX, "man foo" DOES NOT display the most recent of
# cat1/foo.1.z and man1/foo.1.  cat1/foo.1.z always takes precedence
# over man1/foo.1.z.  So if you use this makefile to create cat'able
# versions be sure to remake them whenever you update an unformatted man
# page.
#
# 1-Oct-90 jim@KAOS.Stanford.EDU
#

        SHELL = /bin/sh
        CATOUT = nothing

all:
	@for i in 1 2 3 4 5 6 7 8 9 n l ; do\
	    if [ -d man$$i ] ; then \
		for file in man$$i/* ; do\
		    page=`basename $$file` ;\
		    if [ -f man$$i/$$page ] ; then \
			make "CATOUT=cat$$i/$$page.z" "MANIN=man$$i/$$page" cat$$i/$$page.z; \
		    fi ;\
	        done; \
	    fi ;\
	done

${CATOUT}: ${MANIN}
	awf -man ${MANIN} > /tmp/mt$$$$ ;\
	pack -f /tmp/mt$$$$;\
	mv /tmp/mt$$$$.z ${CATOUT}
