0 | 0 |
#!/usr/bin/make -f
|
1 | 1 |
|
2 | |
ifeq (,$(findstring terse,${DEB_BUILD_OPTIONS}))
|
|
2 |
ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
|
3 | 3 |
export DH_VERBOSE=1
|
4 | 4 |
export V=1
|
5 | 5 |
export VERBOSE=1
|
|
8 | 8 |
LC_ALL:=C
|
9 | 9 |
export LC_ALL
|
10 | 10 |
|
|
11 |
shellescape='$(subst ','\'',$(1))'
|
|
12 |
shellexport=$(1)=$(call shellescape,${$(1)})
|
|
13 |
|
|
14 |
ifneq (,$(wildcard /usr/share/dpkg/buildtools.mk))
|
|
15 |
include /usr/share/dpkg/buildtools.mk
|
|
16 |
else
|
|
17 |
# is ${CC} defined anywhere (other than implicit rules?)
|
|
18 |
ifneq (,$(findstring $(origin CC),default undefined))
|
|
19 |
# no - then default to gcc (or cross-gcc)
|
11 | 20 |
DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
12 | 21 |
DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
|
13 | 22 |
ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
|
14 | 23 |
DEB_HOST_GNU_TYPE?=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
24 |
CC= ${DEB_HOST_GNU_TYPE}-gcc
|
|
25 |
else
|
|
26 |
CC= gcc
|
15 | 27 |
endif
|
16 | |
|
17 | |
# is ${CC} defined anywhere (other than implicit rules?)
|
18 | |
ifneq (,$(findstring $(origin CC),default undefined))
|
19 | |
# no - then default to gcc (or cross-gcc)
|
20 | |
ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH})
|
21 | |
CC= ${DEB_HOST_GNU_TYPE}-gcc
|
22 | |
else
|
23 | |
CC= gcc
|
24 | 28 |
endif
|
25 | 29 |
endif
|
26 | 30 |
|
27 | |
EXTRA_CFLAGS= -Wall -Wextra -Wformat
|
28 | |
EXTRA_CPPFLAGS= -DUSE_LIBBSD
|
29 | |
EXTRA_LDFLAGS= -Wl,--as-needed
|
|
31 |
OUR_CPPFLAGS:=
|
|
32 |
OUR_CFLAGS:=
|
|
33 |
OUR_LDFLAGS:= -Wl,--as-needed
|
|
34 |
|
|
35 |
ifneq (,$(filter debug,${DEB_BUILD_OPTIONS}))
|
|
36 |
OUR_CFLAGS+= -Og -g3
|
|
37 |
endif
|
|
38 |
|
|
39 |
OUR_CFLAGS+= -Wall -Wextra -Wformat
|
|
40 |
OUR_CPPFLAGS+= -DUSE_LIBBSD
|
30 | 41 |
|
31 | 42 |
ifneq (,$(wildcard /usr/share/dpkg/buildflags.mk))
|
32 | 43 |
# dpkg-dev (>= 1.16.1~)
|
33 | 44 |
dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
|
34 | |
DEB_CFLAGS_MAINT_APPEND=$(call dpkgbuildflagsmkescape,${EXTRA_CFLAGS})
|
35 | |
DEB_CPPFLAGS_MAINT_APPEND=$(call dpkgbuildflagsmkescape,${EXTRA_CPPFLAGS})
|
36 | |
DEB_LDFLAGS_MAINT_APPEND=$(call dpkgbuildflagsmkescape,${EXTRA_LDFLAGS})
|
37 | |
DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
|
45 |
export DEB_BUILD_MAINT_OPTIONS:=hardening=+all
|
|
46 |
export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
|
|
47 |
export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
|
|
48 |
export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
|
38 | 49 |
include /usr/share/dpkg/buildflags.mk
|
39 | 50 |
else
|
40 | 51 |
# old-fashioned way to determine build flags
|
41 | |
CFLAGS= -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
|
42 | |
CFLAGS+= ${EXTRA_CFLAGS}
|
43 | |
CPPFLAGS+= ${EXTRA_CPPFLAGS}
|
44 | |
LDFLAGS+= ${EXTRA_LDFLAGS}
|
|
52 |
CFLAGS= -O$(if $(findstring noopt,${DEB_BUILD_OPTIONS}),0,2) -g
|
|
53 |
CPPFLAGS+= ${OUR_CPPFLAGS}
|
|
54 |
CFLAGS+= ${OUR_CFLAGS}
|
|
55 |
LDFLAGS+= ${OUR_LDFLAGS}
|
45 | 56 |
endif
|
46 | 57 |
|
47 | |
LDADD+= -lbsd
|
|
58 |
#include /usr/share/dpkg/pkg-info.mk
|
|
59 |
|
|
60 |
#ifneq (,$(filter parallel,${DEB_BUILD_OPTIONS}))
|
|
61 |
#MAKE_ARGS+= -j
|
|
62 |
#else ifneq (,$(filter parallel=%,${DEB_BUILD_OPTIONS}))
|
|
63 |
#MAKE_ARGS+= -j$(patsubst parallel=%,%,$(filter parallel=%,${DEB_BUILD_OPTIONS}))
|
|
64 |
#endif
|
|
65 |
|
|
66 |
LDADD+= -lbsd
|
48 | 67 |
|
49 | 68 |
build build-arch: rs
|
50 | 69 |
build-indep:
|