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