File: rules

package info (click to toggle)
vala 0.34.7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 38,080 kB
  • ctags: 88,985
  • sloc: ansic: 488,536; sh: 4,665; xml: 3,101; makefile: 1,844; yacc: 1,218; lex: 374; perl: 106
file content (148 lines) | stat: -rwxr-xr-x 3,795 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
#!/usr/bin/make -f

DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

configure_flags += \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
	--build=$(DEB_BUILD_GNU_TYPE) \
	--enable-vapigen \
	--enable-unversioned \
	--disable-maintainer-mode \
	--disable-silent-rules

ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
configure_flags += --host=$(DEB_HOST_GNU_TYPE)
endif

CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
CFLAGS += -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif

LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
LDFLAGS += -Wl,-z,defs -Wl,-O1 -Wl,--as-needed

DEB_PARALLEL_JOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
ifneq (,$(DEB_PARALLEL_JOBS))
DEB_MAKE_PARALLEL = -j$(DEB_PARALLEL_JOBS)
else
DEB_MAKE_PARALLEL =
endif

builddir-stamp:
	dh_testdir
	# handle timestamp skew
	touch vala/vala.vala.stamp
	# update build system
	dh_autoreconf --as-needed
	touch $@

configure-bootstrap-stamp: builddir-stamp
	dh_testdir
	mkdir -p bootstrap/build
	cd bootstrap/build && \
		../../configure CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(configure_flags) --disable-vapigen
	touch $@

bootstrap-stamp: configure-bootstrap-stamp
	dh_testdir
	make $(DEB_MAKE_PARALLEL) -C bootstrap/build
	make $(DEB_MAKE_PARALLEL) -C bootstrap/build DESTDIR=$(CURDIR)/bootstrap/install install
	touch $@

configure-stamp: builddir-stamp bootstrap-stamp
	rm -f */*.vala.stamp
	LD_LIBRARY_PATH="$(CURDIR)/bootstrap/install/usr/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH" \
		./configure CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
		VALAC="$(CURDIR)/bootstrap/install/usr/bin/valac" \
		$(configure_flags)
	touch $@

build-stamp: configure-stamp
	LD_LIBRARY_PATH="$(CURDIR)/bootstrap/install/usr/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH" \
		make $(DEB_MAKE_PARALLEL)
	touch $@

# Make testsuite failures non-fatal for these architectures. The DBus
# tests are failing there and an yet unknown reason.
NO_TESTSUITE_ARCHS := kfreebsd-i386 kfreebsd-amd64 hurd-i386

check-stamp: build-stamp
	# do not run the tests under fakeroot, that breaks D-Bus
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(filter $(DEB_BUILD_ARCH),$(NO_TESTSUITE_ARCHS)),$(DEB_BUILD_ARCH))
	-LD_PRELOAD= make $(DEB_MAKE_PARALLEL) check
else
	LD_PRELOAD= make $(DEB_MAKE_PARALLEL) check
endif
endif
	touch $@

install-stamp: build-stamp check-stamp
	LD_LIBRARY_PATH="$(CURDIR)/bootstrap/install/usr/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH" \
		make $(DEB_MAKE_PARALLEL) DESTDIR=$(CURDIR)/debian/tmp install
	touch $@

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
install: build install-stamp

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_install -i
	dh_installdirs -i
	dh_installdocs -i -A NEWS README AUTHORS THANKS
	dh_installchangelogs -i ChangeLog
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install -a
	dh_installdirs -a
	dh_installdocs -a -A README NEWS AUTHORS THANKS
	dh_installchangelogs -a ChangeLog
	dh_installman -a
	dh_installexamples -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -V -- -c4
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

clean:
	dh_testdir
	dh_testroot

	rm -rf bootstrap
	rm -rf debian/tmp
	make distclean || true

	rm -rf tests/_test
	dh_autoreconf_clean

	rm -f builddir-stamp configure-bootstrap-stamp bootstrap-stamp
	rm -f configure-stamp build-stamp check-stamp install-stamp
	dh_clean