#
# Makefile for the Debian New Maintainers' Guide
#
# Should work both for a manual in the Debian Documentation Project
# manuals.sgml tree, and for  package build.

# this can and will be overriden by a higher level makefile
PUBLISHDIR := $(DESTDIR)/usr/share/doc/euro-support/

install: publish
all: sgml html txt ps pdf


# borrowed from the  java-common packages
sgml: DOC/debian-euro-support.sgml

update: 
	-cvs -d :pserver:anonymous@cvs.debian.org:/cvs/debian-doc -z3 checkout -d DOC ddp/manuals.sgml/euro-support/

DOC/debian-euro-support.sgml: 
	cvs -d :pserver:anonymous@cvs.debian.org:/cvs/debian-doc -z3 checkout -d DOC ddp/manuals.sgml/euro-support/

# generating HTML
txt text html: sgml
	cd DOC && make

publish: DOC/debian-euro-support.sgml
	cd DOC && make publish PUBLISHDIR=${PUBLISHDIR}

clean:
	cd DOC && make clean


#%.txt: %.sgml
#	debiandoc2text -l en $<

# generating PostScript
#ps: debian-euro-support.ps

#%.ps: %.sgml
#	debiandoc2latexps  -l en $<

#pdf: debian-euro-support.pdf
#%.pdf: %.ps
#	ps2pdf $< 

# publishing to the DDP web pages
#publish: all
#	test -d $(PUBLISHDIR)/ || install -d -m 755 $(PUBLISHDIR)/debian-euro-support
#	rm -f $(PUBLISHDIR)//*.html
#	mkdir $(PUBLISHDIR)//debian-euro-support.html/
#	install -p -m 644 *.html/*.html $(PUBLISHDIR)//debian-euro-support.html/
#	install -p -m 644 *.{txt,ps,sgml} $(PUBLISHDIR)/
#
## validating SGML
#validate:
	set -x; for i in $(wildcard *.sgml); do nsgmls -ges -wall $$i; done
#
# cleaning up
#clean:
#	rm -f *.{txt,ps,dvi,pdf,info*,log,tex,aux,toc,sasp*} *~
#	rm -rf *.html 
#
#distclean:
#	rm -f debian-euro-support.sgml 
#

.PHONY: all publish clean distclean validate 
