File: rules.modules

package info (click to toggle)
west-chamber 20100405+svn20111107.r124-12
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 508 kB
  • sloc: ansic: 1,679; makefile: 139; sh: 66
file content (80 lines) | stat: -rwxr-xr-x 2,924 bytes parent folder | download
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

### KERNEL SETUP
### Setup the stuff needed for making kernel module packages
### taken from /usr/share/kernel-package/sample.module.rules

# prefix of the target package name
PACKAGE=west-chamber-modules
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules, including kdist, kdist_image, ...
-include $(MA_DIR)/include/common-rules.make

# module assistant calculates all needed things for us and sets
# following variables:
# KSRC (kernel source directory), KVERS (kernel version string), KDREV
# (revision of the Debian kernel-image package), CC (the correct
# compiler), VERSION (the final package version string), PKGNAME (full
# package name with KVERS included), DEB_DESTDIR (path to store DEBs)

# The kdist_config target is called by make-kpkg modules_config and
# by kdist* rules by dependency. It should configure the module so it is
# ready for compilation (mostly useful for calling configure).
# prep-deb-files from module-assistant creates the neccessary debian/ files
kdist_config: prep-deb-files get-xtables-headers
	./autogen.sh
	dh_auto_configure

# the kdist_clean target is called by make-kpkg modules_clean and from
# kdist* rules. It is responsible for cleaning up any changes that have
# been made by the other kdist_commands (except for the .deb files created)
kdist_clean: override_dh_auto_clean
	dh_testdir
	dh_clean
#
### end  KERNEL SETUP

binary-modules:
	dh_testroot
	dh_prep
	dh binary-arch

override_dh_auto_build:
	# Build the module
	dh_auto_build -- -C $(KSRC) M=$(CURDIR)/extensions \
		XA_ABSTOPSRCDIR=$(CURDIR) KERNEL_DIR=$(KSRC) \
		KVERS=$(KVERS) modules

override_dh_auto_install:
	# Install the module
	dh_testroot
	dh_prep
	dh_installdirs lib/modules/$(KVERS)/extra/xtables-addons
	dh_install extensions/xt_CUI.ko extensions/xt_ZHANG.ko extensions/xt_gfw.ko lib/modules/$(KVERS)/extra/xtables-addons

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) -C $(KSRC) M=$(CURDIR)/extensions \
		XA_ABSTOPSRCDIR=$(CURDIR) KERNEL_DIR=$(KSRC) \
                KVERS=$(KVERS)$(MFLAGS) clean

get-xtables-headers:
	tar --extract --to-stdout --file=/usr/src/xtables-addons.tar.bz2 \
		modules/xtables-addons/extensions/compat_xtables.c > \
		$(CURDIR)/extensions/compat_xtables.c
	tar --extract --to-stdout --file=/usr/src/xtables-addons.tar.bz2 \
		modules/xtables-addons/extensions/compat_xtables.h > \
		$(CURDIR)/extensions/compat_xtables.h
	tar --extract --to-stdout --file=/usr/src/xtables-addons.tar.bz2 \
		modules/xtables-addons/extensions/compat_skbuff.h > \
		$(CURDIR)/extensions/compat_skbuff.h
	tar --extract --to-stdout --file=/usr/src/xtables-addons.tar.bz2 \
		modules/xtables-addons/extensions/compat_xtnu.h > \
		$(CURDIR)/extensions/compat_xtnu.h