/*
Copyright (c) 1991, 1992, 1993 Xerox Corporation.  All Rights Reserved.  

Unlimited use, reproduction, and distribution of this software is
permitted.  Any copy of this software must include both the above
copyright notice of Xerox Corporation and this paragraph.  Any
distribution of this software must comply with all applicable United
States export control laws.  This software is made available AS IS,
and XEROX CORPORATION DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE, AND NOTWITHSTANDING ANY OTHER
PROVISION CONTAINED HEREIN, ANY LIABILITY FOR DAMAGES RESULTING FROM
THE SOFTWARE OR ITS USE IS EXPRESSLY DISCLAIMED, WHETHER ARISING IN
CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, EVEN IF
XEROX CORPORATION IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

$Id: Imakefile,v 1.28 1994/05/07 02:13:55 janssen Exp $
*/

TIM = ../etc/tim/tim
TEXINFO2PS = ../etc/tim/texinfo2ps
TEXINFO2INFO = ../etc/tim/texinfo2info
TEXINFO2HTML = ../etc/tim/texinfo2html

dist::
	cd ../etc/tim ; make
	rm -f installation.tim manual.tim
	co installation.tim manual.tim
	sed -e s/RELEASE_NUMBER/$(RELNUM)/g <installation.tim >installation.tim.2
	rm -f installation.tim
	mv installation.tim.2 installation.tim
	chmod 444 installation.tim
	sed -e s/RELEASE_NUMBER/$(RELNUM)/g <manual.tim >manual.tim.2
	rm -f manual.tim
	mv manual.tim.2 manual.tim
	chmod 444 manual.tim
	$(TIM) -x manual.tim >manual.texinfo
	$(RM) manual.ps.dist
	$(TEXINFO2PS) manual.texinfo >manual.ps.dist	
	chmod 444 manual.ps.dist
	$(RM) manual.info.dist
	$(TEXINFO2INFO) manual.texinfo >manual.info.dist
	chmod 444 manual.info.dist
	$(RM) *.html
	$(TEXINFO2HTML) -verbose -split_chapter manual.texinfo
	chmod 444 manual*.html
	$(RM) manual.texinfo
	$(RM) ../INSTALLATION
	$(TIM) -x installation.tim >installation.texinfo
	$(TEXINFO2INFO) installation.texinfo >../INSTALLATION
	chmod 444 ../INSTALLATION
	$(RM) installation.texinfo

#ifdef sgi
install::
	$(INSTALL) -m 444 -src manual.ps.dist -f $(DESTDIR)/doc manual.ps
	$(INSTALL) -m 444 -src manual.info.dist -f $(DESTDIR)/doc manual.info
	for file in manual*.html ;\
		do	echo $${file} ;\
			$(INSTALL) -m 444 -src $${file} -f $(DESTDIR)/doc $${file} ;\
		done
#else
install::
	$(INSTALL) -m 444 manual.ps.dist $(DESTDIR)/doc/manual.ps
	$(INSTALL) -m 444 manual.info.dist $(DESTDIR)/doc/manual.info
	for file in manual*.html ;\
		do	echo $${file} ;\
			$(INSTALL) -m 444 $${file} $(DESTDIR)/doc/$${file} ;\
		done
#endif /* sgi */

clean::
	-rm -f *.cp *.vr *.fn *.toc *.dvi *.aux *.texinfo *.pg *.ky *.tp *.fns *.cps *.kys *.pgs *.tps *.vrs tim-* *.log *.bak *.2

InstallFiles(texinfo2.ps, -m 444, $(DESTDIR)/doc)
