#!/usr/bin/make -f
# Sample debian/rules for mothur
# Andreas Tille <tille@debian.org>

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

ARCHBITS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)

ifeq ($(ARCHBITS),64)
	64BIT_VERSION=yes
else
	64BIT_VERSION=no
endif

%:
	dh $@ --parallel

override_dh_auto_build:
	dh_auto_build -- 64BIT_VERSION=$(64BIT_VERSION) USEMPI=yes
	mv mothur mothur-mpi
	make clean
	dh_auto_build -- 64BIT_VERSION=$(64BIT_VERSION) USEMPI=no
	# cp mothur mothur-mpi # XXX: debug

override_dh_auto_install:
	true

#Cleaning needs help right now
override_dh_auto_clean:
	rm -f mothur mothur-mpi
	make clean
	( cd source/uchime_src && rm -f *.o mk.stdout mk.stderr tmp.stderr )

get-orig-source:
	uscan --verbose --force-download
