File: rules

package info (click to toggle)
libffi 3.2.1-9
  • links: PTS
  • area: main
  • in suites: buster
  • size: 5,304 kB
  • sloc: ansic: 25,713; asm: 12,881; sh: 11,687; exp: 513; makefile: 427; python: 161; cpp: 128
file content (135 lines) | stat: -rwxr-xr-x 3,830 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

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

unexport CPPFLAGS CFLAGS CXXFLAGS LDFLAGS

SHELL = /bin/bash

vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
DPKG_VARS := $(shell dpkg-architecture)
DEB_HOST_ARCH		?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
DEB_HOST_GNU_CPU	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU)
DEB_HOST_GNU_TYPE	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)

CC  = $(DEB_HOST_GNU_TYPE)-gcc
CXX = $(DEB_HOST_GNU_TYPE)-g++
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS   = $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS  = $(shell dpkg-buildflags --get LDFLAGS)

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
  with_check = yes
endif

major=6
p=libffi$(major)

configure: stamp-configure
stamp-configure:
	dh_testdir
	dh_autoreconf
	rm -rf build
	mkdir -p build
	cd build && ../configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--enable-pax_emutramp \
		CC="$(CC)" \
		CXX="$(CXX)" \
		CPPFLAGS="$(CPPFLAGS)" \
		CFLAGS="$(CFLAGS)" \
		CCASFLAGS="$(CFLAGS) -Wa,--gdwarf-2" \
		LDFLAGS="-Wl,-z,defs $(LDFLAGS)"
	touch $@
#		--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \

build-arch: build
build-indep: build
build: stamp-build $(if $(filter yes, $(with_check)), stamp-check)
stamp-build: stamp-configure
	dh_testdir
ifeq ($(DEB_BUILD_PROFILE),stage1)
	touch doc/libffi.info
endif
	$(MAKE) -C build
ifneq ($(DEB_BUILD_PROFILE),stage1)
	$(MAKE) -C build html
endif
	touch $@

check: stamp-check
stamp-check: stamp-build
	dh_testdir
	$(MAKE) -C build check 2>&1 | tee build/check.log
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f stamp-*
	rm -rf build*
	rm -f doc/libffi.info
	dh_autoreconf_clean
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -s
	$(MAKE) -C build DESTDIR=$(CURDIR)/debian/tmp install
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
	-mv debian/tmp/usr/lib/* debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/.
	cp -p build/.libs/libffi_convenience.a \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libffi_pic.a
	mkdir -p debian/libffi-dev/usr/share/doc/$(p)
ifneq ($(DEB_BUILD_PROFILE),stage1)
	cp -a build/doc/libffi.html debian/libffi-dev/usr/share/doc/$(p)/html
endif
	dh_install -s --sourcedir=debian/tmp

	mkdir -p debian/libffi-dev/usr/include/$(DEB_HOST_MULTIARCH)
	mv debian/libffi-dev/usr/include/*.h \
		debian/libffi-dev/usr/include/$(DEB_HOST_MULTIARCH)/


# 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_testdir
	dh_testroot
	dh_installchangelogs -s
	rm -f debian/libffi6/usr/share/doc/libffi$(major)/changelog
	dh_installdocs -s
	dh_installinfo -plibffi-dev doc/libffi.info
	rm -f debian/libffi-dev/usr/share/info/dir*
	cp -p ChangeLog debian/libffi-dev/usr/share/doc/libffi$(major)/changelog
	cp -p ChangeLog.* debian/libffi-dev/usr/share/doc/libffi$(major)/
	rm -rf debian/libffi-dev/usr/share/doc/libffi-dev
	ln -s libffi$(major) debian/libffi-dev/usr/share/doc/libffi-dev
	rm -rf debian/libffi$(major)-dbg/usr/share/doc/libffi$(major)-dbg
	ln -s libffi$(major) debian/libffi$(major)-dbg/usr/share/doc/libffi$(major)-dbg
	dh_strip -s --dbg-package=libffi$(major)-dbg
	dh_compress -s
	dh_fixperms -s
	dh_makeshlibs -plibffi$(major) --add-udeb=libffi$(major)-udeb
	dh_makeshlibs -s -Nlibffi$(major)
	dh_installdeb -s
	dh_shlibdeps -s
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s

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