File: rules

package info (click to toggle)
bomstrip 9-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 172 kB
  • ctags: 24
  • sloc: pascal: 41; makefile: 41; cpp: 34; ansic: 33; java: 33; python: 31; sh: 24; perl: 7; haskell: 6; php: 6; ruby: 6; awk: 2; sed: 1
file content (60 lines) | stat: -rwxr-xr-x 1,689 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/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.

include /usr/share/quilt/quilt.make

D=$(CURDIR)/debian/s5

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
ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS)))
	DEB_BUILD_HARDENING=1
else
	DEB_BUILD_HARDENING=0
endif

CC?=		cc
CFLAGS+=	${CFLAGS_WARN}

HCC=		env DEB_BUILD_HARDENING="${DEB_BUILD_HARDENING}" ${CC}

build: build-stamp
build-stamp: ${QUILT_STAMPFN}
	dh build --before dh_auto_build
	${HCC} -c ${CFLAGS} bomstrip.c
	${HCC} ${CFLAGS} -o bomstrip bomstrip.o
	sed -e "s@'bomstrip'@/usr/bin/bomstrip@" < debian/bomstrip-files.sh > bomstrip-files
	env BOM=./bomstrip sh test.sh
	dh build --after dh_auto_build
	touch $@

clean:	unpatch
	rm -f bomstrip.o bomstrip bomstrip-files
	dh clean

install: build
	dh "$@" --before dh_installdirs
	dh_installdirs usr/bin usr/share/man/man1
	dh_install bomstrip bomstrip-files usr/bin
	dh_installman debian/bomstrip.1
	dh_link usr/share/man/man1/bomstrip.1 usr/share/man/man1/bomstrip-files.1
	dh "$@" --remaining

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh "$@"

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install