#!/usr/bin/make -f

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

DKMS_STAGED := debian/audioreach-dkms/usr/src/audioreach-$(DEB_VERSION_UPSTREAM)

%:
	dh $@

override_dh_install:
	mkdir -p $(DKMS_STAGED)
	# Stage only the files needed to build the DKMS module
	cp -a audioreach-driver include Makefile $(DKMS_STAGED)/
	find $(DKMS_STAGED) \( -name '*.o' -o -name '*.ko' -o -name '*.cmd' \
		-o -name '*.mod' -o -name '*.mod.c' -o -name 'Module.symvers' \
		-o -name 'modules.order' -o -name '.gitignore' \) -delete
	dh_install

override_dh_dkms:
	dh_dkms -V $(DEB_VERSION_UPSTREAM)

override_dh_auto_clean override_dh_auto_build override_dh_auto_test override_dh_auto_install:
