#
# "$Id: Makefile,v 1.7 2004/06/29 03:14:19 mike Exp $"
#
#   Documentation makefile for the Common UNIX Printing System (CUPS).
#
#   Copyright 1993-2004 by Easy Software Products.
#
#   These coded instructions, statements, and computer programs are the
#   property of Easy Software Products and are protected by Federal
#   copyright law.  Distribution and use rights are outlined in the file
#   "LICENSE.txt" which should have been included with this file.  If this
#   file is missing or damaged please contact Easy Software Products
#   at:
#
#       Attn: CUPS Licensing Information
#       Easy Software Products
#       44141 Airport View Drive, Suite 204
#       Hollywood, Maryland 20636-3142 USA
#
#       Voice: (301) 373-9600
#       EMail: cups-info@cups.org
#         WWW: http://www.cups.org
#

include ../../Makedefs

#
# HTMLDOC generation rules...
#

.SUFFIXES:	.html .pdf .ps .shtml
.shtml.html:
	echo Formatting $@...
	$(HTMLDOC) --titleimage images/cups-large.gif --numbered -f $@ $<
.shtml.pdf:
	echo Formatting $@...
	$(HTMLDOC) --titleimage images/cups-large.gif --duplex --compression=9 \
		--numbered --jpeg -f $@ $<
.shtml.ps:
	echo Formatting $@...
	$(HTMLDOC) --titleimage images/cups-large.gif --duplex --numbered \
		--jpeg -f $@ $<

HTMLDOC		=	htmldoc --strict --quiet --bodycolor white

#
# Document files...
#

DOCUMENTS	=	sam.shtml sum.shtml
WEBPAGES	=	cups.css cupsdoc.css index.html documentation.html
WEBIMAGES	=	images/accept-jobs.gif \
			images/add-class.gif \
			images/add-printer.gif \
			images/cancel-job.gif \
			images/config-printer.gif \
			images/continue.gif \
			images/delete-class.gif \
			images/delete-printer.gif \
			images/hold-job.gif \
			images/manage-classes.gif \
			images/manage-jobs.gif \
			images/manage-printers.gif \
			images/modify-class.gif \
			images/modify-printer.gif \
			images/navbar.gif \
			images/print-test-page.gif \
			images/reject-jobs.gif \
			images/release-job.gif \
			images/restart-job.gif \
			images/show-active.gif \
			images/show-completed.gif \
			images/start-class.gif \
			images/start-printer.gif \
			images/stop-class.gif \
			images/stop-printer.gif


#
# Make all documents...
#

all:	$(DOCUMENTS:.shtml=.pdf) $(DOCUMENTS:.shtml=.html) overview.pdf


#
# Make PS files...
#

ps:	$(DOCUMENTS:.shtml=.ps) overview.ps


#
# Remove all generated files...
#

clean:
	$(RM) $(DOCUMENTS:.shtml=.pdf)
	$(RM) $(DOCUMENTS:.shtml=.html)
	$(RM) overview.pdf


#
# Install all documentation files...
#

install:
	$(INSTALL_DIR) $(DOCDIR)/fr
	for file in $(WEBPAGES); do \
		$(INSTALL_MAN) $$file $(DOCDIR)/fr; \
	done
	$(INSTALL_MAN) overview.html $(DOCDIR)/fr
	$(INSTALL_MAN) overview.pdf $(DOCDIR)/fr
	for file in $(DOCUMENTS:.shtml=.html); do \
		$(INSTALL_MAN) $$file $(DOCDIR)/fr; \
	done
	for file in $(DOCUMENTS:.shtml=.pdf); do \
		$(INSTALL_MAN) $$file $(DOCDIR)/fr; \
	done
	$(INSTALL_DIR) $(DOCDIR)/fr/images
	for file in $(WEBIMAGES); do \
		$(INSTALL_MAN) $$file $(DOCDIR)/fr/images; \
	done


#
# The overview, admin manual, programmers manual, and users manual get
# special attention...
#

overview.pdf:	overview.html
	echo Formatting $@...
	$(HTMLDOC) --path ".;.." --duplex --compression=9 --jpeg --webpage -f overview.pdf overview.html
overview.ps:	overview.html
	echo Formatting $@...
	$(HTMLDOC) --path ".;.." --duplex --jpeg --webpage -f overview.ps overview.html

sam.html:	sam.shtml
	echo Formatting $@...
	$(HTMLDOC) --toctitle "Table des matières" --path ".;.." --titleimage images/cups-large.gif -f $@ $<
sam.pdf:	sam.shtml
	echo Formatting $@...
	$(HTMLDOC) --toctitle "Table des matières" --path ".;.." --titleimage images/cups-large.gif --duplex --compression=9 \
		--jpeg -f $@ $<
sam.ps:		sam.shtml
	echo Formatting $@...
	$(HTMLDOC) --toctitle "Table des matières" --path ".;.." --titleimage images/cups-large.gif --duplex --jpeg -f $@ $<

spm.html:	spm.shtml
	echo Formatting $@...
	$(HTMLDOC) --path ".;.." --titleimage images/cups-large.gif -f $@ $<
spm.pdf:	spm.shtml
	echo Formatting $@...
	$(HTMLDOC) --path ".;.." --titleimage images/cups-large.gif --duplex --compression=9 \
		--jpeg -f $@ $<
spm.ps:		spm.shtml
	echo Formatting $@...
	$(HTMLDOC) --path ".;.." --titleimage images/cups-large.gif --duplex --jpeg -f $@ $<

sum.html:	sum.shtml
	echo Formatting $@...
	$(HTMLDOC) --toctitle "Table des matières" --path ".;.." --titleimage images/cups-large.gif -f $@ $<
sum.pdf:	sum.shtml
	echo Formatting $@...
	$(HTMLDOC) --toctitle "Table des matières" --path ".;.." --titleimage images/cups-large.gif --duplex --compression=9 \
		--jpeg -f $@ $<
sum.ps:		sum.shtml
	echo Formatting $@...
	$(HTMLDOC) --toctitle "Table des matières" --path ".;.." --titleimage images/cups-large.gif --duplex --jpeg -f $@ $<

$(DOCUMENTS:.shtml=.html): \
		glossary.shtml printing-overview.shtml \
		references.shtml system-overview.shtml \
		../../LICENSE.html

$(DOCUMENTS:.shtml=.pdf): \
		glossary.shtml printing-overview.shtml \
		references.shtml system-overview.shtml \
		../../LICENSE.html

$(DOCUMENTS:.shtml=.ps): \
		glossary.shtml printing-overview.shtml \
		references.shtml system-overview.shtml \
		../../LICENSE.html


#
# End of Makefile.
#
