File: debian_packaging.mk

package info (click to toggle)
dh-ada-library 3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 176 kB
  • sloc: ada: 1,613; makefile: 12; perl: 5
file content (79 lines) | stat: -rw-r--r-- 2,948 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
# Common settings for Ada Debian packaging.
#
#  Copyright (C) 2012 Nicolas Boulenguez <nicolas.boulenguez@free.fr>
#
#  This program 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/>.
#

# dpkg-dev (>= 1.16.1) provides /usr/share/dpkg/default.mk (or the
# more specific buildflags.mk) to set standard variables like
# DEB_HOST_MULTIARCH, CFLAGS, LDFLAGS...) according to the build
# environment (DEB_BUILD_OPTIONS...) and the policy (hardening
# flags...).
# You must include it before this file.
ifeq (,$(findstring /usr/share/dpkg/buildflags.mk,$(MAKEFILE_LIST)))
  $(error Please include /usr/share/dpkg/default.mk (or the more specific \
          buildflags.mk) before $(lastword $(MAKEFILE_LIST)))
endif

# Ada is not in dpkg-dev flag list. We add a sensible default here.

# Avoid GCC warnings about -Wformat flags being unused for Ada
# sources.
ADAFLAGS := $(filter-out -Wformat -Wformat-security -Werror=format-security,\
  $(CFLAGS))
ifdef DPKG_EXPORT_BUILDFLAGS
  export ADAFLAGS
endif

# Avoid dpkg-shlibdeps warning about depending on a library from which
# no symbol is used.
# http://wiki.debian.org/ToolChain/DSOLinking
LDFLAGS += -Wl,--as-needed
ifdef DPKG_EXPORT_BUILDFLAGS
  export LDFLAGS
endif

######################################################################
# C compiler version

# GCC binaries must be compatible with GNAT at the binary level, use
# the same version. This setting is mandatory for every upstream C
# compilation ("export CC" is enough for dh_auto_configure with a
# normal ./configure).

CC := gnatgcc

######################################################################
# Options for gprbuild/gnatmake.

# Let Make delegate parallelism to gnatmake/gprbuild.
.NOTPARALLEL:

# Use all processors unless noopt is set in DEB_BUILD_OPTIONS.
# http://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
BUILDER_JOBS := $(filter parallel=%,$(DEB_BUILD_OPTIONS))
ifneq (,$(BUILDER_JOBS))
  BUILDER_JOBS := $(subst parallel=,,$(BUILDER_JOBS))
else
  BUILDER_JOBS := $(shell getconf _NPROCESSORS_ONLN)
endif

# Avoid lintian warning about setting an explicit library runpath.
# http://wiki.debian.org/RpathIssue
BUILDER_OPTIONS := -R -j$(BUILDER_JOBS)

# You may be interested in
# -s  recompile if compilation switches have changed
# -we handle warnings as errors
# -v  verbose
# -vP2 verbose when parsing projects.