| 1 |
#!/usr/bin/make -f
|
| 2 |
|
| 3 |
# Base name of the package
|
| 4 |
PACKAGE := foo
|
| 5 |
PKG_NAME := $(PACKAGE)-linux-modules-$(KVERS)
|
| 6 |
# Names of the modules to be installed, without extension
|
| 7 |
MODULES := foo
|
| 8 |
MOD_EXT := $(addsuffix $(if ifeq($(KMAJ),2.6),.ko,.o),$(MODULES))
|
| 9 |
|
| 10 |
MA_DIR ?= /usr/share/modass
|
| 11 |
STAMPDIR := debian/stamps
|
| 12 |
-include $(MA_DIR)/include/generic.make
|
| 13 |
-include $(MA_DIR)/include/common-rules.make
|
| 14 |
|
| 15 |
binary: binary-arch binary-indep
|
| 16 |
binary-arch: build
|
| 17 |
binary-indep: build
|
| 18 |
build: build-stamp
|
| 19 |
build-stamp: binary_modules
|
| 20 |
touch build-stamp
|
| 21 |
#
|
| 22 |
# This rule is going to be invoked by m-a to build
|
| 23 |
# the modules for the custom kernel. The KVERS variable
|
| 24 |
# will be set to the version string of the kernel, and
|
| 25 |
# KSRC will point to the source tree we are building for.
|
| 26 |
#
|
| 27 |
binary-modules: binary_modules
|
| 28 |
binary_modules: prep-deb-files
|
| 29 |
# Build the modules
|
| 30 |
$(MAKE) -C '$(KSRC)' M='$(PWD)'
|
| 31 |
|
| 32 |
dh_testdir
|
| 33 |
dh_testroot
|
| 34 |
dh_installdirs -p$(PKG_NAME)
|
| 35 |
# Install the module files
|
| 36 |
dh_install -p$(PKG_NAME) $(MOD_EXT) lib/modules/$(KVERS)/$(PACKAGE)
|
| 37 |
dh_installdocs -p$(PKG_NAME)
|
| 38 |
dh_installchangelogs -p$(PKG_NAME)
|
| 39 |
dh_strip -p$(PKG_NAME)
|
| 40 |
dh_compress -p$(PKG_NAME)
|
| 41 |
dh_fixperms -p$(PKG_NAME)
|
| 42 |
dh_installdeb -p$(PKG_NAME)
|
| 43 |
dh_gencontrol -p$(PKG_NAME)
|
| 44 |
dh_md5sums -p$(PKG_NAME)
|
| 45 |
dh_builddeb --destdir=$(DEB_DESTDIR) -p$(PKG_NAME)
|
| 46 |
|
| 47 |
clean:
|
| 48 |
dh_testdir
|
| 49 |
dh_testroot
|
| 50 |
dh_clean
|
| 51 |
rm -f build-stamp
|
| 52 |
# Commands to clean up the upstream stuff,
|
| 53 |
# feel free to customize for your package.
|
| 54 |
rm -rf *.o *.ko *.mod.c .*.cmd .tmp_versions
|