File: rules

package info (click to toggle)
rt2x00 0cvs20060928-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,580 kB
  • ctags: 4,930
  • sloc: ansic: 29,329; makefile: 241
file content (146 lines) | stat: -rwxr-xr-x 4,000 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

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

# prefix of the target package name
PACKAGE=rt2x00-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
-include $(MA_DIR)/include/common-rules.make

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

clean:
	dh_testdir
	dh_testroot
	-$(MAKE) -C Module clean
	dh_clean	
	rm -rf debian/build
	rm -f *-stamp

build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir

	# Copy most of the source tree into the temp directory and clean it
	cd $(CURDIR) \
		&& find . -path ./debian/\* -type d -prune -o -print \
		| egrep -v 'RPM|CVS|debian'  \
		| cpio -admp $(CURDIR)/debian/build/usr/src/modules/rt2x00
	cp -f $(CURDIR)/{README,THANKS,CHANGELOG} $(CURDIR)/debian/build/usr/src/modules/rt2x00
	ln -s /usr/share/doc/rt2x00-source/README.Debian $(CURDIR)/debian/build/usr/src/modules/rt2x00/INSTALL.Debian

	mkdir $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian
	cp -f $(CURDIR)/debian/*.modules.in $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian
	cp -f $(CURDIR)/debian/changelog $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian
	cp -f $(CURDIR)/debian/compat $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian
	cp -f $(CURDIR)/debian/copyright $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian
	cp -f $(CURDIR)/debian/rt2x00-source.docs $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian/docs
	cp -f $(CURDIR)/debian/rules $(CURDIR)/debian/build/usr/src/modules/rt2x00/debian

	-cd $(CURDIR)/debian/build/usr/src/modules/rt2x00 \
		&& make clean
	
	touch build-indep-stamp

install-indep: build-indep install-indep-stamp
install-indep-stamp:
	dh_testdir
	dh_testroot
	dh_clean -i -k
	dh_installdirs -i
	
	# Pack this up into a tarball
	chown -R root.src debian/build/usr/src/modules
	mkdir -p debian/rt2x00-source/usr/src
	cd debian/build/usr/src \
		&& tar cf - modules | gzip -9 > $(CURDIR)/debian/rt2x00-source/usr/src/rt2x00.tar.gz
	ln -s ../packages/default.sh \
		debian/rt2x00-source/usr/share/modass/overrides/rt2x00-source

	touch install-indep-stamp

# Build architecture-independent files here.
binary-indep: build-indep install-indep
	dh_testdir -i
	dh_testroot -i
#	dh_installdebconf -i
	dh_installdocs -i
#	dh_installexamples -i
#	dh_installmenu -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
	dh_installman -i
#	dh_installinfo -i
	dh_installmodules -i
	dh_installchangelogs -i CHANGELOG
	dh_strip -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch:
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

.PHONY: kdist_config
kdist_config: prep-deb-files

.PHONY: binary_modules binary-modules
binary-modules: binary_modules
binary_modules: kdist_config

	# Install module
	dh_installdirs lib/modules/$(KVERS)/kernel/drivers/net/wireless

	# Build modules
	$(MAKE) KERNDIR=$(KSRC)
	for i in *.ko ; do \
		install -m 0644 $$i $(CURDIR)/debian/rt2x00-modules-$(KVERS)/lib/modules/$(KVERS)/kernel/drivers/net/wireless ; \
	done

	dh_testdir
	dh_testroot
	dh_installdocs 
	dh_installmodules
	dh_installchangelogs CHANGELOG
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol -- -v$(VERSION)
	dh_md5sums
	dh_builddeb --destdir=$(DEB_DESTDIR)

.PHONY: kdist_clean
kdist_clean:
	$(MAKE) clean KERNDIR=$(KSRC)
	-dh_clean