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