#!/usr/bin/make -f
DESTDIR = $(CURDIR)/debian/tmp

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

%:
	dh $*

# Override build step
override_dh_auto_build:
	make -C CPP/7zip/Bundles/Alone2 DEF_FILE=1 DEBUG_BUILD=1 -f ../../cmpl_gcc.mak

# Override install step
override_dh_auto_install:
	install -d $(DESTDIR)/usr/lib
	install CPP/7zip/Bundles/Alone2/b/g/7zz.so $(DESTDIR)/usr/lib/7zz.so

override_dh_auto_test:
	# Running make test requires configuration with --enable-selftest, which
	# we don't want to do for production systems.

override_dh_missing:
	dh_missing --fail-missing
