#
#       Copyright (C) 1997 Claus Heine.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Source: /homes/cvs/ftape-stacked/Doc/dvi/Makefile,v $
# $Revision: 1.20 $
# $Date: 1997/11/11 15:06:32 $
#
#      Makefile for the TeXinfo documentation for ftape/sftape/zftape
#
TOPDIR = ../..
#
# all other configuration is in $(TOPDIR)/MCONFIG:
#
include $(TOPDIR)/MCONFIG
#
#
#
DVIDIR     = $(DOCDIR)/dvi
TEXITODVI  = texi2dvi
DVIVIEW    = xdvi
DVITARGET  = ftape.dvi
#
#
#
SRCDIR   = ../texi
INFOSRC  = ftape.texi
INFODEP  = Bugs.texi Copying.texi Documentation.texi Indices.texi 	\
	   Installation.texi Introduction.texi QuickInstall.texi 	\
	   Loading.texi Testing.texi Implementation.texi ftape.texi
INFODEPSRC = $(INFODEP:%=$(SRCDIR)/%)

all: dvi

dvi: $(DVITARGET)

$(INFODEP): %: $(SRCDIR)/% $(SRCDIR)/ftape.texi fix-makeinfo.sh
	rm -f $@ $@.new
	cp $< $@
	./fix-makeinfo.sh $@ > $@.new
	mv -f $@.new $@

$(DVITARGET): $(INFODEPSRC) fix-makeinfo.sh
	make realstuff

realstuff: $(INFODEP)
	$(TEXITODVI) $(INFOSRC)

ps: postscript

postscript: ftape.ps

ftape.ps: dvi
	dvips -o ftape.ps ftape.dvi

view: ftape.dvi
	$(DVIVIEW) ftape.dvi

lpr: hardcopy

hardcopy: ftape.ps
	lpr -m ftape.ps

ifdef DOCDIR
install:
	$(INSTALL) -m 0755 -d $(DVIDIR)
	$(INSTALL) -m 0644 ftape.dvi $(DVIDIR)

uninstall:
	-rm -f $(DVIDIR)/ftape.dvi
	-rmdir $(DVIDIR)
else
install uninstall:
endif

clean:
	rm -f core *.texi
	rm -f ftape.log ftape.aux ftape.toc ftape.cp*
	rm -f ftape.fn ftape.ky ftape.pg ftape.tp ftape.vr

realclean: clean
	rm -f *.dvi *.ps

.PHONY: all dvi install uninstall dep clean realclean realstuff ps \
	ps postscript view lpr hardcopy

