File: rules

package info (click to toggle)
mpack 1.6-8.1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,144 kB
  • ctags: 1,184
  • sloc: ansic: 8,785; sh: 330; makefile: 75; perl: 25
file content (72 lines) | stat: -rwxr-xr-x 1,855 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
#!/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

ifeq (,$(findstring noopt,${DEB_BUILD_OPTIONS}))
	OPT = -O2
endif

STRIP = strip --remove-section=.comment --remove-section=.note

export DEB_HOST  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

CFLAGS += ${OPT} -g -Wall

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
	test -f debian/rules
	./configure --prefix=/usr --build ${DEB_BUILD} --host ${DEB_BUILD}
	make CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
	touch build

clean:
	test -f debian/rules
	-rm -f build
	[ ! -f Makefile ] || $(MAKE) clean
	-rm -f debian/*~ core
	-rm -f config.log config.cache config.status Makefile
	-rm -f mpack.1 munpack.1
	-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}
	${STRIP} mpack
	${STRIP} munpack
	install -m 755 mpack ${BINDIR}
	install -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}
	dpkg-shlibdeps ${BINDIR}/*
	dpkg-gencontrol -isp
	dpkg-deb --build debian/tmp ..

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean