SHELL = /bin/sh
BINDIR = /usr/bin
CATALOG = /etc/xml/catalog
VERSION = 1.48
DESTDIR = /usr/share/xml/docbook/xsl-stylesheets-$(VERSION)

all:

install: install-xsl install-img install-extensions install-misc catalog-entries

install-xsl:
	mkdir -p $(DESTDIR)/{common,fo,html,htmlhelp/doc,javahelp,lib,template,xhtml}
	cp common/*.dtd $(DESTDIR)/common
	cp common/*.xml $(DESTDIR)/common
	cp common/*.xsl $(DESTDIR)/common
	cp fo/*.xml $(DESTDIR)/fo
	cp fo/*.xsl $(DESTDIR)/fo
	cp html/*.xml $(DESTDIR)/html
	cp html/*.xsl $(DESTDIR)/html
	cp htmlhelp/*.xml $(DESTDIR)/htmlhelp
	cp htmlhelp/*.xsl $(DESTDIR)/htmlhelp
	cp htmlhelp/doc/*.xml $(DESTDIR)/htmlhelp/doc
	cp javahelp/*.xsl $(DESTDIR)/javahelp
	cp lib/lib.xsl $(DESTDIR)/lib
	cp template/README $(DESTDIR)/template
	cp template/*.xml $(DESTDIR)/template
	cp template/*.xsl $(DESTDIR)/template
	cp xhtml/*.xsl $(DESTDIR)/xhtml

install-img:
	mkdir -p $(DESTDIR)/images/callouts
	cp images/*.gif $(DESTDIR)/images
	cp images/*.png $(DESTDIR)/images
	cp images/callouts/*.png $(DESTDIR)/images/callouts

install-extensions:
	mkdir -p $(DESTDIR)/extensions
	cp -r extensions/* $(DESTDIR)/extensions

install-misc:
	cp VERSION $(DESTDIR)

catalog-entries:
	@./buildDocBookCatalog $(DESTDIR) $(VERSION)

uninstall:
	rm -rf $(DESTDIR)
	CATALOG=/etc/xml/catalog
	@./deleteDocBookCatalog $(DESTDIR) $(VERSION)
