File: rules

package info (click to toggle)
libgmpada 1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 600 kB
  • ctags: 93
  • sloc: ada: 5,112; makefile: 146; ansic: 118; sh: 15
file content (82 lines) | stat: -rwxr-xr-x 2,569 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
#!/usr/bin/make -f

##############
# Legal stuff
##############

# Copyright (c) 2003-2009 Ludovic Brenta <lbrenta@debian.org>
# Copyright (c) 2009-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

ADAFLAGS += -gnatn
# This is very useful for the thin binding.

LIB_NAME := $(patsubst lib%,%,$(DEB_SOURCE))

SOVERSION := $(shell sed -n -e "s/^Package: lib$(LIB_NAME)\([[:digit:]]\+\)$$/\1/p" 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

######################
# debhelper overrides
######################

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

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

OPTIONS_FOR_UPSTREAM_MAKE = $(foreach var,\
 ADAFLAGS CFLAGS CPPFLAGS LDFLAGS SOVERSION,$(var)="$($(var))") \
 GNATMAKE_OPTIONS="$(BUILDER_OPTIONS)"

.PHONY: override_dh_auto_build override_dh_auto_test
override_dh_auto_build override_dh_auto_test: override_%:
	$* -- $(OPTIONS_FOR_UPSTREAM_MAKE)
override_dh_auto_test: ADAFLAGS += -gnata

# Ignore this target from upstream Makefile.
.PHONY: override_dh_auto_install

.PHONY: override_dh_ada_library
override_dh_ada_library:
	dh_ada_library \
          LDLIBS="`sed -n '/^LDLIBS := /{s///;p;q}' Makefile`" debian/fake.gpr

.PHONY: override_dh_compress
override_dh_compress:
	dh_compress --all \
          --exclude=.ads \
          --exclude=.adb \
          --exclude=Makefile \
          --exclude=.c \
          --exclude=.h