File: rules

package info (click to toggle)
iproute 980630-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 468 kB
  • ctags: 389
  • sloc: ansic: 8,276; makefile: 104
file content (56 lines) | stat: -rwxr-xr-x 1,636 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
#!/usr/bin/make -f
#
# Copyright (C) 1998 Roberto Lumbreras <rover@debian.org>
# Copying: GPL

# please put here where there is the 2.1.xxx kernel source
KERNEL_2_1_XXX_SRC=/usr/local/src/kernel/linux

SHELL	=	/bin/bash

PACKAGE	=	$(shell perl -e 'print <> =~ /^(.*) \(.*\)/' debian/changelog)
PKG_VER	=	$(shell perl -e 'print <> =~ /\((.*)\)/' debian/changelog)
PKG_UPVER=	$(shell perl -e 'print <> =~ /\((.*)-[^-]*\)/' debian/changelog)

BINS	=	ip/ip ip/rtmon tc/tc
DOCS	=	README
MAN8	=	debian/iproute.8

build:		stamp-build

stamp-build:
		$(MAKE) KERNEL_INCLUDE=$(KERNEL_2_1_XXX_SRC)/include
		touch stamp-build

binary:		binary-indep binary-arch

binary-indep:

binary-arch:	checkroot stamp-build
		$(RM) -r debian/tmp
		install -d -m0755 debian/tmp/{DEBIAN,sbin,usr/{man/man8,doc/$(PACKAGE)}}
		install -s -m0755 $(BINS) debian/tmp/sbin/
		install -m0644 $(DOCS) debian/README* debian/tmp/usr/doc/$(PACKAGE)/
		install -m0644 debian/changelog debian/tmp/usr/doc/$(PACKAGE)/changelog.Debian
		install -m0644 $(MAN8) debian/tmp/usr/man/man8/
		gzip -9fr debian/tmp/usr/{doc,man}
		install -m0644 debian/copyright debian/tmp/usr/doc/$(PACKAGE)/
		dpkg-shlibdeps $(BINS)
		dpkg-gencontrol
		chown -R root.root debian/tmp
		chmod -R go=rX debian/tmp
		dpkg --build debian/tmp ..

checkdir:
		@test -f debian/rules

checkroot:	checkdir
		@test 0 = `id -u` || { echo "Error: not super-user"; exit 1; }

clean:		checkdir debian/control
		$(RM) stamp-build debian/files debian/substvars
		$(MAKE) clean
		$(RM) `find . -name "*~" -o -name core`
		$(RM) -r debian/tmp

.PHONY: build binary binary-arch binary-indep checkdir checkroot clean