#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
include /usr/share/cdbs/1/class/makefile.mk

# only build and install utility, do kernel module through dkms

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_MAKE_BUILD_TARGET = utility_make
DEB_MAKE_INSTALL_TARGET = utility_install DESTDIR=$(cdbs_make_curdestdir)

DKMSFILES = 	driver Makefile mx_ver.h readme.txt VERSION.txt \
                COPYING-GPL.TXT
MXVERSION = 	$(DEB_UPSTREAM_VERSION)

pre-build::
	install -d debian/tmp/usr/src/mxser-$(MXVERSION)
	cp -r $(DKMSFILES) debian/tmp/usr/src/mxser-$(MXVERSION)/
	cp debian/dkms.conf debian/tmp/usr/src/mxser-$(MXVERSION)/

override_dh_dkms:
	dh_dkms -V $(MXVERSION)
