File: rules

package info (click to toggle)
xidle 20200802
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 68 kB
  • sloc: ansic: 384; makefile: 52
file content (62 lines) | stat: -rwxr-xr-x 1,490 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
#!/usr/bin/make -f

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

LC_ALL:=C
export LC_ALL
TZ:=UTC
export TZ

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

OUR_CPPFLAGS:=
OUR_CFLAGS:=
OUR_LDFLAGS:=

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

OUR_CPPFLAGS+=	-D_FILE_OFFSET_BITS=64

BMAKE_FLAGS+=	MBSDPORT_SRCS=strtonum.c
OUR_CPPFLAGS+=	-DNEED_STRTONUM
OUR_CPPFLAGS+=	-DMBSDPORT_H=\"debian/mbsdport.h\"
OUR_CFLAGS+=	-Wall -Wextra -Wformat

# 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

# disable -Werror for package build (comment this out if developing)
BMAKE_FLAGS+=	NOGCCERROR=Yes

DO_BSDMAKE:=	env \
		    $(foreach i,CC CPPFLAGS CFLAGS LDFLAGS,$(call shellexport,$i)) \
		    bmake -m /usr/share/bmake/mk-netbsd ${BMAKE_FLAGS}

%:
	dh $@ -Snone

override_dh_auto_clean:
	${DO_BSDMAKE} clean
	-rm -f .depend

override_dh_auto_build:
	${DO_BSDMAKE} clean
	-rm -f .depend
	${DO_BSDMAKE} depend
	${DO_BSDMAKE} xidle
	test -x xidle