File: rules

package info (click to toggle)
bomstrip 9-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 216 kB
  • ctags: 29
  • sloc: pascal: 41; cpp: 34; ansic: 34; java: 33; python: 31; makefile: 25; sh: 24; perl: 7; haskell: 6; php: 6; ruby: 6; awk: 2; sed: 1
file content (38 lines) | stat: -rwxr-xr-x 1,266 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
#!/usr/bin/make -f
#
# Debhelper rules for bomstrip, the UTF-8 BOM strip utility
# Written by Peter Pentchev in 2008.
# This file is hereby placed into the public domain.

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all
export DEB_BUILD_MAINT_OPTIONS

CFLAGS=		$(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS=	$(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS=	$(shell dpkg-buildflags --get LDFLAGS)

DEB_CPPFLAGS_MAINT_APPEND=	-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
DEB_CFLAGS_MAINT_APPEND=	-pipe -Wall -W -ansi -pedantic -Wbad-function-cast \
		-Wcast-align -Wcast-qual -Wchar-subscripts -Winline \
		-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
		-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings
ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
	DEB_CFLAGS_MAINT_APPEND+=	-Werror
endif
export DEB_CFLAGS_MAINT_APPEND DEB_CPPFLAGS_MAINT_APPEND

CC?=		cc

override_dh_auto_build:
	${CC} -c ${CPPFLAGS} ${CFLAGS} bomstrip.c
	${CC} ${LDFLAGS} -o bomstrip bomstrip.o
	sed -e "s@'bomstrip'@/usr/bin/bomstrip@" < debian/bomstrip-files.sh > bomstrip-files

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	env BOM=./bomstrip sh test.sh
endif

%:
	dh $@ --parallel