# ------------------------------------------------------------------------------

.SUFFICES = .nr .man .mkr .txt .ps

%.txt : %.nr
	nroff $? >$@
	xless $@
%.ps : %.nr
	groff -Tps $? >$@
	ghostview $@
%.txt : %.mkr
	nroff tmac.kr $? >$@
	xless $@
%.ps : %.mkr
	groff -Tps tmac.kr $? >$@
	ghostview $@
%.txt : %.man
	nroff -man $? >$@
	xless $@
%.ps : %.man
	groff -Tps -man $? >$@
	ghostview $@

# ------------------------------------------------------------------------------

all : txt ps

txt : 
	for x in *.man ;\
	do \
	a=`basename $$x .man` ;\
	echo $$a.txt ;\
	nroff -man $$x >$$a.txt ;\
	done
	for x in *.mkr ;\
	do \
	a=`basename $$x .mkr` ;\
	echo $$a.txt ;\
	nroff tmac.kr $$x >$$a.txt ;\
	done

ps : 
	for x in *.man ;\
	do \
	a=`basename $$x .man` ;\
	echo $$a.ps ;\
	groff -Tps -man $$x >$$a.ps ;\
	done
	for x in *.mkr ;\
	do \
	a=`basename $$x .mkr` ;\
	echo $$a.ps ;\
	groff -Tps tmac.kr $$x >$$a.ps ;\
	done

clean :
	rm -f *.txt *.ps
