File: rules

package info (click to toggle)
ipw2100 1.1.0-1
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 672 kB
  • ctags: 1,922
  • sloc: ansic: 10,914; sh: 292; makefile: 246
file content (180 lines) | stat: -rwxr-xr-x 4,616 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that can build a kernel modules
# architecture-dependant package via make-kpkg, as well as an
# architecture-independent module source package, and other packages
# either dep/indep for things like common files or userspace components
# needed for the kernel modules.
#
# This file can also be used with module-assistant, thanks to the help
# of Eduard Bloch

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

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

UPSTREAM_VERSION=$(shell dpkg-parsechangelog |grep ^Version | cut -d ' ' -f2 | cut -d "-" -f1)
PACKAGE=ipw2100-modules
psource=ipw2100-source
MA_DIR ?= /usr/share/modass
-include $(MA_DIR)/include/generic.make
-include $(MA_DIR)/include/common-rules.make

configure: configure-stamp
configure-stamp:
	touch configure-stamp


build-arch: configure-stamp  build-arch-stamp
build-arch-stamp:
	touch build-arch-stamp

# the binary-modules target prepares the $(pmodules) package.
# It is called by make-kpkg and *not* during a normal build
binary-modules: kdist_config
	export DH_OPTIONS='-p$(PKGNAME)'

	sed s/_UPSTREAM_VERSION_/$(UPSTREAM_VERSION)/ < debian/config > debian/config.new
	mv debian/config.new debian/config
	
	dh_testdir
	dh_testroot
	dh_clean -k

	# Build the module
	$(MAKE) -C driver KSRC=$(KSRC) KVER=$(KVERS)

	# Install the module
	$(MAKE) install -C driver DESTDIR=$(CURDIR)/debian/$(PKGNAME) KSRC=$(KSRC) KVER=$(KVERS)

	dh_installdebconf
	dh_installdocs debian/README.firmware debian/README.updates
	dh_installchangelogs
	dh_compress

	dh_installdeb
	dh_gencontrol -- -v$(VERSION)
	dh_md5sums
	dh_builddeb --destdir=$(DEB_DESTDIR)

# Map make-kpkgs targets to module assistant targets
kdist_config: prep-deb-files
kdist_configure: kdist_config
kdist_clean: clean

build-indep:  configure-stamp build-indep-stamp
build-indep-stamp:
	touch build-indep-stamp

build: build-arch build-indep

clean:
	dh_testdir
	$(ROOT_CMD) dh_testroot
	$(ROOT_CMD) rm -f build-arch-stamp build-indep-stamp configure-stamp

	$(ROOT_CMD) rm -rf modules
	-$(ROOT_CMD) $(MAKE) clean
	-$(ROOT_CMD) $(MAKE) -C driver clean

	$(ROOT_CMD) dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Create the directories to install the source into
	dh_installdirs -p$(psource)  usr/src/modules/ipw2100/driver
	dh_installdirs -p$(psource)  usr/src/modules/ipw2100/debian

	# Copy only the driver source to the proper location
	cp $(shell cat debian/driver.files) debian/$(psource)/usr/src/modules/ipw2100/driver
	# Copy the needed debian/ pieces to the proper location
	cp -a debian/README.firmware debian/README.updates debian/control debian/*.modules.in* \
		debian/rules debian/changelog debian/copyright debian/compat \
		debian/templates debian/po \
		debian/$(psource)/usr/src/modules/ipw2100/debian/
	cd debian/ipw2100-source/usr/src && \
		tar c modules | gzip -9 > ipw2100-source.tar.gz && rm -rf modules
	dh_install

# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs CHANGES -i
	dh_installdocs -i
	dh_installexamples -i
#	dh_install -i
#	dh_installmenu -i
	dh_installdebconf -i
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_installinfo -i
	dh_installman -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
#	dh_perl -i
#	dh_python -i
#	dh_makeshlibs -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -s
	dh_testroot -s
#	dh_installdebconf -s
	dh_installdocs -s
	dh_installexamples -s
	dh_installmenu -s
#	dh_installlogrotate -s
#	dh_installemacsen -s
#	dh_installpam -s
#	dh_installmime -s
#	dh_installinit -s
	dh_installcron -s
#	dh_installman -s
	dh_installinfo -s
	dh_installchangelogs CHANGES -s
	dh_strip -s
	dh_link -s
	dh_compress -s
	dh_fixperms -s
#	dh_makeshlibs -s
	dh_installdeb -s
#	dh_perl -s
	dh_shlibdeps -s
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s

binary: binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure binary-modules kdist kdist_config kdist_image kdist_clean