#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

export DEB_CXXFLAGS_MAINT_APPEND := -Wall -O2 -g -Werror -Wno-long-long -Wno-sign-compare -Wno-parentheses -Wno-strict-aliasing -pedantic

%:
	dh $@ --parallel

override_dh_auto_clean:
	dh_auto_clean
	$(MAKE) -C src clean
	$(RM) regression/*/tests.log
	$(RM) regression/*/*/*.out

override_dh_auto_build:
	$(MAKE) -C src MINISAT2=/usr/include/minisat

override_dh_auto_test:
	cd regression/ansi-c ; \
		if ! ../test.pl -c ../../../src/goto-cc/goto-cc ; then \
		  ../../debian/failed-tests-printer.pl ; \
			exit 1 ; \
		fi
	cd regression/cpp ; \
		if ! ../test.pl -c ../../../src/goto-cc/goto-cc ; then \
		  ../../debian/failed-tests-printer.pl ; \
			exit 1 ; \
		fi
	cd regression/cbmc ; \
		if ! ../test.pl -c ../../../src/cbmc/cbmc ; then \
		  ../../debian/failed-tests-printer.pl ; \
			exit 1 ; \
		fi
	cd regression/cbmc-concurrency ; \
		if ! ../test.pl -c ../../../src/cbmc/cbmc ; then \
		  ../../debian/failed-tests-printer.pl ; \
			exit 1 ; \
		fi

