File: rules

package info (click to toggle)
rng-tools-debian 2.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 332 kB
  • sloc: ansic: 2,687; sh: 178; makefile: 55
file content (54 lines) | stat: -rwxr-xr-x 1,344 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
#!/usr/bin/make -f

ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
export DH_VERBOSE=1
export V=1
export VERBOSE=1
endif

LC_ALL:=C.UTF-8
export LC_ALL
TZ:=UTC
export TZ

shellescape='$(subst ','\'',$(1))'
shellexport=$(1)=$(call shellescape,${$(1)})

DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)

OUR_CPPFLAGS:=
OUR_CFLAGS:=
OUR_LDFLAGS:=

ifneq (,$(filter debug,${DEB_BUILD_OPTIONS}))
OUR_CFLAGS+=	-Og -g3
endif

OUR_CFLAGS+=	-Wall

# only needed when backporting to buster and older
#OUR_LDFLAGS+=	-Wl,--as-needed

dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
export DEB_BUILD_MAINT_OPTIONS:=hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/buildtools.mk

# detect i386 and force-enable VIA PadLock support
ifeq (i386,$(strip ${DEB_HOST_ARCH}))
CONFIGURE_ARGS+=	--enable-viapadlock
endif

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- ${CONFIGURE_ARGS}
	# quieten binutils vs. autotools/libtool conflict of interest
	perl -pi -e 's/^ARFLAGS\s*=.*$$/ARFLAGS=rc/' Makefile

override_dh_installinit:
	dh_installinit --error-handler=true