#!/usr/bin/make -f

DEB_COMPRESS_EXCLUDE := .pdf	# The PDF doc will not be compressed

build/velvet::
	touch zlib # prevents the zlib in the ‘third-party’ folder to be built.

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

clean::
	$(RM) zlib

pkg=velvet

DEB_MAKE_BUILD_TARGET = obj velveth velvetg Z_LIB_FILES='' LDFLAGS='-lm -lz' OPT=''

build/velvet::
	make color CFLAGS='$(CFLAGS)' Z_LIB_FILES='' LDFLAGS='-lm -lz' OPT=''
	mkdir -p $(CURDIR)/debian/$(pkg)/usr/share/man/man1/
	help2man --no-info --name="simple hashing program" \
	         $(CURDIR)/velveth > $(CURDIR)/debian/$(pkg)/usr/share/man/man1/velveth.1
	help2man --no-info --name="simple hashing program (colorspace version)" \
	         $(CURDIR)/velveth_de > $(CURDIR)/debian/$(pkg)/usr/share/man/man1/velveth_de.1
	help2man --no-info --version-option=" " \
	         --name="de Bruijn graph construction, error removal and repeat resolution" \
	         $(CURDIR)/velvetg > $(CURDIR)/debian/$(pkg)/usr/share/man/man1/velvetg.1
	help2man --no-info --version-option=" " \
	         --name="de Bruijn graph construction, error removal and repeat resolution (colorspace version)" \
	         $(CURDIR)/velvetg_de > $(CURDIR)/debian/$(pkg)/usr/share/man/man1/velvetg_de.1

get-orig-source:
	. debian/get-orig-source

