File: rules

package info (click to toggle)
module-init-tools 3.4-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,208 kB
  • ctags: 900
  • sloc: sh: 7,980; ansic: 5,036; makefile: 204
file content (95 lines) | stat: -rwxr-xr-x 2,464 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
#!/usr/bin/make -f
SHELL+= -e

BUILD_UDEB := 1
DISABLE_ZLIB := --disable-zlib



QUILT_STAMPFN := debian/.stamp-patched
include /usr/share/quilt/quilt.make

D := $(CURDIR)/debian/module-init-tools

# for dpkg-cross
DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
ifneq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
  CROSS := --host=$(DEB_HOST_GNU_TYPE)
endif

all: build

clean: unpatch
	rm -rf debian/.stamp-* obj obj-udeb
	[ ! -e config.sub.back ]   || mv config.sub.back config.sub;
	[ ! -e config.guess.back ] || mv config.guess.back config.guess
#	[ ! -e Makefile ] || $(MAKE) distclean
	dh_clean

configure: debian/.stamp-configure
debian/.stamp-configure: $(QUILT_STAMPFN)
	dh_testdir
	mv config.sub config.sub.back; mv config.guess config.guess.back
	ln -sf /usr/share/misc/config.sub /usr/share/misc/config.guess .
	mkdir obj/ && cd obj/ && \
	CFLAGS='-DCONFIG_NO_BACKWARDS_COMPAT -g' \
	../configure --prefix=/ $(DISABLE_ZLIB) $(CROSS)
ifdef BUILD_UDEB
	mkdir obj-udeb/ && cd obj-udeb/ && \
	CFLAGS='-DCONFIG_NO_BACKWARDS_COMPAT -g -Os -fomit-frame-pointer' \
	../configure --prefix=/ --disable-zlib  $(CROSS)
endif
	touch $@


build: debian/.stamp-build
debian/.stamp-build: debian/.stamp-configure
	dh_testdir
	cd obj && $(MAKE)
ifdef BUILD_UDEB
	cd obj-udeb && $(MAKE) lsmod insmod depmod modprobe
endif
	touch $@


install: debian/.stamp-build checkroot
	dh_testdir
	dh_clean -k

	dh_installdirs bin/ sbin/ etc/modprobe.d/arch/ lib/modules/
	dh_install --sourcedir=obj/ -p module-init-tools
	cp extra/modprobe.d/aliases $D/etc/modprobe.d/

	install --mode=755 extra/update-modules $D/sbin/
	sh extra/installarchconf $D/etc/modprobe.d/arch/

ifdef BUILD_UDEB
	dh_installdirs bin/ sbin/ etc/modprobe.d/ -p module-init-tools-udeb
	dh_install --sourcedir=obj-udeb/ -p module-init-tools-udeb
	cat $D/etc/modprobe.d/arch/* extra/modprobe.d/aliases \
		> $D-udeb/etc/modprobe.d/aliases || true
endif

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installman extra/*.5 extra/*.8 obj/*.5 obj/*.8
	dh_installinit --no-start --update-rcd-params="start 20 S ."
	dh_link bin/lsmod sbin/lsmod
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_builddeb

binary:	binary-arch

checkroot:
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep unpack configure build clean checkroot