File: rules

package info (click to toggle)
gprbuild 2015-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,228 kB
  • ctags: 67
  • sloc: ada: 27,214; xml: 4,127; makefile: 337; sh: 227; cpp: 89; fortran: 62; ansic: 37
file content (86 lines) | stat: -rwxr-xr-x 3,312 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
#!/usr/bin/make -f

# Copyright (c) 2009-2012 Stephen Leake <stephen_leake@stephe-leake.org>
# Copyright (c) 2013-2016 Nicolas Boulenguez <nicolas@debian.org>

# 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.

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

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

# gprbuild.gpr selects inlining.
ADAFLAGS += -gnatn
# It also selects -E -static binder options, but:
# #666106 affects only kfreebsd-i386, where storing tracebacks in
# exception occurrences causes a segmentation fault.  This prevents
# handling of any exceptions.  gprconfig relies on handling exceptions
# when parsing compilers.xml.
# Author: Ludovic Brenta <lbrenta@debian.org>

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

# If you intend to use autoconf...
# Set target from DEB_HOST_GNU_TYPE instead of config.sub, which adds
# a vendor and does not match "gcc -dumpmachine" at run time.
# The problem is hidden on usual architectures by hand-crafted
# renamings in share/gprconfig/targetset.xml.
# See share/gprconfig/compilers.xml, debian/patches/gprconfig.diff.

# Rewriting recipes is easyer than using upstream build system, and it
# avoids that gprbuilds Build-Depends: gprbuild, now that gnatmake is
# dropping support for projects.
ADAINCLUDE := /usr/share/ada/adainclude
ADALIB     := /usr/lib/$(DEB_HOST_MULTIARCH)/ada/adalib

EXECUTABLES := gprbind gprbuild gprclean gprconfig gprinstall gprlib gprslave

.PHONY: override_dh_auto_build
override_dh_auto_build: $(EXECUTABLES)

# Gnatmake knows better than Make if something is up to date.
.PHONY: $(EXECUTABLES)

# Some main units are poorly named.
gprbind gprlib gprslave: MAIN_EXT :=
gprbuild gprclean gprconfig gprinstall: MAIN_EXT := -main

# Each executable may not require each library, but there should be no
# consequence with --as-needed linker flag.
$(EXECUTABLES):
	gnatmake $@$(MAIN_EXT).adb -aIsrc -D obj -o obj/$@ \
          $(BUILDER_OPTIONS) \
          -cargs $(ADAFLAGS) \
          -largs $(LDFLAGS) \
          $(foreach l,schema dom sax input_sources unicode, \
            -margs -aI$(ADAINCLUDE)/xmlada_$(l) -aO$(ADALIB)/xmlada_$(l) \
            -largs -lxmlada_$(l)) \
          $(foreach l,prj vsn, \
            -margs -aI$(ADAINCLUDE)/gnat$(l) -aO/usr/lib/ada/adalib/gnat$(l) \
            -largs -lgnat$(l))

# The only source requiring actual configuration.
SDEFAULT := src/gprconfig-sdefault.ads
$(EXECUTABLES): $(SDEFAULT)
$(SDEFAULT): %: %.in
	sed -e 's/@host@/$(DEB_HOST_GNU_TYPE)/' $< > $@

.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	rm -f obj/* $(SDEFAULT)