#------------------------------------------------------------------------------
# Makefile for Oberon system documentation
# (c) University of Ulm, SAI, D-7900 Ulm
#------------------------------------------------------------------------------

Articles :=	coroutines grammar.tbl oc.report
BinDir :=	../bin
MiscDir :=	../misc

#------------------------------------------------------------------------------
CoroutinesFP =	49
GrammarFP =	61
ReportFP =	53
.PHONY:		all
all:		coroutines.ps grammar.ps oc.report.ps

coroutines.ps:	coroutines
		groff -n$(CoroutinesFP) -ms coroutines >$@

grammar.ps:	grammar.tbl
		groff -n$(GrammarFP) -t -ms grammar.tbl >$@

oc.report.ps:	oc.report
		groff -n$(ReportFP) -t -ms oc.report >$@

InstallLib :=	/usr/local/lib/oberon
InstallMan :=	/usr/local/man/oberon

#------------------------------------------------------------------------------
# installation
#------------------------------------------------------------------------------
Doc :=		$(InstallMan)/doc
Docs :=		$(patsubst %,$(Doc)/%, $(Articles))

.PHONY:		install
install:	$(Docs)

$(Docs):	$(Doc)/%: %
		rm -f $@
		cp $^ $@
		chmod 664 $@

#------------------------------------------------------------------------------
# cleanup
#------------------------------------------------------------------------------
.PHONY:		clean
clean:
		rcsclean $(Docs)
