File: rules

package info (click to toggle)
mpack 1.5-7woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 756 kB
  • ctags: 1,261
  • sloc: ansic: 10,931; makefile: 113; perl: 25; sh: 10
file content (58 lines) | stat: -rwxr-xr-x 1,382 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
#!/usr/bin/make -f

DEBDIR = debian/tmp/DEBIAN
BINDIR = debian/tmp/usr/bin
MANDIR = debian/tmp/usr/share/man
DOCDIR = debian/tmp/usr/share/doc/mpack

ifneq (,$(findstring debug,${DEB_BUILD_OPTIONS}))
	DEBUG = -g
endif
ifeq (,$(findstring nostrip,${DEB_BUILD_OPTIONS}))
	STRIP = -s
endif

build:
	test -f debian/rules
	make CFLAGS="-O2 -Wall ${DEBUG}"
	touch build

clean:
	test -f debian/rules
	-rm -f build
	-make clean
	-rm -f debian/*~ core
	-rm -rf debian/tmp debian/files* debian/substvars

binary-indep:

binary-arch: build
	test root = "`whoami`"
	test -f debian/rules
	-rm -rf debian/tmp
# programs
	install -d ${BINDIR}
	install ${STRIP} -m 755 mpack ${BINDIR}
	install ${STRIP} -m 755 munpack ${BINDIR}
# manpages
	install -d ${MANDIR}/man1
	install -p -m 644 unixpk.man ${MANDIR}/man1/mpack.1
	install -p -m 644 unixunpk.man ${MANDIR}/man1/munpack.1
	gzip -9 ${MANDIR}/man1/*.1
# documentation
	install -d ${DOCDIR}
	install -p -m 644 README.unix ${DOCDIR}
	install -p -m 644 debian/changelog ${DOCDIR}/changelog.Debian
	gzip -9 ${DOCDIR}/*
	install -p -m 644 debian/copyright ${DOCDIR}
# control files
	install -d ${DEBDIR}
	install -p -m 755 debian/postinst ${DEBDIR}
	install -p -m 755 debian/prerm ${DEBDIR}
	dpkg-shlibdeps ${BINDIR}/*
	dpkg-gencontrol -isp
	dpkg --build debian/tmp ..

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean