4 EXTRA_CFLAGS= -Wall -Wextra -Wformat
5 EXTRA_CPPFLAGS= -DUSE_LIBBSD
6 EXTRA_LDFLAGS= -Wl,--as-needed
8 ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk))
9 # dpkg-dev (>= 1.16.1~)
10 DEB_CFLAGS_MAINT_APPEND=${EXTRA_CFLAGS}
11 DEB_CPPFLAGS_MAINT_APPEND=${EXTRA_CPPFLAGS}
12 DEB_LDFLAGS_MAINT_APPEND=${EXTRA_LDFLAGS}
13 DEB_BUILD_MAINT_OPTIONS=hardening=+all
14 include /usr/share/dpkg/buildflags.mk
16 # old-fashioned way to determine build flags
17 CFLAGS= -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
18 CFLAGS+= ${EXTRA_CFLAGS}
19 CPPFLAGS+= ${EXTRA_CPPFLAGS}
20 LDFLAGS+= ${EXTRA_LDFLAGS}
31 +for opts in '-flto=jobserver' '-fwhole-program --combine' ''; do \
33 ${CC} ${CPPFLAGS} ${CFLAGS} $$opts ${LDFLAGS} -o rs \
35 test -x rs && exit 0; \
36 done; echo >&2 Compiling failed.; exit 1
37 ifeq (,$(filter nocheck,${DEB_BUILD_OPTIONS}))
38 case $$(for i in 1 2 3 4 5 6 7 8 9; do echo $$i; done | \
39 ./rs 3 3 | md5sum) in \
40 d37c2eb45172c55279711a8e53041912*) echo pass test;; \
41 *) rm -f rs; echo FAIL test;; \
50 binary-indep: build-indep
52 binary-arch: build-arch
55 if test -x "$$(which dh_prep)"; then dh_prep; else dh_clean -k; fi
70 binary: binary-indep binary-arch
71 .PHONY: binary binary-arch binary-indep build build-arch build-indep clean