#!/usr/bin/make -f

DH_AUTO_OPTIONS         := -v -Smakefile --parallel

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/architecture.mk

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
  CC  := $(DEB_HOST_GNU_TYPE)-gcc
  CXX := $(DEB_HOST_GNU_TYPE)-g++
else
  CC  := gcc
  CXX := g++
endif

%:
	dh ${@}

override_dh_auto_clean:
	# Make sure patches are applied otherwise `make clean' fails
	# on trying to clean the removed Rar directory (see #769520).
	dpkg-source --before-build $(CURDIR)
	dh_auto_clean $(DH_AUTO_OPTIONS) -- OPTFLAGS=
	rm -rf bin/

override_dh_auto_build:
	dh_auto_build $(DH_AUTO_OPTIONS) -- OPTFLAGS= rar

override_dh_auto_install:
	dh_install  bin/Codecs usr/lib/p7zip
