#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_configure:

override_dh_auto_test:
ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
	yorick -batch debian/check.i
endif

#remove doc from SUBDIRS
override_dh_auto_build:
	$(MAKE) SUBDIRS="yeti yeti_fftw yeti_regex yeti_tiff" \
	        COPT_DEFAULT="" \
	        Y_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
	        Y_LDFLAGS="$(LDFLAGS)"

override_dh_auto_install:
	dh_installyorick

clean:
	dh_testdir
	dh_testroot
	touch config.h
	$(MAKE) Y_MAKEDIR=/usr/lib/yorick Y_EXE=/usr/bin/yorick clean
ifeq (,$(shell head -1 config.h))
	rm -f config.h
endif
	dh_clean --exclude=./yeti_regex/glibc/regcomp.c.orig \
	         --exclude=./yeti_regex/glibc/regexec.c.orig \
		 yeti/zzyeti_start.i
