File: rules

package info (click to toggle)
afl 2.36b-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,172 kB
  • sloc: ansic: 8,354; sh: 742; makefile: 242; cpp: 84; sql: 40; perl: 26; xml: 3
file content (59 lines) | stat: -rwxr-xr-x 1,816 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
#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

cflags_nopie = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie dpkg-buildflags --get CFLAGS)
ldflags_nopie = $(shell DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie dpkg-buildflags --get LDFLAGS)

# don't emit NEON instructions whatsoever to prevent FTBFS on machines which
# doesn't support that, see #842143 [thanks to Paul Wise]
ifeq "$(shell dpkg-architecture -q DEB_HOST_ARCH)" "armhf"
clang_cflags := $(CFLAGS) -mfpu=vfpv3
clang_cxxflags := $(CXXFLAGS) -mfpu=vfpv3
endif

export HOSTNAME =
export PREFIX = /usr

ifeq "$(filter i386 amd64,$(shell dpkg-architecture -q DEB_HOST_ARCH_CPU))" ""
export AFL_NO_X86 = 1
endif

%:
	dh $@

override_dh_auto_build:
	$(MAKE)
	CFLAGS="$(cflags_nopie)" LDFLAGS="$(ldflags_nopie)" $(MAKE) -C libdislocator
	CFLAGS="$(cflags_nopie)" LDFLAGS="$(ldflags_nopie)" $(MAKE) -C libtokencap
	CFLAGS="$(clang_cflags)" CXXFLAGS="$(clang_cxxflags)" $(MAKE) -C llvm_mode

override_dh_auto_install:
	$(MAKE) install DESTDIR=debian/tmp
	rm debian/tmp/usr/share/doc/afl/ChangeLog
	rm debian/tmp/usr/share/doc/afl/README
	$(MAKE) -C libdislocator install DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C libtokencap install DESTDIR=$(CURDIR)/debian/tmp
	dh_install --fail-missing
ifneq "$(AFL_NO_X86)" ""
	cd debian/afl/usr/bin/ && rm afl-gcc afl-g++
	cd debian/afl/usr/lib/afl/ && rm as afl-as
	cd debian/afl-clang/usr/bin/ && rm afl-clang afl-clang++
endif

override_dh_install:

override_dh_installdocs:
	dh_installdocs -A docs/README
	dh_buildinfo -Nafl-doc

override_dh_strip_nondeterminism:
	# not needed, and don't touch testcases and vuln_samples (see e.g. #803503)

override_dh_compress:
	dh_compress -X.c -X.mp4 -X.sql -XREADME

override_dh_gencontrol:
#	debian/dh_clang -p afl-clang
	dh_gencontrol