File: rules

package info (click to toggle)
mig 1.8%2Bgit20200618-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,332 kB
  • sloc: ansic: 5,093; sh: 4,547; yacc: 558; lex: 284; makefile: 116; awk: 45
file content (80 lines) | stat: -rwxr-xr-x 2,316 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
#!/usr/bin/make -f
#
# Based on the work by Marcus Brinkmann <brinkmd@debian.org>
# Rewritten by Guillem Jover <guillem@debian.org>
# Rewritten to use `dh' by Pino Toscano <pino@debian.org>
#

export DEB_CFLAGS_MAINT_PREPEND := -Wall -pipe

include /usr/share/dpkg/architecture.mk

%:
	dh $@ -Bbuild

NATIVE_ARCHS=i386 hurd-i386 kfreebsd-i386

ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
CONFIGURE_OPTIONS = \
	  --program-prefix=$(DEB_TARGET_GNU_TYPE)-
ARCHS=$(NATIVE_ARCHS)
define d_a
$(shell dpkg-architecture -a$1 -A$1 -q$2 2> /dev/null)
endef
else
CONFIGURE_OPTIONS = \
	  --build=$(DEB_BUILD_GNU_TYPE) \
	  --host=$(DEB_HOST_GNU_TYPE) \
	  --target=$(DEB_TARGET_GNU_TYPE)
CROSSDEP=:$(DEB_TARGET_ARCH)
ARCHS=$(DEB_TARGET_ARCH)
# The cross compiler at this stage does not have these in its standard include
export TARGET_CPPFLAGS = -I/usr/include -I/usr/include/$(DEB_TARGET_GNU_TYPE) -I/usr/include/$(DEB_TARGET_MULTIARCH)
define d_a
$($2)
endef
endif

debian/control: debian/control.stamp
debian/control.stamp: debian/control.in debian/control.native.in debian/control.target.in debian/rules
	sed -e 's/@crossdep@/$(CROSSDEP)/' < debian/control.in > debian/control
	echo "#Note: XXX this file is generated from .in files, see debian/rules" >> debian/control

ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
	cat debian/control.native.in >> debian/control
endif

	$(foreach a,$(ARCHS), \
	  sed -e 's/@target@/$(call d_a,$a,DEB_TARGET_GNU_TYPE)/' \
	      -e 's/@debtarget@/$(call d_a,$a,DEB_TARGET_ARCH)/' \
	      -e 's/@debhost@/$(call d_a,$a,DEB_HOST_ARCH)/' \
	  < debian/control.target.in >> debian/control ; )

	touch $@

override_dh_auto_configure:
	dh_auto_configure -Bbuild -- \
	  --libexecdir=/usr/lib/mig/ \
	  $(CONFIGURE_OPTIONS)

ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
build-arch: debian/control.stamp
build-indep:
build: build-indep build-arch
endif

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

override_dh_install:
	dh_install
	dh_install -pmig-$(DEB_TARGET_GNU_TYPE) /usr/lib/mig/$(DEB_TARGET_GNU_TYPE)-migcom
	dh_install -pmig-$(DEB_TARGET_GNU_TYPE) /usr/bin/$(DEB_TARGET_GNU_TYPE)-mig

override_dh_gencontrol:
	dh_gencontrol -- -V"mig:host=mig-$(DEB_HOST_GNU_TYPE)"

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build-aux debian/control.stamp