File: rules

package info (click to toggle)
elfutils 0.183-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,868 kB
  • sloc: ansic: 102,871; sh: 28,261; cpp: 2,764; makefile: 1,511; yacc: 1,391; lex: 129; asm: 77; awk: 34; sed: 16
file content (149 lines) | stat: -rwxr-xr-x 4,441 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/usr/bin/make -f
# -*- makefile -*-
# Copyright 2006, Kurt Roeckx <kurt@roeckx.be>

# Based on the sample file from dh-make:
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1


# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
        confflags += --build=$(DEB_HOST_GNU_TYPE) --enable-maintainer-mode
else
        confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    USE_JOBS = -j$(NUMJOBS)
endif

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# https://sourceware.org/pipermail/elfutils-devel/2020q2/002733.html
ifneq (,$(findstring -flto, $(CFLAGS)))
  CFLAGS += -flto-partition=none -Wno-error=stack-usage=
  CXXFLAGS += -flto-partition=none
  LDFLAGS += -Wno-error=stack-usage=
endif
CFLAGS := $(patsubst -O%,-O3, $(CFLAGS))
CXXFLAGS := $(patsubst -O%,-O3, $(CXXFLAGS))

stamps/configure:
	dh_testdir
	dh_autoreconf
	@mkdir -p stamps
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	./configure --enable-maintainer-mode \
		--enable-libdebuginfod=dummy \
		--disable-debuginfod
	$(MAKE) $(USE_JOBS)
	$(MAKE) clean
endif
	CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
		./configure $(confflags) --prefix=/usr \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--program-prefix=eu- --disable-silent-rules \
		--$(if $(filter pkg.elfutils.nodebuginfod,$(DEB_BUILD_PROFILES)),dis,en)able-libdebuginfod \
		--$(if $(filter pkg.elfutils.nodebuginfod,$(DEB_BUILD_PROFILES)),dis,en)able-debuginfod
	touch $@

build: stamps/build
stamps/build: stamps/configure
	dh_testdir

	$(MAKE) $(USE_JOBS)

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Check that those files exist.
	-ls -l /proc/$$$$/maps
	-ls -l /proc/$$$$/auxv
	-ls -l /proc/$$$$/
	-LC_CTYPE=C $(MAKE) check $(USE_JOBS) || { cat tests/test-suite.log; exit 1; }
	cat tests/test-suite.log
endif

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -rf stamps
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_autoreconf_clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# Add here commands to install the package into debian/tmp
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	# We do not provide a libebl anymore, use libdw instead.
	rm -f debian/tmp/usr/include/elfutils/libebl.h

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

# Build architecture-dependent files here.
build-arch: build
binary-arch: build-arch install
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs

	: # FIXME: package those ...
#	find debian/tmp -name '*debuginfod*' | xargs -r rm -f
#	rm -f debian/tmp/usr/share/man/man1/eu-elfclassify.1
#	rm -f debian/tmp/usr/share/man/man1/eu-readelf.1
#	rm -f debian/tmp/usr/share/man/man3/elf_*.3

	: # these are empty envvar settings ...
	rm -rf debian/tmp/usr/etc/profile.d

	dh_install --sourcedir=debian/tmp
	rm -f debian/elfutils/usr/bin/debuginfod*
	dh_missing --fail-missing --sourcedir=debian/tmp

	dh_dwz
	dh_strip
	dh_strip_nondeterminism
	dh_compress
	dh_fixperms
	dpkg-gensymbols -Pdebian/libdw1/ -plibdw1 -c4
	dpkg-gensymbols -Pdebian/libasm1/ -plibasm1 -c4
	dpkg-gensymbols -Pdebian/libelf1/ -plibelf1 -c4
	dh_makeshlibs -plibelf1 -V "libelf1 (>= 0.132)"
	dh_makeshlibs -plibasm1 -V "libasm1 (>= 0.132)"
	dh_makeshlibs -plibdw1 -V "libdw1 (>= 0.138)"
	dh_makeshlibs -plibdebuginfod1
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

maint-unpatch:
	bash debian/unpatch.sh debian/patches

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