# Makefile for MiKTeX documentation (Win32 version)	-*- Makefile -*-
# Time-stamp: "97/08/26 12:50:07 cschenk"

srcdir = .

prefix = ..\..\..
docdir = $(prefix)\doc
miktexdocdir = $(docdir)\miktex
helpdir = $(miktexdocdir)

INSTALL_DATA = copy

MAKEINFO = ..\..\..\miktex\bin\makeinfo

all: miktex.hlp miktex.dvi miktex_toc.html psconfig.html

miktex.hlp: miktex.texi miktex.hpj
   -$(MAKEINFO) --force --rtf --output temp.rtf miktex.texi
   @echo s/!(\(.*\)!)/{\\uldb \1}/> sed.in
   @echo s/!\[\(.*\)!\]/{\\v \1}/>> sed.in
   sed -f sed.in temp.rtf > miktex.rtf
   del temp.rtf
   del sed.in
   hcrtf -xn miktex.hpj


miktex.dvi: miktex.texi
	tex miktex.texi
	texindex miktex.cp
	tex miktex.texi

miktex.hpj:
	-$(MAKEINFO) --force --hpj miktex.hpj --output miktex.rtf miktex.texi

miktex.html: miktex.texi
	perl texi2html -monolithic miktex.texi

miktex_toc.html: miktex.texi
	perl texi2html -split_chapter miktex.texi	

install: miktex.hlp miktex.dvi README.TXT news.txt todo.txt bugs.txt \
		miktex_toc.html psconfig.html
	$(INSTALL_DATA) miktex.hlp $(miktexdocdir)\miktex.hlp
	$(INSTALL_DATA) README.TXT $(miktexdocdir)\README.TXT
	$(INSTALL_DATA) news.txt $(miktexdocdir)\news.txt
	$(INSTALL_DATA) todo.txt $(miktexdocdir)\todo.txt
	$(INSTALL_DATA) bugs.txt $(miktexdocdir)\bugs.txt
	$(INSTALL_DATA) ..\COPYING $(miktexdocdir)\COPYING
	$(INSTALL_DATA) miktex*.html $(miktexdocdir)
	$(INSTALL_DATA) miktex.dvi $(miktexdocdir)\miktex.dvi
	$(INSTALL_DATA) psconfig.html $(miktexdocdir)\psconfig.html

uninstall:

mostlyclean:
	-del miktex.rtf
	-del *.ph

clean: mostlyclean
	-del miktex.hlp
	-del miktex*.html
	-del miktex.dvi
	-del miktex.aux
	-del miktex.cp
	-del miktex.cps
	-del miktex.fn
	-del miktex.ky
	-del miktex.log
	-del miktex.pg
	-del miktex.toc
	-del miktex.tp
	-del miktex.vr

distclean: clean

realclean: distclean
