1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
MODULE = bbswitch
MODSRCPKG = $(MODULE)-source
# The following variable is required by module-assistant:
# PACKAGE: modules binary package prefix (as in debian/control.modules.in)
PACKAGE = $(MODULE)-modules
MA_DIR ?= /usr/share/modass
include $(MA_DIR)/include/generic.make
include $(MA_DIR)/include/common-rules.make
# The following variables are defined by module-assistant:
# KVERS: kernel version string (version-abi-flavor-arch)
# KSRC: path to the kernel headers/sources (/lib/modules/$(KVERS)/build)
# PKGNAME: package name to be built ($(PACKAGE)-$(KVERS))
# VERSION: package version to be built (module-source-debversion+kernel-debversion)
# DEB_DESTDIR: destination of the to-be-built package (/usr/src)
get_built_using ?= $(subst (= ),,$(shell dpkg-query -f='$${source:Package} (= $${source:Version})' -W $1))
kdist_clean: prep-deb-files
$(MAKE) -C $(KSRC) M=$(CURDIR) clean
dh_clean
kdist_config: prep-deb-files
binary-modules: kdist_config
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# Build and install the module.
$(MAKE) -C $(KSRC) M=$(CURDIR) INSTALL_MOD_PATH=$(CURDIR)/debian/$(PKGNAME) modules modules_install
# Build the package.
dh_install
dh_installdocs
dh_installchangelogs
dh_installmodules
dh_bugfiles
dh_lintian
dh_link
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_missing
dh_dwz
dh_strip
dh_installdeb
dh_gencontrol -- -v$(VERSION) \
-V'built-using:kernel=$(call get_built_using,linux-headers-$(KVERS))' \
-V'built-using:module=$(call get_built_using,$(MODSRCPKG))'
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
.PHONY: binary-modules kdist_config kdist_clean
|