File: rules

package info (click to toggle)
papi 5.7.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,856 kB
  • sloc: ansic: 93,265; fortran: 3,338; xml: 2,460; makefile: 815; sh: 290
file content (81 lines) | stat: -rwxr-xr-x 2,194 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

SOVERSION	 = 5.7

# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DPKG_EXPORT_BUILDFLAGS	 = yes
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

# Upstream does not use CPPFLAGS
CFLAGS	+= $(CPPFLAGS)

%:
	dh $@ --sourcedirectory=src

override_dh_auto_configure:
	dh_auto_configure --sourcedirectory=src -- \
		--with-static-lib=yes \
		--with-shared-lib=yes \
		--with-shlib-tools \
		--with-perf-events \
		--with-pfm-incdir=/usr/include \
		--with-pfm-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		CC=$(CC)
	# for reproducibility
	sed -r -i '/^[CF]FLAGS/s/-fdebug-prefix-map=\S*\s*//' \
		src/ctests/Makefile.target \
		src/ftests/Makefile.target \
		src/testlib/Makefile.target \
		src/validation_tests/Makefile.target \
		src/components/Makefile_comp_tests.target

override_dh_auto_test:
	-env LD_LIBRARY_PATH=$(CURDIR)/src:$(LD_LIBRARY_PATH) dh_auto_test

override_dh_auto_install:
	dh_auto_install --sourcedirectory=src -- install-all
	# delete example binaries
	find debian/tmp/usr/share/papi -perm -100 -type f -delete
	find debian/tmp/usr/share/papi -name \*.a -type f -delete
	find debian/tmp/usr/share/papi -name Makefile -type f -print0 | \
		xargs -0r sed -i -e 's@ [^ ]*-f\(file\|debug\)-prefix-map=[^ ]*@@g'

override_dh_makeshlibs:
	dh_makeshlibs -a -- -c4

override_dh_shlibdeps:
	dh_shlibdeps -a -- --warnings=7

override_dh_missing:
	dh_missing --list-missing

override_dh_installchangelogs:
	dh_installchangelogs RELEASENOTES.txt

override_dh_compress:
	dh_compress -X.c -X.h -X.F -XMakefile

override_dh_gencontrol:
	dh_gencontrol -- \
		-V'papi:SOVERSION=$(SOVERSION)'


TEMPLATES	:= $(wildcard debian/libpapiSOVERSION.*)
GENERATED	 = $(subst SOVERSION,$(SOVERSION),$(TEMPLATES))

libpapi$(SOVERSION).%: libpapiSOVERSION.%
	sed 's/@SOVERSION@/$(SOVERSION)/g' $< > $@

build-generated: $(GENERATED) ;
clean-generated:
	$(RM) $(GENERATED)

override_dh_auto_configure: build-generated
clean: clean-generated