File: rules

package info (click to toggle)
openafs 1.8.14-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 42,972 kB
  • sloc: ansic: 455,934; xml: 66,858; perl: 11,967; makefile: 10,038; sh: 7,955; objc: 6,354; java: 5,638; cpp: 2,268; asm: 1,214; yacc: 441; tcl: 249; lex: 201; csh: 85
file content (111 lines) | stat: -rwxr-xr-x 3,614 bytes parent folder | download | duplicates (10)
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
#!/usr/bin/make -f

# Determine whether we're building with optimization.  This doesn't really
# work at the moment due to upstream problems.
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    DEBIAN_OPT_FLAGS = --disable-optimize --disable-optimize-lwp
    DEBIAN_KERN_FLAGS = --disable-optimize-kernel
else
    DEBIAN_OPT_FLAGS =
    DEBIAN_KERN_FLAGS =
endif

# Find kernel build information.
ifndef KSRC
    KSRC := /lib/modules/$(shell uname -r)/build
endif
ifndef KPKG_DEST_DIR
    KPKG_DEST_DIR = ..
endif
KVERS := $(shell perl debian/kernel-version $(KSRC))
export KSRC 
export KVERS
export KPKG_DEST_DIR

SYS_NAME  := $(shell KSRC="$(KSRC)" KVERS="$(KVERS)" ARCH="$(ARCH)" \
		sh debian/sysname)

package    = openafs
modulepkg := openafs-modules-$(KVERS)${INT_SUBARCH}
moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs

# After building the package, m-a calls debian/rules with the target
# echo-debfile.  Without this dummy rule, this would trigger the setup
# target (by way of the wildcard rule for dh), which re-creates the setup
# flag file that we removed during make clean.
#
# Then, if module-assistant unpacks a new version of the source, the setup
# file already exists so the setup rule isn't run again.  But the
# debian/control file is the template from the new source, which doesn't
# contain any buildable packages.
#
# Add a dummy target for echo-debfile to ensure that setup isn't run again
# after clean.  If there are further changes to module-assistant, causing it
# to run other targets after clean, more similar dummy rules may need to be
# added.
echo-debfile:
	@true

# make-kpkg tries to rebuild debian/rules first, so add a dummy target to
# avoid our dh wildcard rule and a fatal error.
debian/rules ./debian/rules:
	@true

# This setup must be done before running any other target if it hasn't
# already been done.
setup:
	@if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
	@if test x"$(KVERS)" = x ; then \
	    echo 'No version in $(KSRC)/include/linux/version.h' >&2 ; \
	    exit 1 ; \
	fi
	sh debian/prep-modules $(KSRC)
	touch $@

%: setup
	dh $@

override_dh_auto_configure:
	sh configure --prefix=$(CURDIR)/debian/tmp \
	    --with-afs-sysname=$(SYS_NAME) \
	    --disable-linux-syscall-probing \
	    --with-linux-kernel-headers=$(KSRC) \
	    --with-linux-kernel-packaging \
	    --enable-debug --enable-debug-lwp --enable-debug-kernel \
	    $(DEBIAN_OPT_FLAGS) $(DEBIAN_KERN_FLAGS)

override_dh_auto_install:
	cd src/libafs && make install DESTDIR=$(CURDIR)/debian/tmp
	install -d -g root -o root -m 755 $(moduledir)
	install -g root -o root -m 644 \
	    debian/tmp/lib/modules/*/extra/openafs/*o $(moduledir)/

override_dh_clean:
	rm -rf src/libafs/MODLOAD-* *-stamp
	dh_clean Makefile config.log config.status setup src/libafs/Makefile \
	    src/libafs/Makefile.common src/libafs/asm src/libafs/asm-generic \
	    src/libafs/h src/libafs/linux src/libafs/net src/libafs/netinet \
	    src/libafs/rpc src/libafs/sys

override_dh_gencontrol:
	dh_gencontrol -- -v`cat debian/VERSION`

override_dh_builddeb:
	dh_builddeb --destdir="$(KPKG_DEST_DIR)"

kdist_configure: override_dh_auto_configure

kdist_image:
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean

kdist:
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-arch
	KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \
	    sh -v debian/genchanges
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean

kdist_clean:
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean

.PHONY: kdist kdist_clean kdist_configure kdist_image