File: rules

package info (click to toggle)
omfs 0.8.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 144 kB
  • ctags: 160
  • sloc: ansic: 1,364; makefile: 100
file content (98 lines) | stat: -rwxr-xr-x 2,335 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
#!/usr/bin/make -f
# -*- makefile -*-

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
export CFLAGS


## Stuff from mod-ass HOWTO-DEVEL
# prefix of the target package name
PACKAGE=omfs-module
# modifiable 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
MAJOR=$(shell echo $(KVERS) | sed -e 's/\(.\..\).*/\1/')
ifeq ($(MAJOR),2.6)
KO=k
endif
kdist_clean:
	dh_clean
	$(MAKE) KERNELDIR="$(KSRC)" clean
# prep-deb-files rewrites the debian/ files as needed. See RATIONALE for
# details
kdist_config: prep-deb-files
# ... additional kernel specific things to configure...
kdist_configure: kdist_config
binary-modules: prep-deb-files
	dh_testdir
	dh_testroot
	dh_clean -k
	$(MAKE) KERNELDIR="$(KSRC)" MODVERSIONS=detect KERNEL="linux-$(KVERS)"
	install -m644 -b -D omfs.$(KO)o "$(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/omfs/omfs.$(KO)o"
	dh_installdocs omfs.txt
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installmodules
	dh_installdeb
	dh_gencontrol -- -v$(VERSION)
	dh_md5sums
	dh_builddeb --destdir=$(DEB_DESTDIR)


build: build-stamp
build-stamp:
	touch $@

clean:
	dh_testdir
	dh_testroot
	dh_clean 
	rm -f install-stamp build-stamp

install: install-stamp
install-stamp:
	dh_testdir
	dh_testroot
	dh_clean -k
# Copy the module source
	dh_installdirs
	cp -a $(shell grep ^DISTFILES Makefile | cut -d= -f2) debian/omfs-source/usr/src/modules/omfs/
# Copy needed debian/ files
	mkdir -p debian/omfs-source/usr/src/modules/omfs/debian
	cp -a $(addprefix debian/, changelog control compat *.modules.in rules copyright) debian/omfs-source/usr/src/modules/omfs/debian
# Tar up the module source
	cd debian/omfs-source/usr/src/; tar -c modules | bzip2 -9 > omfs.tar.bz2 && rm -rf modules
	touch $@

binary: install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb
.PHONY: build clean binary install