###########################################################################
# IFHP - An Extended Print Spooler System
#
# Copyright 1988-1997 Patrick Powell, San Diego, California
#     papowell@sdsu.edu
# See LICENSE for conditions of use.
#
###########################################################################
# $Id: Makefile.in,v 1.23 2004/09/24 20:18:15 papowell Exp papowell $
########################################################################## 

# FAQ Makefile
#
SRC = @srcdir@
VPATH=${SRC}

prefix = @prefix@
MAN =		$(prefix)/man
SHELL =		@SHELL@

DSSSL=docbook-1.54
DSSSL=modular

SRC=@srcdir@

CATALOGS= \
      -c /usr/local/share/sgml/catalog \
      -c /usr/local/share/sgml/docbook/dsssl/${DSSSL}/catalog

DOC=IFHP-Reference


all: $(DOC).html $(DOC).pdf purge

.PHONY: all clean install ci install.zman update purge

$(DOC).html: $(DOC).sgml $(DOC).dsl Makefile
	jade  -i output.html -V nochunks -t sgml \
		$(CATALOGS) \
	  -d $(DOC).dsl \
	    $(DOC).sgml >$(DOC).html
	-tidy -i -m -f /dev/null ${TIDYFLAGS} $@
	@PERL@ ${SRC}/updateheader $@

index.html HTML.manifest: $(DOC).sgml $(DOC).dsl Makefile
	jade \
	  -i output.html -V html-manifest \
		$(CATALOGS) \
	  -d $(DOC).dsl \
	  -t sgml \
	    $(DOC).sgml
	-tidy -i -m -f /dev/null ${TIDYFLAGS} `xargs < HTML.manifest`
	@PERL@ ${SRC}/updateheader index.html

check:
	#nsgmls -s -f handbook.errs handbook.sgml
	nsgmls -s $(CATALOGS) $(DOC).sgml

$(DOC).tex: $(DOC).sgml $(DOC).dsl Makefile
	jade -Vtex-backend -ioutput.print -t tex -o $(DOC).tex \
		$(CATALOGS) \
	  -d $(DOC).dsl \
	    $(DOC).sgml

TEX=tex
$(DOC).dvi: $(DOC).tex
	echo "==> TeX pass 1/3"
	${TEX} "&jadetex" $(DOC).tex >/dev/null 2>&1
	echo "==> TeX pass 2/3"
	${TEX} "&jadetex" $(DOC).tex >/dev/null 2>&1
	echo "==> TeX pass 3/3"
	${TEX} "&jadetex" $(DOC).tex

$(DOC).ps: $(DOC).dvi
	dvips -q -t letter -o $(DOC).ps $(DOC).dvi
$(DOC).pdf: $(DOC).ps
	ps2pdf -dPDFSETTINGS=/default \
	-dEmbedAllFonts=true \
	-dAntiAliasColorImages=true \
	-dAntiAliasGrayImages=true \
	-dAntiAliasMonoImages=true \
	-dCompatibilityLevel=1.2  \
	$(DOC).ps $(DOC).pdf


clean:
	rm -f *.errs *.htm HTML.manifest *.tex \
		 *.log *.dvi *.ps *.aux *.toc

purge:
	rm -f *.aux *.log *.toc


correct:
	correct -d dict *.sgml
update:
	@PERL@ ${SRC}/updateversion *.sgml
	@PERL@ ${SRC}/updatesgmlmirrors ../MIRRORS *.sgml
	@PERL@ ${SRC}/supported ../ifhp.conf.in *.sgml
	${MAKE} all

# 
#
install:

	
realclean:
	rm $(DOC).html

mostlyclean distclean:: clean
	rm -f Makefile

CI=
#CO=-kv
CO=-l
cifast ci:
	checkin() { \
		rcs -l $$1; \
		ci $(CI) -mUpdate -t-Initial $$1; \
		yes |co -l $(CO) $$1; \
	}; \
	for i in  *.sgml Makefile.in Makefile; do \
		checkin $$i; \
	done;
