File: rules

package info (click to toggle)
bomstrip 9-6
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 216 kB
  • sloc: pascal: 41; cpp: 34; ansic: 34; java: 33; python: 31; makefile: 27; sh: 24; perl: 7; haskell: 6; php: 6; ruby: 6; awk: 2; sed: 1
file content (39 lines) | stat: -rwxr-xr-x 1,158 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
#!/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.

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

CFLAGS_WARN=	-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)))
	CFLAGS_WARN+=	-Werror
endif

include /usr/share/hardening-includes/hardening.make
ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
CFLAGS+=	$(HARDENING_CFLAGS)
LDFLAGS+=	$(HARDENING_LDFLAGS)
endif

CC?=		cc
CFLAGS+=	${CFLAGS_WARN}

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 $@