#
#       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/html/Makefile,v $
# $Revision: 1.21 $
# $Date: 1997/10/16 23:27:48 $
#
#      Makefile for the TeXinfo documentation for ftape/sftape/zftape
#
TOPDIR = ../..
#
# all other configuration is in $(TOPDIR)/MCONFIG:
#
include $(TOPDIR)/MCONFIG
#
#
#
ICONDIR    = .
ICONS      = missing-arrow.gif prev-arrow.gif next-arrow.gif up-arrow.gif
FOOTER     = Footer
HREFSRC    = Ftape-FAQ MCONFIG RELEASE-NOTES BUGS \
	     contrib/scripts/MAKEDEV.ftape \
	     include/linux/ftape-header-segment.h \
	     include/linux/zftape.h include/linux/ftape.h \
	     include/linux/qic117.h \
	     patches/2.x.x/floppy.c.dif include/linux/mtio.h
HREFFILES := $(HREFSRC:include/linux/%=%)
HREFFILES := $(HREFFILES:patches/2.x.x/%=%)
HREFFILES := $(HREFFILES:contrib/scripts/%=%)
HREFSRC   := $(HREFSRC:%=$(TOPDIR)/%)

HTMLDIR    = $(DOCDIR)/html
HTMLTARGET = Index.html
TEXITOHTML = $(TOPDIR)/contrib/scripts/texi2www  \
		-icons $(ICONDIR)                \
		-dir . -verbose                  \
		-footer $(FOOTER)
#
#
#
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: html

html: $(HTMLTARGET)

$(INFODEP): %: $(SRCDIR)/% $(SRCDIR)/$(INFOSRC)
	ln -sf $(SRCDIR)/$@ .

$(HREFFILES): $(HREFSRC)
	cp -f $(HREFSRC) .

$(HTMLTARGET): $(INFODEPSRC) $(ICONDIR)/$(ICONS) $(HREFFILES) $(FOOTER)
	make realstuff

realstuff: $(INFODEP) $(ICONDIR)/$(ICONS) $(HREFFILES) $(FOOTER)
	$(TEXITOHTML) $(INFOSRC)
	ln -sf Top.html $(HTMLTARGET)

ifdef DOCDIR
install: $(HTMLTARGET)
	$(INSTALL) -m 0755 -d $(HTMLDIR)
	$(INSTALL) -m 0644 *.html *.gif $(HREFFILES) $(HTMLDIR)
	ln -sf Top.html $(HTMLDIR)/Index.html 

uninstall:
	-set -e ; cd $(HTMLDIR) ; rm -f *.html *.gif $(HREFFILES)
	-rmdir $(HTMLDIR)
else
install uninstall:
endif

clean:
	rm -f core *.texi

realclean: clean
	rm -f *.html
	rm -f $(HREFFILES)

dep:

.PHONY: all html install uninstall dep clean realclean realstuff
