File: rules

package info (click to toggle)
libflorist 2016-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,204 kB
  • ctags: 291
  • sloc: ada: 11,902; ansic: 7,195; makefile: 155; sh: 19
file content (88 lines) | stat: -rwxr-xr-x 2,904 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
#!/usr/bin/make -f

# Copyright (c) 2003-2014 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2014-2016 Nicolas Boulenguez <nicolas@debian.org>

# This build script is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# On Debian systems, the full text of the GPL is in the file
# /usr/share/common-licenses/GPL-3.

######################
# Set some variables #
######################

DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie
include /usr/share/dpkg/default.mk
include /usr/share/ada/debian_packaging*.mk

DEB_DATE := $(shell dpkg-parsechangelog -S date)

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

ADAFLAGS += -gnatVa -gnatafno -gnatwa
CFLAGS += -w

soversion := $(shell sed -n \
  '/^Package: libflorist\([[:digit:]]\+\)$$/{s//\1/;p;q}' debian/control)
ifndef soversion
  $(warning Could not guess soversion from debian/control)
  # Not error. Policy defines targets that may be run from outside build dir.
endif

POLICY_TARGETS := binary binary-arch binary-indep build build-arch \
  build-indep clean
.PHONY: $(POLICY_TARGETS)
$(POLICY_TARGETS):
	dh $@ --with ada-library

.PHONY: $(addprefix override_dh_auto_, configure build test install clean)

override_dh_auto_configure: configure.backup
	dh_auto_configure -- $(foreach v, \
	  ADAFLAGS CC CFLAGS CPPFLAGS LDFLAGS \
	  ,"$(v)=$($(v))")

configure.backup:
	mv configure configure.backup
	autoconf
override_dh_auto_clean::
	if test -f configure.backup; then mv configure.backup configure; fi

GPR_CONFIG := default.cgpr
override_dh_auto_build: $(GPR_CONFIG)
$(GPR_CONFIG):
	gprconfig --batch --config=Ada --config=C,,,,gnatgcc
override_dh_auto_clean::
	rm -f $(GPR_CONFIG)

override_dh_auto_build:
	$(MAKE) LIBRARY_TYPE_OPTION=-XLIBRARY_TYPE=static \
	  "GPRBUILD_FLAGS=$(BUILDER_OPTIONS) -XSOVERSION=$(soversion)"

	# Touch generated sources for deterministic ALI files.
	# Touch all recent files so that Make does not regenerate everything.
	find . -depth -newermt '$(DEB_DATE)' -print0 | \
	  xargs -0r touch --no-dereference --date='$(DEB_DATE)'

	$(MAKE) LIBRARY_TYPE_OPTION=-XLIBRARY_TYPE=relocatable \
	  "GPRBUILD_FLAGS=$(BUILDER_OPTIONS) -XSOVERSION=$(soversion)"
override_dh_auto_clean::
	dh_auto_clean

.PHONY: override_dh_ada_library
override_dh_ada_library:
	dh_ada_library LIBRARY_TYPE=relocatable \
	  SOVERSION=$(soversion) florist.gpr