SGS=$(SG).sgml
SGO=$(SG).html
SGT=$(SG).tex
SGD=$(SG).dvi
SGP=$(SG).ps
# should be able to use a catalog for these at some point...
STYLE=/usr/lib/sgml/stylesheets
HTMLDSL=$(STYLE)/dbtohtml.dsl
TEXDSL=$(STYLE)/docbook.dsl

all:: $(SGO) $(SGP)
SGOPTS=-V %no-split-output% -V %no-make-index%

$(SGO): $(SGS) $(HTMLDSL)
	jade $(SGOPTS) -d $(HTMLDSL) -t sgml $(SGS)
	mv DBTOHTML.html $(SGO)

$(SGT): $(SGS) $(TEXDSL)
	jade $(SGOPTS) -d $(TEXDSL) -t tex $(SGS)

$(SGD): $(SGT)
	jadetex $(SGT)

$(SGP): $(SGD)
	dvips -o $(SGP) $(SGD)

clean::
	rm -f $(SGO) $(SGT) $(SGD) $(SG).log $(SG).aux $(SG).ps

