#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

%:
	dh $@

override_dh_auto_configure:
ifeq ($(DEB_HOST_ARCH_OS), $(filter $(DEB_HOST_ARCH_OS), linux))
ifeq ($(DEB_HOST_ARCH), $(filter $(DEB_HOST_ARCH), amd64 i386 x32))
	# amd64, i386, x32 and linux
	dh_auto_configure -- -DCLASSICBUILD=YES -DI2CBUILD=YES
else
	# not amd64, i386, x32 but linux
	dh_auto_configure -- -DCLASSICBUILD=NO -DI2CBUILD=YES
endif
else #not linux: kfree, hurd ...
ifeq ($(DEB_HOST_ARCH_CPU), $(filter $(DEB_HOST_ARCH_CPU), amd64 i386))
	#kfree-amd64, kfree-i386, hurd-i386, 3
	dh_auto_configure -- -DI2CBUILD=NO -DCLASSICBUILD=YES
endif
endif

override_dh_compress:
	dh_compress
	dh_link usr/share/man/man1/get-edid.1.gz usr/share/man/man1/parse-edid.1.gz
