File: rules

package info (click to toggle)
mol 0.9.70-17
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,436 kB
  • ctags: 11,008
  • sloc: ansic: 60,495; asm: 3,306; makefile: 716; yacc: 706; sh: 546; lex: 501; cpp: 370; perl: 228; pascal: 18
file content (114 lines) | stat: -rw-r--r-- 2,643 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
#!/usr/bin/make -f
# debian/rules for mol-modules
# written by Jens Schmalzing <jensen@debian.org>
# based on examples from the alsa-source and device3dfx-source packages

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=3

# This rules file is intended only to build the mol-modules-KVERS package.

M4 = m4
M4DEFINES = -DKVERS="$(KVERS)" -DKSRC="$(KSRC)" -DKEMAIL="$(KEMAIL)" -DKMAINT="$(KMAINT)" -DKDREV="$(subst :,+,$(KDREV))" -DDEBDATE="$(shell 822-date)"

# We are called from make-kpkg through one of the targets kdist,
# kdist_configure, kdist_changes, kdist_clean or kdist_image
# When called from make-kpkg we have available:
#  KVERS
#  KSRC
#  KEMAIL
#  KMAINT
#  KDREV

# Clear root command if already root
ifeq ($(shell id -u),0)
ROOT_CMD=
endif

configure: configure-stamp
configure-stamp: debian/control debian/changelog
	touch $@

build: build-stamp
build-stamp:	configure-stamp
	dh_testdir

	$(MAKE)

	touch $@

clean:
	test -e debian/control.m4

	$(MAKE) clean

	-dh_clean
	rm -f debian/control debian/changelog
	rm -f configure-stamp build-stamp install-stamp

install: install-stamp
install-stamp:	build-stamp
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs

	$(MAKE) DESTDIR=`pwd`/debian/mol-modules-$(KVERS) install

	touch $@

debian/control: debian/control.m4
	$(M4) $(M4DEFINES) $< > $@
debian/changelog: debian/changelog.m4
	$(M4) $(M4DEFINES) $< > $@

binary-mol-modules: install-stamp
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installmodules
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb --destdir=$(KSRC)/..

.PHONY:	configure build install

kdist_configure: configure-stamp

kdist_changes:
	@echo >&2 'Note: kdist_changes is obsolete'

kdist_clean: clean

kdist_image:
	$(ROOT_CMD) $(MAKE) -f debian/rules binary-mol-modules
	$(ROOT_CMD) $(MAKE) -f debian/rules clean

CHANGES=$(KSRC)/../$(shell awk '{sub("deb","changes",$$1);print $$1}' debian/files)
kdist: binary-mol-modules
	@echo Generating changes file '$(CHANGES)'.
	dpkg-genchanges -b -u"$(KSRC)/.." -cdebian/control > $(CHANGES)
	$(ROOT_CMD) $(MAKE) -f debian/rules binary-mol-modules
	$(ROOT_CMD) $(MAKE) -f debian/rules clean

.PHONY: kdist kdist_image kdist_changes kdist_configure

# We are called from dpkg-build through one of the targets binary,
# binary-arch: fault these.

binary binary-arch:
	@echo >&2 'Use make-kpkg to compile this module' && false

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

.PHONY: binary binary-arch source diff