111
|
1 # Makefile for libada.
|
145
|
2 # Copyright (C) 2003-2020 Free Software Foundation, Inc.
|
111
|
3 #
|
|
4 # This file is free software; you can redistribute it and/or modify
|
|
5 # it under the terms of the GNU General Public License as published by
|
|
6 # the Free Software Foundation; either version 3 of the License, or
|
|
7 # (at your option) any later version.
|
|
8 #
|
|
9 # This program is distributed in the hope that it will be useful,
|
|
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 # GNU General Public License for more details.
|
|
13 #
|
|
14 # You should have received a copy of the GNU General Public License
|
|
15 # along with this program; see the file COPYING3. If not see
|
|
16 # <http://www.gnu.org/licenses/>.
|
|
17
|
|
18 # Default target; must be first.
|
145
|
19 all: libada
|
111
|
20 $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
|
|
21
|
|
22 .PHONY: all
|
|
23
|
|
24 ## Multilib support variables.
|
|
25 MULTISRCTOP =
|
|
26 MULTIBUILDTOP =
|
|
27 MULTIDIRS =
|
|
28 MULTISUBDIR =
|
|
29 MULTIDO = true
|
|
30 MULTICLEAN = true
|
|
31
|
|
32 # Standard autoconf-set variables.
|
|
33 SHELL = @SHELL@
|
|
34 srcdir = @srcdir@
|
|
35 libdir = @libdir@
|
|
36 build = @build@
|
|
37 target = @target@
|
|
38 prefix = @prefix@
|
|
39
|
|
40 # Nonstandard autoconf-set variables.
|
145
|
41 toolexecdir = @toolexecdir@
|
|
42 toolexeclibdir = @toolexeclibdir@
|
111
|
43 enable_shared = @enable_shared@
|
|
44
|
|
45 LN_S=@LN_S@
|
|
46 AWK=@AWK@
|
|
47
|
|
48 ifeq (cp -p,$(LN_S))
|
|
49 LN_S_RECURSIVE = cp -pR
|
|
50 else
|
|
51 LN_S_RECURSIVE = $(LN_S)
|
|
52 endif
|
|
53
|
|
54 # Variables for the user (or the top level) to override.
|
|
55 objext=.o
|
|
56 THREAD_KIND=native
|
|
57 TRACE=no
|
|
58 LDFLAGS=
|
|
59
|
|
60 # The tedious process of getting CFLAGS right.
|
|
61 CFLAGS=-g
|
|
62 PICFLAG = @PICFLAG@
|
|
63 GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
|
|
64 GNATLIBCFLAGS= -g -O2
|
|
65 GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
|
|
66 -fexceptions -DIN_RTS @have_getipinfo@ @have_capability@
|
|
67
|
|
68 host_subdir = @host_subdir@
|
|
69 GCC_DIR=$(MULTIBUILDTOP)../../$(host_subdir)/gcc
|
|
70
|
|
71 target_noncanonical:=@target_noncanonical@
|
|
72 version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
|
|
73 libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)$(MULTISUBDIR)
|
|
74 ADA_RTS_DIR=$(GCC_DIR)/ada/rts$(subst /,_,$(MULTISUBDIR))
|
|
75
|
|
76 # exeext should not be used because it's the *host* exeext. We're building
|
|
77 # a *target* library, aren't we?!? Likewise for CC. Still, provide bogus
|
|
78 # definitions just in case something slips through the safety net provided
|
|
79 # by recursive make invocations in gcc/ada/Makefile.in
|
|
80 LIBADA_FLAGS_TO_PASS = \
|
|
81 "MAKEOVERRIDES=" \
|
|
82 "LDFLAGS=$(LDFLAGS)" \
|
|
83 "LN_S=$(LN_S)" \
|
|
84 "SHELL=$(SHELL)" \
|
|
85 "GNATLIBFLAGS=$(GNATLIBFLAGS) $(MULTIFLAGS)" \
|
|
86 "GNATLIBCFLAGS=$(GNATLIBCFLAGS) $(MULTIFLAGS)" \
|
|
87 "GNATLIBCFLAGS_FOR_C=$(GNATLIBCFLAGS_FOR_C) $(MULTIFLAGS)" \
|
|
88 "PICFLAG_FOR_TARGET=$(PICFLAG)" \
|
|
89 "THREAD_KIND=$(THREAD_KIND)" \
|
|
90 "TRACE=$(TRACE)" \
|
|
91 "MULTISUBDIR=$(MULTISUBDIR)" \
|
|
92 "libsubdir=$(libsubdir)" \
|
145
|
93 "toolexeclibdir=$(toolexeclibdir)" \
|
111
|
94 "objext=$(objext)" \
|
|
95 "prefix=$(prefix)" \
|
|
96 "exeext=.exeext.should.not.be.used " \
|
|
97 'CC=the.host.compiler.should.not.be.needed' \
|
|
98 "GCC_FOR_TARGET=$(CC)" \
|
|
99 "CFLAGS=$(CFLAGS)"
|
|
100
|
145
|
101 .PHONY: libada gnatlib gnatlib-shared gnatlib-sjlj gnatlib-zcx osconstool
|
111
|
102
|
145
|
103 # Rules to build and install libada.
|
|
104 libada: @default_gnatlib_target@
|
111
|
105
|
145
|
106 gnatlib gnatlib-shared gnatlib-sjlj gnatlib-zcx: osconstool $(GCC_DIR)/ada/Makefile
|
111
|
107 test -f stamp-libada || \
|
|
108 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \
|
|
109 && touch stamp-libada
|
|
110 -rm -rf adainclude
|
|
111 -rm -rf adalib
|
|
112 $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adainclude
|
|
113 $(LN_S_RECURSIVE) $(ADA_RTS_DIR) adalib
|
|
114
|
|
115 osconstool:
|
|
116 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) ./bldtools/oscons/xoscons
|
|
117
|
145
|
118 install-libada: $(GCC_DIR)/ada/Makefile
|
111
|
119 $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib
|
|
120
|
|
121 # Check uninstalled version.
|
|
122 check:
|
|
123
|
|
124 # Check installed version.
|
|
125 installcheck:
|
|
126
|
|
127 # Build info (none here).
|
|
128 info:
|
|
129
|
|
130 # Build DVI (none here).
|
|
131 dvi:
|
|
132
|
|
133 # Build PDF (none here).
|
|
134 pdf:
|
|
135
|
|
136 # Build html (none here).
|
|
137 html:
|
|
138
|
|
139 # Build TAGS (none here).
|
|
140 TAGS:
|
|
141
|
|
142 .PHONY: check installcheck info dvi pdf html
|
|
143
|
|
144 # Installation rules.
|
145
|
145 install: install-libada
|
111
|
146 $(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
|
|
147
|
|
148 install-strip: install
|
|
149
|
|
150 install-info:
|
|
151
|
|
152 install-pdf:
|
|
153
|
|
154 install-html:
|
|
155
|
|
156 .PHONY: install install-strip install-info install-pdf install-html
|
|
157
|
|
158 # Cleaning rules.
|
|
159 mostlyclean:
|
|
160 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
|
|
161
|
|
162 clean:
|
|
163 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
|
|
164
|
|
165 distclean:
|
|
166 $(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
|
|
167 $(RM) Makefile config.status config.log
|
|
168
|
|
169 maintainer-clean:
|
|
170
|
|
171 .PHONY: mostlyclean clean distclean maintainer-clean
|
|
172
|
|
173 # Rules for rebuilding this Makefile.
|
|
174 Makefile: $(srcdir)/Makefile.in config.status
|
|
175 CONFIG_FILES=$@ ; \
|
|
176 CONFIG_HEADERS= ; \
|
|
177 $(SHELL) ./config.status
|
|
178
|
|
179 config.status: $(srcdir)/configure
|
|
180 $(SHELL) ./config.status --recheck
|
|
181
|
|
182 AUTOCONF = autoconf
|
|
183 configure_deps = \
|
|
184 $(srcdir)/configure.ac \
|
|
185 $(srcdir)/../config/acx.m4 \
|
|
186 $(srcdir)/../config/multi.m4 \
|
|
187 $(srcdir)/../config/override.m4 \
|
|
188 $(srcdir)/../config/picflag.m4 \
|
145
|
189 $(srcdir)/../config/toolexeclibdir.m4 \
|
111
|
190 $(srcdir)/../config/unwind_ipinfo.m4
|
|
191
|
|
192 $(srcdir)/configure: @MAINT@ $(configure_deps)
|
|
193 cd $(srcdir) && $(AUTOCONF)
|
|
194
|
|
195 # Don't export variables to the environment, in order to not confuse
|
|
196 # configure.
|
|
197 .NOEXPORT:
|