#!/usr/bin/make -f

%:
	dh $@ 

BINARIES = probcons probcons-RNA pc-project pc-compare pc-makegnuplot

override_dh_auto_build:
	cp Main.cc Main-RNA.cc
	sed -i  s/Defaults.h/Defaults-RNA.h/ Main-RNA.cc
	cp debian/Defaults-RNA.h Defaults-RNA.h
	dh_auto_build

override_dh_link:
	rm -rf $(CURDIR)/debian/probcons-extra/usr/share/doc/probcons-extra
	dh_link -p probcons-extra usr/share/doc/probcons usr/share/doc/probcons-extra

override_dh_clean:
	dh_clean $(BINARIES) Main-RNA.cc Defaults-RNA.h

XP       = xsltproc \
		-''-nonet \
		-''-param man.charmap.use.subset "0" \
		-''-param make.year.ranges "1" \
		-''-param make.single.year.ranges "1" \
		-o debian/

manpages: debian/probcons.1.xml debian/probcons-RNA.1.xml debian/pc-project.1.xml debian/pc-compare.1.xml debian/pc-makegnuplot.1.xml
	$(XP) debian/probcons.1.xml
	$(XP) debian/probcons-RNA.1.xml
	$(XP) debian/pc-project.1.xml
	$(XP) debian/pc-compare.1.xml
	$(XP) debian/pc-makegnuplot.1.xml
