| 1 | #!/usr/bin/make -f |
|---|
| 2 | |
|---|
| 3 | include /usr/share/dpatch/dpatch.make |
|---|
| 4 | |
|---|
| 5 | # some default definitions, important! |
|---|
| 6 | # |
|---|
| 7 | # Name of the source package |
|---|
| 8 | psource:=virtualbox-ose-source |
|---|
| 9 | gsource:=virtualbox-ose-guest-source |
|---|
| 10 | |
|---|
| 11 | # The short upstream name, used for the module source directory |
|---|
| 12 | sname:=virtualbox-ose |
|---|
| 13 | uname:=virtualbox-ose-guest-utils |
|---|
| 14 | |
|---|
| 15 | ### KERNEL SETUP |
|---|
| 16 | ### Setup the stuff needed for making kernel module packages |
|---|
| 17 | ### taken from /usr/share/kernel-package/sample.module.rules |
|---|
| 18 | |
|---|
| 19 | # prefix of the target package name |
|---|
| 20 | PACKAGE := virtualbox-ose-modules |
|---|
| 21 | # modifieable for experiments or debugging m-a |
|---|
| 22 | MA_DIR ?= /usr/share/modass |
|---|
| 23 | # load generic variable handling |
|---|
| 24 | -include $(MA_DIR)/include/generic.make |
|---|
| 25 | # load default rules, including kdist, kdist_image, ... |
|---|
| 26 | -include $(MA_DIR)/include/common-rules.make |
|---|
| 27 | |
|---|
| 28 | # module assistant calculates all needed things for us and sets |
|---|
| 29 | # following variables: |
|---|
| 30 | # KSRC (kernel source directory), KVERS (kernel version string), KDREV |
|---|
| 31 | # (revision of the Debian kernel-image package), CC (the correct |
|---|
| 32 | # compiler), VERSION (the final package version string), PKGNAME (full |
|---|
| 33 | # package name with KVERS included), DEB_DESTDIR (path to store DEBs) |
|---|
| 34 | |
|---|
| 35 | # The kdist_configure target is called by make-kpkg modules_config and |
|---|
| 36 | # by kdist* rules by dependency. It should configure the module so it is |
|---|
| 37 | # ready for compilation (mostly useful for calling configure). |
|---|
| 38 | # prep-deb-files from module-assistant creates the neccessary debian/ files |
|---|
| 39 | kdist_configure: prep-deb-files |
|---|
| 40 | |
|---|
| 41 | # the kdist_clean target is called by make-kpkg modules_clean and from |
|---|
| 42 | # kdist* rules. It is responsible for cleaning up any changes that have |
|---|
| 43 | # been made by the other kdist_commands (except for the .deb files created) |
|---|
| 44 | kdist_clean: clean |
|---|
| 45 | $(MAKE) $(MFLAGS) -f debian/rules clean |
|---|
| 46 | # |
|---|
| 47 | ### end KERNEL SETUP |
|---|
| 48 | |
|---|
| 49 | MAKE:=kmk |
|---|
| 50 | |
|---|
| 51 | binary-modules: prep-deb-files |
|---|
| 52 | dh_testroot |
|---|
| 53 | dh_clean -k |
|---|
| 54 | # Build the module |
|---|
| 55 | $(MAKE) -C $(KSRC) M=$(CURDIR) |
|---|
| 56 | # Install the module |
|---|
| 57 | dh_install vboxdrv/vboxdrv.ko /lib/modules/$(KVERS)/misc/ |
|---|
| 58 | dh_install vboxnetflt/vboxnetflt.ko /lib/modules/$(KVERS)/misc/ |
|---|
| 59 | dh_installdocs |
|---|
| 60 | dh_installchangelogs |
|---|
| 61 | dh_compress |
|---|
| 62 | dh_fixperms |
|---|
| 63 | dh_installmodules |
|---|
| 64 | dh_installdeb |
|---|
| 65 | dh_gencontrol -- -v$(VERSION) |
|---|
| 66 | dh_md5sums |
|---|
| 67 | dh_builddeb --destdir=$(DEB_DESTDIR) |
|---|
| 68 | dh_clean -k |
|---|
| 69 | |
|---|
| 70 | .PHONY: build clean binary-arch binary-indep binary install binary-modules kdist kdist_configure kdist_image kdist_clean |
|---|