#! /usr/bin/make -f

PATCH=relayfs
PACKAGE=kernel-patch-${PATCH}
LATESTPATCH=$(shell grep ^Patch-file debian/${PACKAGE}.kpatches | head -1 | cut  -d' ' -f2)

####################

arch=$(shell dpkg --print-architecture)

topdir=$(shell pwd)

build:
	dh_testdir
	rm -rf Documentation
	filterdiff -p1 -i 'Documentation/*' ${LATESTPATCH} | patch -p1

clean:
	dh_testdir
	dh_testroot
	dh_clean
	rm -rf Documentation

binary-arch:
	true

binary-indep:	build
	dh_testdir
	dh_testroot
	dh_clean -k

	dh_installkpatches
	dh_installdocs Documentation/filesystems/relayfs.txt
	dh_installchangelogs

	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch binary-indep

.PHONY: binary binary-arch binary-indep clean checkroot
