Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / ada / gcc-interface / Makefile.in
1 # Makefile for GNU Ada Compiler (GNAT).
2 #   Copyright (C) 1994-2012 Free Software Foundation, Inc.
3
4 #This file is part of GCC.
5
6 #GCC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 3, or (at your option)
9 #any later version.
10
11 #GCC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with GCC; see the file COPYING3.  If not see
18 #<http://www.gnu.org/licenses/>.
19
20 # The makefile built from this file lives in the language subdirectory.
21 # Its purpose is to provide support for:
22 #
23 # 1) recursion where necessary, and only then (building .o's), and
24 # 2) building and debugging cc1 from the language subdirectory, and
25 # 3) nothing else.
26 #
27 # The parent makefile handles all other chores, with help from the
28 # language makefile fragment, of course.
29 #
30 # The targets for external use are:
31 # all, TAGS, ???mostlyclean, ???clean.
32
33 # This makefile will only work with Gnu make.
34 # The rules are written assuming a minimum subset of tools are available:
35 #
36 # Required:
37 #      MAKE:    Only Gnu make will work.
38 #      MV:      Must accept (at least) one, maybe wildcard, source argument,
39 #               a file or directory destination, and support creation/
40 #               modification date preservation.  Gnu mv -f works.
41 #      RM:      Must accept an arbitrary number of space separated file
42 #               arguments, or one wildcard argument. Gnu rm works.
43 #      RMDIR:   Must delete a directory and all its contents. Gnu rm -rf works.
44 #      ECHO:    Must support command line redirection. Any Unix-like
45 #               shell will typically provide this, otherwise a custom version
46 #               is trivial to write.
47 #      AR:      Gnu ar works.
48 #      MKDIR:   Gnu mkdir works.
49 #      CHMOD:   Gnu chmod works.
50 #      true:    Does nothing and returns a normal successful return code.
51 #      pwd:     Prints the current directory on stdout.
52 #      cd:      Change directory.
53 #
54 # Optional:
55 #      BISON:   Gnu bison works.
56 #      FLEX:    Gnu flex works.
57 #      Other miscellaneous tools for obscure targets.
58
59 # Suppress smart makes who think they know how to automake Yacc files
60 .y.c:
61
62 # Variables that exist for you to override.
63 # See below for how to change them for certain systems.
64
65 # Various ways of specifying flags for compilations:
66 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
67 # BOOT_CFLAGS is the value of CFLAGS to pass
68 # to the stage2 and stage3 compilations
69 CFLAGS = -g
70 BOOT_CFLAGS = -O $(CFLAGS)
71 # These exists to be overridden by the t-* files, respectively.
72 T_CFLAGS =
73
74 CC = cc
75 BISON = bison
76 BISONFLAGS =
77 ECHO = echo
78 LEX = flex
79 LEXFLAGS =
80 CHMOD = chmod
81 LN = ln
82 LN_S = ln -s
83 CP = cp -p
84 MV = mv -f
85 RM = rm -f
86 RMDIR = rm -rf
87 MKDIR = mkdir -p
88 AR = ar
89 AR_FLAGS = rc
90 LS = ls
91 RANLIB = @RANLIB@
92 RANLIB_FLAGS = @ranlib_flags@
93 AWK = @AWK@
94
95 COMPILER = $(CC)
96 COMPILER_FLAGS = $(CFLAGS)
97
98 SHELL = @SHELL@
99 PWD_COMMAND = $${PWDCMD-pwd}
100 # How to copy preserving the date
101 INSTALL_DATA_DATE = cp -p
102 MAKEINFO = makeinfo
103 TEXI2DVI = texi2dvi
104 TEXI2PDF = texi2pdf
105 GNATBIND_FLAGS = -static -x
106 ADA_CFLAGS =
107 ADAFLAGS = -W -Wall -gnatpg -gnata
108 FORCE_DEBUG_ADAFLAGS = -g
109 NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls
110 NO_REORDER_ADAFLAGS = -fno-toplevel-reorder
111 GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc
112 GNATLIBCFLAGS = -g -O2
113 PICFLAG_FOR_TARGET = @PICFLAG_FOR_TARGET@
114
115 # Pretend that _Unwind_GetIPInfo is available for the target by default.  This
116 # should be autodetected during the configuration of libada and passed down to
117 # here, but we need something for --disable-libada and hope for the best.
118 GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
119         -fexceptions -DIN_RTS -DHAVE_GETIPINFO
120 ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
121 THREAD_KIND = native
122 THREADSLIB =
123 GMEM_LIB =
124 MISCLIB =
125 OUTPUT_OPTION = @OUTPUT_OPTION@
126
127 objext = .o
128 exeext =
129 arext  = .a
130 soext  = .so
131 shext  =
132 hyphen = -
133
134 # Define this as & to perform parallel make on a Sequent.
135 # Note that this has some bugs, and it seems currently necessary
136 # to compile all the gen* files first by hand to avoid erroneous results.
137 P =
138
139 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
140 # It specifies -B./.
141 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
142 GCC_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS)
143
144 # Tools to use when building a cross-compiler.
145 # These are used because `configure' appends `cross-make'
146 # to the makefile when making a cross-compiler.
147
148 # We don't use cross-make.  Instead we use the tools from the build tree,
149 # if they are available.
150 # program_transform_name and objdir are set by configure.in.
151 program_transform_name =
152 objdir = .
153
154 target_alias=@target_alias@
155 target=@target@
156 xmake_file = @xmake_file@
157 tmake_file = @tmake_file@
158 host_canonical=@host@
159 target_cpu_default=@target_cpu_default@
160 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
161 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
162
163 # Directory where sources are, from where we are.
164 VPATH = $(srcdir)/ada
165
166 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
167 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
168 fcurdir := $(shell ${PWD_COMMAND})
169 fcurpfx := $(shell ${PWD_COMMAND})/
170
171 # Top build directory, relative to here.
172 top_builddir = ../..
173
174 # Internationalization library.
175 LIBINTL = @LIBINTL@
176 LIBINTL_DEP = @LIBINTL_DEP@
177
178 # Character encoding conversion library.
179 LIBICONV = @LIBICONV@
180 LIBICONV_DEP = @LIBICONV_DEP@
181
182 # Any system libraries needed just for GNAT.
183 SYSLIBS = @GNAT_LIBEXC@
184
185 # List extra gnattools
186 EXTRA_GNATTOOLS =
187
188 # List of target dependent sources, overridden below as necessary
189 TARGET_ADA_SRCS =
190
191 # Type of tools build we are doing; default is not compiling tools.
192 TOOLSCASE =
193
194 # Multilib handling
195 MULTISUBDIR =
196 RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
197
198 # Link flags used to build gnat tools.  By default we prefer to statically
199 # link with libgcc to avoid a dependency on shared libgcc (which is tricky
200 # to deal with as it may conflict with the libgcc provided by the system).
201 GCC_LINK_FLAGS=-static-libgcc
202
203 # End of variables for you to override.
204
205 all: all.indirect
206
207 # This tells GNU Make version 3 not to put all variables in the environment.
208 .NOEXPORT:
209
210 # target overrides
211 ifneq ($(tmake_file),)
212 include $(tmake_file)
213 endif
214
215 # host overrides
216 ifneq ($(xmake_file),)
217 include $(xmake_file)
218 endif
219 \f
220 # Now figure out from those variables how to compile and link.
221
222 all.indirect: Makefile ../gnat1$(exeext)
223
224 # IN_GCC is meant to distinguish between code compiled into GCC itself, i.e.
225 # for the host, and the rest.  But we also use it for the tools (link.c) and
226 # even break the host/target wall by using it for the library (targext.c).
227 # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
228 # compiler which does not use the native libraries and headers.
229 INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
230
231 # This is the variable actually used when we compile.
232 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS)
233
234 # Likewise.
235 ALL_CPPFLAGS = $(CPPFLAGS)
236
237 # Used with $(COMPILER).
238 ALL_COMPILERFLAGS = $(ALL_CFLAGS)
239
240 # This is where we get libiberty.a from.
241 LIBIBERTY = ../../libiberty/libiberty.a
242
243 # We need to link against libbacktrace because diagnostic.c in
244 # libcommon.a uses it.
245 LIBBACKTRACE = ../../libbacktrace/.libs/libbacktrace.a
246
247 # How to link with both our special library facilities
248 # and the system's installed libraries.
249 LIBS = $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) $(LIBIBERTY) $(SYSLIBS)
250 LIBDEPS = $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBBACKTRACE) $(LIBIBERTY)
251 # Default is no TGT_LIB; one might be passed down or something
252 TGT_LIB =
253 TOOLS_LIBS = targext.o link.o ../../ggc-none.o ../../libcommon-target.a \
254   ../../libcommon.a ../../../libcpp/libcpp.a $(LIBGNAT) $(LIBINTL) $(LIBICONV) \
255   ../../../libbacktrace/.libs/libbacktrace.a ../../../libiberty/libiberty.a \
256   $(SYSLIBS) $(TGT_LIB)
257
258 # Convert the target variable into a space separated list of architecture,
259 # manufacturer, and operating system and assign each of those to its own
260 # variable.
261 host:=$(subst -, ,$(host_canonical))
262 targ:=$(subst -, ,$(target))
263 arch:=$(word 1,$(targ))
264 ifeq ($(words $(targ)),2)
265   manu:=
266   osys:=$(word 2,$(targ))
267 else
268   manu:=$(word 2,$(targ))
269   osys:=$(word 3,$(targ))
270 endif
271
272 # Specify the directories to be searched for header files.
273 # Both . and srcdir are used, in that order,
274 # so that tm.h and config.h will be found in the compilation
275 # subdirectory rather than in the source directory.
276 INCLUDES = -I- -I. -I.. -I$(srcdir)/ada -I$(srcdir) -I$(srcdir)/../include $(GMPINC)
277
278 ADA_INCLUDES = -I- -I. -I$(srcdir)/ada
279
280 # Likewise, but valid for subdirectories of the current dir.
281 # FIXME: for VxWorks, we cannot add $(fsrcdir) because the regs.h file in
282 # that directory conflicts with a system header file.
283 ifneq ($(findstring vxworks,$(osys)),)
284   INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
285                         -iquote $(fsrcdir)/ada \
286                         -I$(fsrcdir)/../include $(GMPINC)
287 else
288   INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
289                         -iquote $(fsrcdir)/ada -iquote $(fsrcdir) \
290                         -I$(fsrcdir)/../include $(GMPINC)
291 endif
292
293 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
294
295 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
296 .SUFFIXES: .in .def
297
298 # Say how to compile Ada programs.
299 .SUFFIXES: .ada .adb .ads .asm
300
301 # Always use -I$(srcdir)/config when compiling.
302 .asm.o:
303         $(CC) -c -x assembler $< $(OUTPUT_OPTION)
304
305 .c.o:
306         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
307           $(INCLUDES) $< $(OUTPUT_OPTION)
308
309 .adb.o:
310         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
311
312 .ads.o:
313         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
314
315 # how to regenerate this file
316 Makefile: ../config.status $(srcdir)/ada/gcc-interface/Makefile.in $(srcdir)/ada/Makefile.in $(srcdir)/version.c
317         cd ..; \
318         LANGUAGES="$(CONFIG_LANGUAGES)" \
319         CONFIG_HEADERS= \
320         CONFIG_FILES="ada/gcc-interface/Makefile ada/Makefile" $(SHELL) config.status
321
322 # This tells GNU make version 3 not to export all the variables
323 # defined in this file into the environment.
324 .NOEXPORT:
325 \f
326 # Lists of files for various purposes.
327
328 GNATLINK_OBJS = gnatlink.o \
329  a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o \
330  gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o \
331  osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
332  sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
333  types.o validsw.o widechar.o
334
335 GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \
336  atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o errout.o \
337  erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
338  gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
339  make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o \
340  mlib-tgt-specific.o mlib-utl.o namet.o nlists.o opt.o osint.o osint-m.o \
341  output.o prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o \
342  prj-conf.o prj-pp.o prj-err.o prj-ext.o prj-nmsc.o prj-pars.o prj-part.o \
343  prj-proc.o prj-strt.o prj-tree.o prj-util.o restrict.o rident.o s-exctab.o \
344  s-secsta.o s-stalib.o s-stoele.o scans.o scng.o sdefault.o sfn_scan.o \
345  s-purexc.o s-htable.o scil_ll.o sem_aux.o sinfo.o sinput.o sinput-c.o \
346  sinput-p.o snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o \
347  switch.o switch-m.o table.o targparm.o tempdir.o tree_io.o types.o uintp.o \
348  uname.o urealp.o usage.o widechar.o \
349  $(EXTRA_GNATMAKE_OBJS)
350
351 # Make arch match the current multilib so that the RTS selection code
352 # picks up the right files. For a given target this must be coherent
353 # with MULTILIB_DIRNAMES defined in gcc/config/target/t-*.
354
355 ifeq ($(strip $(filter-out %x86_64, $(arch))),)
356   ifeq ($(strip $(MULTISUBDIR)),/32)
357     arch:=i686
358   else
359     ifeq ($(strip $(MULTISUBDIR)),/x32)
360       arch:=x32
361     endif
362   endif
363 endif
364
365 # ???: handle more multilib targets
366
367 # LIBGNAT_TARGET_PAIRS is a list of pairs of filenames.
368 # The members of each pair must be separated by a '<' and no whitespace.
369 # Each pair must be separated by some amount of whitespace from the following
370 # pair.
371
372 # Non-tasking case:
373
374 LIBGNAT_TARGET_PAIRS = \
375 a-intnam.ads<a-intnam-dummy.ads \
376 s-inmaop.adb<s-inmaop-dummy.adb \
377 s-intman.adb<s-intman-dummy.adb \
378 s-osinte.ads<s-osinte-dummy.ads \
379 s-osprim.adb<s-osprim-posix.adb \
380 s-taprop.adb<s-taprop-dummy.adb \
381 s-taspri.ads<s-taspri-dummy.ads
382
383 # When using the GCC exception handling mechanism, we need to use an
384 # alternate body for a-exexpr.adb (a-exexpr-gcc.adb)
385
386 EH_MECHANISM=
387
388 # Default shared object option. Note that we rely on the fact that the "soname"
389 # option will always be present and last in this flag, so that we can have
390 # $(SO_OPTS)libgnat-x.xx
391
392 SO_OPTS = -Wl,-soname,
393
394 # Default gnatlib-shared target.
395 # By default, equivalent to gnatlib.
396 # Set to gnatlib-shared-default, gnatlib-shared-dual, or a platform specific
397 # target when supported.
398 GNATLIB_SHARED = gnatlib
399
400 # default value for gnatmake's target dependent file
401 MLIB_TGT = mlib-tgt
402
403 # By default, build socket support units. On platforms that do not support
404 # sockets, reset this variable to empty and add DUMMY_SOCKETS_TARGET_PAIRS
405 # to LIBGNAT_TARGET_PAIRS.
406
407 GNATRTL_SOCKETS_OBJS = g-soccon$(objext) g-socket$(objext) g-socthi$(objext) \
408   g-soliop$(objext) g-sothco$(objext)
409
410 DUMMY_SOCKETS_TARGET_PAIRS = \
411   g-socket.adb<g-socket-dummy.adb \
412   g-socket.ads<g-socket-dummy.ads \
413   g-socthi.adb<g-socthi-dummy.adb \
414   g-socthi.ads<g-socthi-dummy.ads \
415   g-sothco.adb<g-sothco-dummy.adb \
416   g-sothco.ads<g-sothco-dummy.ads
417
418 # On platforms where atomic increment/decrement operations are supported,
419 # special version of Ada.Strings.Unbounded package can be used.
420
421 ATOMICS_TARGET_PAIRS = \
422   a-stunau.adb<a-stunau-shared.adb \
423   a-suteio.adb<a-suteio-shared.adb \
424   a-strunb.ads<a-strunb-shared.ads \
425   a-strunb.adb<a-strunb-shared.adb \
426   a-stwiun.adb<a-stwiun-shared.adb \
427   a-stwiun.ads<a-stwiun-shared.ads \
428   a-swunau.adb<a-swunau-shared.adb \
429   a-swuwti.adb<a-swuwti-shared.adb \
430   a-stzunb.adb<a-stzunb-shared.adb \
431   a-stzunb.ads<a-stzunb-shared.ads \
432   a-szunau.adb<a-szunau-shared.adb \
433   a-szuzti.adb<a-szuzti-shared.adb
434
435 ATOMICS_BUILTINS_TARGET_PAIRS = \
436   s-atocou.adb<s-atocou-builtin.adb
437
438 # Special version of units for x86 and x86-64 platforms.
439
440 X86_TARGET_PAIRS = \
441   a-numaux.ads<a-numaux-x86.ads \
442   a-numaux.adb<a-numaux-x86.adb \
443   s-atocou.adb<s-atocou-x86.adb
444
445 X86_64_TARGET_PAIRS = \
446   a-numaux.ads<a-numaux-x86.ads \
447   a-numaux.adb<a-numaux-x86.adb \
448   s-atocou.adb<s-atocou-builtin.adb
449
450 LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
451
452 # Additionnal object files from C source to be added to libgnat.
453 EXTRA_LIBGNAT_OBJS=
454 # Additionnal C source file to be added to libgnat without corresponding object
455 # file (included files).
456 EXTRA_LIBGNAT_SRCS=
457
458 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
459 # $(strip STRING) removes leading and trailing spaces from STRING.
460 # If what's left is null then it's a match.
461
462 # m68k VxWorks
463 ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
464   LIBGNAT_TARGET_PAIRS = \
465   a-intnam.ads<a-intnam-vxworks.ads \
466   a-numaux.ads<a-numaux-vxworks.ads \
467   s-inmaop.adb<s-inmaop-vxworks.adb \
468   s-interr.adb<s-interr-hwint.adb \
469   s-intman.ads<s-intman-vxworks.ads \
470   s-intman.adb<s-intman-vxworks.adb \
471   s-osinte.adb<s-osinte-vxworks.adb \
472   s-osinte.ads<s-osinte-vxworks.ads \
473   s-osprim.adb<s-osprim-vxworks.adb \
474   s-parame.ads<s-parame-vxworks.ads \
475   s-parame.adb<s-parame-vxworks.adb \
476   s-stchop.ads<s-stchop-limit.ads \
477   s-stchop.adb<s-stchop-vxworks.adb \
478   s-taprop.adb<s-taprop-vxworks.adb \
479   s-tasinf.ads<s-tasinf-vxworks.ads \
480   s-taspri.ads<s-taspri-vxworks.ads \
481   s-tpopsp.adb<s-tpopsp-vxworks.adb \
482   s-vxwork.ads<s-vxwork-m68k.ads \
483   g-socthi.ads<g-socthi-vxworks.ads \
484   g-socthi.adb<g-socthi-vxworks.adb \
485   g-stsifd.adb<g-stsifd-sockets.adb \
486   system.ads<system-vxworks-m68k.ads
487
488   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
489
490   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
491   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
492
493   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
494
495   ifeq ($(strip $(filter-out yes,$(TRACE))),)
496     LIBGNAT_TARGET_PAIRS += \
497     s-traces.adb<s-traces-default.adb \
498     s-tratas.adb<s-tratas-default.adb \
499     s-trafor.adb<s-trafor-default.adb \
500     s-trafor.ads<s-trafor-default.ads \
501     s-tfsetr.adb<s-tfsetr-vxworks.adb
502   endif
503 endif
504
505 # PowerPC and e500v2 VxWorks
506 ifeq ($(strip $(filter-out e500% powerpc% wrs vxworks,$(targ))),)
507   LIBGNAT_TARGET_PAIRS = \
508   a-intnam.ads<a-intnam-vxworks.ads \
509   a-numaux.ads<a-numaux-vxworks.ads \
510   s-inmaop.adb<s-inmaop-vxworks.adb \
511   s-intman.ads<s-intman-vxworks.ads \
512   s-intman.adb<s-intman-vxworks.adb \
513   s-osinte.ads<s-osinte-vxworks.ads \
514   s-osinte.adb<s-osinte-vxworks.adb \
515   s-osprim.adb<s-osprim-vxworks.adb \
516   s-parame.ads<s-parame-vxworks.ads \
517   s-parame.adb<s-parame-vxworks.adb \
518   s-taprop.adb<s-taprop-vxworks.adb \
519   s-tasinf.ads<s-tasinf-vxworks.ads \
520   s-taspri.ads<s-taspri-vxworks.ads \
521   s-vxwork.ads<s-vxwork-ppc.ads \
522   g-socthi.ads<g-socthi-vxworks.ads \
523   g-socthi.adb<g-socthi-vxworks.adb \
524   g-stsifd.adb<g-stsifd-sockets.adb \
525   $(ATOMICS_TARGET_PAIRS) \
526   $(ATOMICS_BUILTINS_TARGET_PAIRS)
527
528   # VxWorks 5 and 6 both use the same target triplet making them
529   # indistinguishable in the context of this make file. Package
530   # System.Stack_Checking.Operations is not needed on VxWorks 6 as it leads to
531   # an undefined symbol when building a dynamic shared library. To alleviate
532   # this problem and distinguish this case, we use the THREAD_KIND and include
533   # the package only in kernel mode.
534
535   ifeq ($(strip $(filter-out default,$(THREAD_KIND))),)
536     LIBGNAT_TARGET_PAIRS += \
537       s-stchop.ads<s-stchop-limit.ads \
538       s-stchop.adb<s-stchop-vxworks.adb
539   endif
540
541   TOOLS_TARGET_PAIRS=\
542   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
543   indepsw.adb<indepsw-gnu.adb
544
545   ifeq ($(strip $(filter-out yes,$(TRACE))),)
546     LIBGNAT_TARGET_PAIRS += \
547     s-traces.adb<s-traces-default.adb \
548     s-trafor.adb<s-trafor-default.adb \
549     s-trafor.ads<s-trafor-default.ads \
550     s-tratas.adb<s-tratas-default.adb \
551     s-tfsetr.adb<s-tfsetr-vxworks.adb
552   endif
553
554   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
555     LIBGNAT_TARGET_PAIRS += \
556     s-vxwext.ads<s-vxwext-rtp.ads \
557     s-vxwext.adb<s-vxwext-rtp.adb \
558     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
559     system.ads<system-vxworks-ppc-rtp.ads
560
561     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
562   else
563     ifeq ($(strip $(filter-out rtp-smp,$(THREAD_KIND))),)
564       LIBGNAT_TARGET_PAIRS += \
565       s-mudido.adb<s-mudido-affinity.adb \
566       s-vxwext.ads<s-vxwext-rtp.ads \
567       s-vxwext.adb<s-vxwext-rtp-smp.adb \
568       s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
569       system.ads<system-vxworks-ppc-rtp.ads
570
571       EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
572       EXTRA_LIBGNAT_OBJS+=affinity.o
573     else
574       ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),)
575         LIBGNAT_TARGET_PAIRS += \
576         s-interr.adb<s-interr-hwint.adb \
577         s-mudido.adb<s-mudido-affinity.adb \
578         s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
579         s-vxwext.ads<s-vxwext-kernel.ads \
580         s-vxwext.adb<s-vxwext-kernel-smp.adb \
581         system.ads<system-vxworks-ppc-kernel.ads
582
583         EH_MECHANISM=-gcc
584         EXTRA_LIBGNAT_OBJS+=affinity.o
585       else
586         LIBGNAT_TARGET_PAIRS += \
587         s-interr.adb<s-interr-hwint.adb \
588         s-tpopsp.adb<s-tpopsp-vxworks.adb
589
590         ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
591           EH_MECHANISM=-gcc
592           LIBGNAT_TARGET_PAIRS += \
593           s-vxwext.ads<s-vxwext-kernel.ads \
594           s-vxwext.adb<s-vxwext-kernel.adb \
595           system.ads<system-vxworks-ppc-kernel.ads
596         else
597           LIBGNAT_TARGET_PAIRS += \
598           system.ads<system-vxworks-ppc.ads
599         endif
600       endif
601       EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
602       EXTRA_LIBGNAT_OBJS+=sigtramp-ppcvxw.o
603     endif
604   endif
605
606   EXTRA_GNATRTL_TASKING_OBJS += s-vxwork.o s-vxwext.o
607
608   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
609 endif
610
611 # PowerPC and e500v2 VxWorks 653
612 ifeq ($(strip $(filter-out powerpc% e500v2 wrs vxworksae,$(targ))),)
613   # target pairs for vthreads runtime
614   LIBGNAT_TARGET_PAIRS = \
615   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
616   a-intnam.ads<a-intnam-vxworks.ads \
617   a-numaux.ads<a-numaux-vxworks.ads \
618   g-io.adb<g-io-vxworks-ppc-cert.adb \
619   s-inmaop.adb<s-inmaop-vxworks.adb \
620   s-interr.adb<s-interr-hwint.adb \
621   s-intman.ads<s-intman-vxworks.ads \
622   s-intman.adb<s-intman-vxworks.adb \
623   s-osinte.adb<s-osinte-vxworks.adb \
624   s-osinte.ads<s-osinte-vxworks.ads \
625   s-osprim.adb<s-osprim-vxworks.adb \
626   s-parame.ads<s-parame-ae653.ads \
627   s-parame.adb<s-parame-vxworks.adb \
628   s-taprop.adb<s-taprop-vxworks.adb \
629   s-tasinf.ads<s-tasinf-vxworks.ads \
630   s-taspri.ads<s-taspri-vxworks.ads \
631   s-tpopsp.adb<s-tpopsp-vxworks.adb \
632   s-vxwext.adb<s-vxwext-noints.adb \
633   s-vxwext.ads<s-vxwext-vthreads.ads \
634   s-vxwork.ads<s-vxwork-ppc.ads \
635   system.ads<system-vxworks-ppc-vthread.ads \
636   $(ATOMICS_TARGET_PAIRS) \
637   $(ATOMICS_BUILTINS_TARGET_PAIRS)
638
639   TOOLS_TARGET_PAIRS=\
640   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
641   indepsw.adb<indepsw-gnu.adb
642
643   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
644   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
645
646   EXTRA_LIBGNAT_OBJS+=sigtramp-ppcvxw.o
647
648   # Extra pairs for the vthreads runtime
649   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
650     LIBGNAT_TARGET_PAIRS += \
651     s-thread.adb<s-thread-ae653.adb \
652     $(DUMMY_SOCKETS_TARGET_PAIRS)
653
654     GNATRTL_SOCKETS_OBJS =
655     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
656   else
657     LIBGNAT_TARGET_PAIRS += \
658     g-socthi.ads<g-socthi-vxworks.ads \
659     g-socthi.adb<g-socthi-vxworks.adb \
660     g-stsifd.adb<g-stsifd-sockets.adb
661   endif
662
663   ifeq ($(strip $(filter-out yes,$(TRACE))),)
664     LIBGNAT_TARGET_PAIRS += \
665     s-traces.adb<s-traces-default.adb \
666     s-trafor.adb<s-trafor-default.adb \
667     s-trafor.ads<s-trafor-default.ads \
668     s-tratas.adb<s-tratas-default.adb \
669     s-tfsetr.adb<s-tfsetr-vxworks.adb
670   endif
671 endif
672
673 # PowerPC and e500v2 VxWorks MILS
674 ifeq ($(strip $(filter-out e500% powerpc% wrs vxworksmils,$(targ))),)
675   # target pairs for vthreads runtime
676   LIBGNAT_TARGET_PAIRS = \
677   a-elchha.adb<a-elchha-vx6-raven-cert.adb \
678   a-intnam.ads<a-intnam-vxworks.ads \
679   a-numaux.ads<a-numaux-vxworks.ads \
680   g-io.adb<g-io-vxworks-ppc-cert.adb \
681   s-inmaop.adb<s-inmaop-vxworks.adb \
682   s-interr.adb<s-interr-hwint.adb \
683   s-intman.ads<s-intman-vxworks.ads \
684   s-intman.adb<s-intman-vxworks.adb \
685   s-osinte.adb<s-osinte-vxworks.adb \
686   s-osinte.ads<s-osinte-vxworks.ads \
687   s-osprim.adb<s-osprim-vxworks.adb \
688   s-parame.ads<s-parame-ae653.ads \
689   s-parame.adb<s-parame-vxworks.adb \
690   s-stchop.adb<s-stchop-vxworks.adb \
691   s-stchop.ads<s-stchop-limit.ads \
692   s-taprop.adb<s-taprop-vxworks.adb \
693   s-tasinf.ads<s-tasinf-vxworks.ads \
694   s-taspri.ads<s-taspri-vxworks.ads \
695   s-thread.adb<s-thread-ae653.adb \
696   s-tpopsp.adb<s-tpopsp-vxworks.adb \
697   s-vxwork.ads<s-vxwork-ppc.ads \
698   system.ads<system-vxworks-ppc-mils.ads \
699   $(ATOMICS_TARGET_PAIRS) \
700   $(ATOMICS_BUILTINS_TARGET_PAIRS) \
701   $(DUMMY_SOCKETS_TARGET_PAIRS)
702
703   TOOLS_TARGET_PAIRS=\
704   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
705   indepsw.adb<indepsw-gnu.adb
706
707   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-thread.o s-vxwexc.o
708   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
709
710   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o sigtramp-ppcvxw.o
711   GNATRTL_SOCKETS_OBJS =
712
713   ifeq ($(strip $(filter-out yes,$(TRACE))),)
714     LIBGNAT_TARGET_PAIRS += \
715     s-traces.adb<s-traces-default.adb \
716     s-trafor.adb<s-trafor-default.adb \
717     s-trafor.ads<s-trafor-default.ads \
718     s-tratas.adb<s-tratas-default.adb \
719     s-tfsetr.adb<s-tfsetr-vxworks.adb
720   endif
721 endif
722
723 # VxWorksae / VxWorks 653 for x86 (vxsim) - ?? VxWorks mils not implemented
724 ifeq ($(strip $(filter-out %86 wrs vxworksae vxworksmils,$(targ))),)
725   # target pairs for kernel + vthreads runtime
726   LIBGNAT_TARGET_PAIRS = \
727   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
728   a-intnam.ads<a-intnam-vxworks.ads \
729   a-sytaco.ads<1asytaco.ads \
730   a-sytaco.adb<1asytaco.adb \
731   g-io.adb<g-io-vxworks-ppc-cert.adb \
732   s-inmaop.adb<s-inmaop-vxworks.adb \
733   s-interr.adb<s-interr-hwint.adb \
734   s-intman.ads<s-intman-vxworks.ads \
735   s-intman.adb<s-intman-vxworks.adb \
736   s-osinte.adb<s-osinte-vxworks.adb \
737   s-osinte.ads<s-osinte-vxworks.ads \
738   s-osprim.adb<s-osprim-vxworks.adb \
739   s-parame.ads<s-parame-ae653.ads \
740   s-taprop.adb<s-taprop-vxworks.adb \
741   s-tasinf.ads<s-tasinf-vxworks.ads \
742   s-taspri.ads<s-taspri-vxworks.ads \
743   s-tpopsp.adb<s-tpopsp-vxworks.adb \
744   s-vxwext.adb<s-vxwext-noints.adb \
745   s-vxwext.ads<s-vxwext-vthreads.ads \
746   s-vxwork.ads<s-vxwork-x86.ads \
747   $(ATOMICS_TARGET_PAIRS) \
748   $(X86_TARGET_PAIRS) \
749   system.ads<system-vxworks-x86.ads
750
751   TOOLS_TARGET_PAIRS=\
752   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
753   indepsw.adb<indepsw-gnu.adb
754
755   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
756   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
757
758   # Extra pairs for the vthreads runtime
759   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
760     LIBGNAT_TARGET_PAIRS += \
761     s-thread.adb<s-thread-ae653.adb \
762     $(DUMMY_SOCKETS_TARGET_PAIRS)
763
764     GNATRTL_SOCKETS_OBJS =
765     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
766   else
767     LIBGNAT_TARGET_PAIRS += \
768     g-socthi.ads<g-socthi-vxworks.ads \
769     g-socthi.adb<g-socthi-vxworks.adb \
770     g-stsifd.adb<g-stsifd-sockets.adb
771   endif
772
773   ifeq ($(strip $(filter-out yes,$(TRACE))),)
774     LIBGNAT_TARGET_PAIRS += \
775     s-traces.adb<s-traces-default.adb \
776     s-trafor.adb<s-trafor-default.adb \
777     s-trafor.ads<s-trafor-default.ads \
778     s-tratas.adb<s-tratas-default.adb \
779     s-tfsetr.adb<s-tfsetr-vxworks.adb
780   endif
781 endif
782
783 # Sparc VxWorks
784 ifeq ($(strip $(filter-out sparc% leon% wrs vx%,$(targ))),)
785   LIBGNAT_TARGET_PAIRS = \
786   a-intnam.ads<a-intnam-vxworks.ads \
787   a-numaux.ads<a-numaux-vxworks.ads \
788   s-inmaop.adb<s-inmaop-vxworks.adb \
789   s-interr.adb<s-interr-hwint.adb \
790   s-intman.ads<s-intman-vxworks.ads \
791   s-intman.adb<s-intman-vxworks.adb \
792   s-osinte.adb<s-osinte-vxworks.adb \
793   s-osinte.ads<s-osinte-vxworks.ads \
794   s-osprim.adb<s-osprim-vxworks.adb \
795   s-parame.ads<s-parame-vxworks.ads \
796   s-parame.adb<s-parame-vxworks.adb \
797   s-stchop.ads<s-stchop-limit.ads \
798   s-stchop.adb<s-stchop-vxworks.adb \
799   s-taprop.adb<s-taprop-vxworks.adb \
800   s-tasinf.ads<s-tasinf-vxworks.ads \
801   s-taspri.ads<s-taspri-vxworks.ads \
802   s-tpopsp.adb<s-tpopsp-vxworks.adb \
803   g-socthi.ads<g-socthi-vxworks.ads \
804   g-socthi.adb<g-socthi-vxworks.adb \
805   g-stsifd.adb<g-stsifd-sockets.adb
806
807   TOOLS_TARGET_PAIRS=\
808   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
809   indepsw.adb<indepsw-gnu.adb
810
811   ifeq ($(strip $(filter-out sparc erc32 leon leon3, $(arch))),)
812     # 32-bits
813     LIBGNAT_TARGET_PAIRS += \
814     s-vxwork.ads<s-vxwork-sparc.ads \
815     system.ads<system-vxworks-sparc-kernel.ads
816   else
817     # 64-bits
818     LIBGNAT_TARGET_PAIRS += \
819     s-vxwork.ads<s-vxwork-sparcv9.ads \
820     system.ads<system-vxworks-sparcv9.ads
821   endif
822
823   ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
824     LIBGNAT_TARGET_PAIRS += \
825     s-vxwext.ads<s-vxwext-kernel.ads \
826     s-vxwext.adb<s-vxwext-kernel.adb
827   endif
828
829   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
830   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
831
832   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
833 endif
834
835 # x86 VxWorks
836 ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
837   LIBGNAT_TARGET_PAIRS = \
838   a-intnam.ads<a-intnam-vxworks.ads \
839   i-vxwork.ads<i-vxwork-x86.ads \
840   s-osinte.adb<s-osinte-vxworks.adb \
841   s-osinte.ads<s-osinte-vxworks.ads \
842   s-inmaop.adb<s-inmaop-vxworks.adb \
843   s-intman.ads<s-intman-vxworks.ads \
844   s-intman.adb<s-intman-vxworks.adb \
845   s-osprim.adb<s-osprim-vxworks.adb \
846   s-parame.ads<s-parame-vxworks.ads \
847   s-parame.adb<s-parame-vxworks.adb \
848   s-stchop.ads<s-stchop-limit.ads \
849   s-stchop.adb<s-stchop-vxworks.adb \
850   s-taprop.adb<s-taprop-vxworks.adb \
851   s-tasinf.ads<s-tasinf-vxworks.ads \
852   s-taspri.ads<s-taspri-vxworks.ads \
853   s-vxwork.ads<s-vxwork-x86.ads \
854   g-socthi.ads<g-socthi-vxworks.ads \
855   g-socthi.adb<g-socthi-vxworks.adb \
856   g-stsifd.adb<g-stsifd-sockets.adb \
857   $(ATOMICS_TARGET_PAIRS) \
858   $(X86_TARGET_PAIRS)
859
860   TOOLS_TARGET_PAIRS=\
861   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
862   indepsw.adb<indepsw-gnu.adb
863
864   ifeq ($(strip $(filter-out yes,$(TRACE))),)
865     LIBGNAT_TARGET_PAIRS += \
866     s-traces.adb<s-traces-default.adb \
867     s-trafor.adb<s-trafor-default.adb \
868     s-trafor.ads<s-trafor-default.ads \
869     s-tratas.adb<s-tratas-default.adb \
870     s-tfsetr.adb<s-tfsetr-vxworks.adb
871   endif
872
873   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
874     LIBGNAT_TARGET_PAIRS += \
875     s-vxwext.ads<s-vxwext-rtp.ads \
876     s-vxwext.adb<s-vxwext-rtp.adb \
877     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
878     system.ads<system-vxworks-x86-rtp.ads
879
880     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
881   else
882     ifeq ($(strip $(filter-out rtp-smp, $(THREAD_KIND))),)
883       LIBGNAT_TARGET_PAIRS += \
884       s-mudido.adb<s-mudido-affinity.adb \
885       s-vxwext.ads<s-vxwext-rtp.ads \
886       s-vxwext.adb<s-vxwext-rtp-smp.adb \
887       s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
888       system.ads<system-vxworks-x86-rtp.ads
889
890       EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
891       EXTRA_LIBGNAT_OBJS+=affinity.o
892     else
893       ifeq ($(strip $(filter-out kernel-smp, $(THREAD_KIND))),)
894         LIBGNAT_TARGET_PAIRS += \
895         s-interr.adb<s-interr-hwint.adb \
896         s-mudido.adb<s-mudido-affinity.adb \
897         s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
898         s-vxwext.ads<s-vxwext-kernel.ads \
899         s-vxwext.adb<s-vxwext-kernel-smp.adb \
900         system.ads<system-vxworks-x86-kernel.ads
901         EXTRA_LIBGNAT_OBJS+=affinity.o
902       else
903         LIBGNAT_TARGET_PAIRS += \
904         s-interr.adb<s-interr-hwint.adb \
905         s-tpopsp.adb<s-tpopsp-vxworks.adb
906
907         ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
908           LIBGNAT_TARGET_PAIRS += \
909           s-vxwext.ads<s-vxwext-kernel.ads \
910           s-vxwext.adb<s-vxwext-kernel.adb \
911           system.ads<system-vxworks-x86-kernel.ads
912         else
913           LIBGNAT_TARGET_PAIRS += \
914           system.ads<system-vxworks-x86.ads
915         endif
916       endif
917
918       EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
919     endif
920   endif
921   EXTRA_GNATRTL_TASKING_OBJS += s-vxwork.o s-vxwext.o
922
923   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
924 endif
925
926 # ARM VxWorks
927 ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
928   LIBGNAT_TARGET_PAIRS = \
929   a-intnam.ads<a-intnam-vxworks.ads \
930   a-numaux.ads<a-numaux-vxworks.ads \
931   s-inmaop.adb<s-inmaop-vxworks.adb \
932   s-interr.adb<s-interr-hwint.adb \
933   s-intman.ads<s-intman-vxworks.ads \
934   s-intman.adb<s-intman-vxworks.adb \
935   s-osinte.adb<s-osinte-vxworks.adb \
936   s-osinte.ads<s-osinte-vxworks.ads \
937   s-osprim.adb<s-osprim-vxworks.adb \
938   s-parame.ads<s-parame-vxworks.ads \
939   s-parame.adb<s-parame-vxworks.adb \
940   s-stchop.ads<s-stchop-limit.ads \
941   s-stchop.adb<s-stchop-vxworks.adb \
942   s-taprop.adb<s-taprop-vxworks.adb \
943   s-tasinf.ads<s-tasinf-vxworks.ads \
944   s-taspri.ads<s-taspri-vxworks.ads \
945   s-tpopsp.adb<s-tpopsp-vxworks.adb \
946   s-vxwork.ads<s-vxwork-arm.ads \
947   g-socthi.ads<g-socthi-vxworks.ads \
948   g-socthi.adb<g-socthi-vxworks.adb \
949   g-stsifd.adb<g-stsifd-sockets.adb \
950   system.ads<system-vxworks-arm.ads
951
952   TOOLS_TARGET_PAIRS=\
953   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
954   indepsw.adb<indepsw-gnu.adb
955
956   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
957   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
958
959   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
960 endif
961
962 # MIPS VxWorks
963 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
964   LIBGNAT_TARGET_PAIRS = \
965   a-intnam.ads<a-intnam-vxworks.ads \
966   a-numaux.ads<a-numaux-vxworks.ads \
967   s-inmaop.adb<s-inmaop-vxworks.adb \
968   s-interr.adb<s-interr-hwint.adb \
969   s-intman.ads<s-intman-vxworks.ads \
970   s-intman.adb<s-intman-vxworks.adb \
971   s-osinte.adb<s-osinte-vxworks.adb \
972   s-osinte.ads<s-osinte-vxworks.ads \
973   s-osprim.adb<s-osprim-vxworks.adb \
974   s-parame.ads<s-parame-vxworks.ads \
975   s-parame.adb<s-parame-vxworks.adb \
976   s-stchop.ads<s-stchop-limit.ads \
977   s-stchop.adb<s-stchop-vxworks.adb \
978   s-taprop.adb<s-taprop-vxworks.adb \
979   s-tasinf.ads<s-tasinf-vxworks.ads \
980   s-taspri.ads<s-taspri-vxworks.ads \
981   s-tpopsp.adb<s-tpopsp-vxworks.adb \
982   s-vxwork.ads<s-vxwork-mips.ads \
983   g-socthi.ads<g-socthi-vxworks.ads \
984   g-socthi.adb<g-socthi-vxworks.adb \
985   g-stsifd.adb<g-stsifd-sockets.adb \
986   system.ads<system-vxworks-mips.ads
987
988   TOOLS_TARGET_PAIRS=\
989   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
990   indepsw.adb<indepsw-gnu.adb
991
992   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
993   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
994
995   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
996 endif
997
998 ifeq ($(strip $(filter-out arm% linux-androideabi,$(arch) $(osys)-$(word 4,$(targ)))),)
999   LIBGNAT_TARGET_PAIRS = \
1000   a-intnam.ads<a-intnam-linux.ads \
1001   s-inmaop.adb<s-inmaop-posix.adb \
1002   s-intman.adb<s-intman-posix.adb \
1003   s-linux.ads<s-linux.ads \
1004   s-osinte.adb<s-osinte-android.adb \
1005   s-osinte.ads<s-osinte-android.ads \
1006   s-osprim.adb<s-osprim-posix.adb \
1007   s-taprop.adb<s-taprop-posix.adb \
1008   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1009   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1010   system.ads<system-linux-armel.ads \
1011   $(DUMMY_SOCKETS_TARGET_PAIRS)
1012
1013   TOOLS_TARGET_PAIRS =  \
1014     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1015     indepsw.adb<indepsw-gnu.adb
1016
1017   GNATRTL_SOCKETS_OBJS =
1018   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1019   EH_MECHANISM=
1020   THREADSLIB =
1021   GNATLIB_SHARED = gnatlib-shared-dual
1022   LIBRARY_VERSION := $(LIB_VERSION)
1023 endif
1024
1025 # Sparc Solaris
1026 ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
1027   LIBGNAT_TARGET_PAIRS_COMMON = \
1028   a-intnam.ads<a-intnam-solaris.ads \
1029   s-inmaop.adb<s-inmaop-posix.adb \
1030   s-intman.adb<s-intman-solaris.adb \
1031   s-mudido.adb<s-mudido-affinity.adb \
1032   s-osinte.adb<s-osinte-solaris.adb \
1033   s-osinte.ads<s-osinte-solaris.ads \
1034   s-osprim.adb<s-osprim-solaris.adb \
1035   s-taprop.adb<s-taprop-solaris.adb \
1036   s-tasinf.adb<s-tasinf-solaris.adb \
1037   s-tasinf.ads<s-tasinf-solaris.ads \
1038   s-taspri.ads<s-taspri-solaris.ads \
1039   s-tpopsp.adb<s-tpopsp-solaris.adb \
1040   g-soliop.ads<g-soliop-solaris.ads
1041
1042   LIBGNAT_TARGET_PAIRS_32 = \
1043   system.ads<system-solaris-sparc.ads
1044
1045   LIBGNAT_TARGET_PAIRS_64 = \
1046   system.ads<system-solaris-sparcv9.ads \
1047   $(ATOMICS_TARGET_PAIRS) \
1048   $(ATOMICS_BUILTINS_TARGET_PAIRS)
1049
1050   ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
1051     ifeq ($(strip $(MULTISUBDIR)),/sparcv9)
1052       LIBGNAT_TARGET_PAIRS = \
1053       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1054     else
1055       LIBGNAT_TARGET_PAIRS = \
1056       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1057     endif
1058   else
1059     ifeq ($(strip $(MULTISUBDIR)),/sparcv8plus)
1060       LIBGNAT_TARGET_PAIRS = \
1061       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1062     else
1063       LIBGNAT_TARGET_PAIRS = \
1064       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1065     endif
1066   endif
1067
1068   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
1069
1070   EH_MECHANISM=-gcc
1071   THREADSLIB = -lposix4 -lthread
1072   MISCLIB = -lposix4 -lnsl -lsocket
1073   SO_OPTS = -Wl,-h,
1074   GNATLIB_SHARED = gnatlib-shared-dual
1075   GMEM_LIB = gmemlib
1076   LIBRARY_VERSION := $(LIB_VERSION)
1077
1078   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
1079     LIBGNAT_TARGET_PAIRS = \
1080     a-intnam.ads<a-intnam-solaris.ads \
1081     s-inmaop.adb<s-inmaop-posix.adb \
1082     s-intman.adb<s-intman-posix.adb \
1083     s-osinte.adb<s-osinte-posix.adb \
1084     s-osinte.ads<s-osinte-solaris-posix.ads \
1085     s-osprim.adb<s-osprim-solaris.adb \
1086     s-taprop.adb<s-taprop-posix.adb \
1087     s-taspri.ads<s-taspri-posix.ads \
1088     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1089     g-soliop.ads<g-soliop-solaris.ads \
1090     system.ads<system-solaris-sparc.ads
1091
1092     THREADSLIB = -lposix4 -lpthread
1093   endif
1094
1095   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
1096     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
1097   endif
1098 endif
1099
1100 # x86 and x86-64 solaris
1101 ifeq ($(strip $(filter-out %86 %x86_64 solaris2%,$(arch) $(osys))),)
1102   LIBGNAT_TARGET_PAIRS_COMMON = \
1103   a-intnam.ads<a-intnam-solaris.ads \
1104   s-inmaop.adb<s-inmaop-posix.adb \
1105   s-intman.adb<s-intman-solaris.adb \
1106   s-mudido.adb<s-mudido-affinity.adb \
1107   s-osinte.adb<s-osinte-solaris.adb \
1108   s-osinte.ads<s-osinte-solaris.ads \
1109   s-osprim.adb<s-osprim-solaris.adb \
1110   s-taprop.adb<s-taprop-solaris.adb \
1111   s-tasinf.adb<s-tasinf-solaris.adb \
1112   s-tasinf.ads<s-tasinf-solaris.ads \
1113   s-taspri.ads<s-taspri-solaris.ads \
1114   s-tpopsp.adb<s-tpopsp-solaris.adb \
1115   g-soliop.ads<g-soliop-solaris.ads \
1116   $(ATOMICS_TARGET_PAIRS)
1117
1118   LIBGNAT_TARGET_PAIRS_32 = \
1119   $(X86_TARGET_PAIRS) \
1120   system.ads<system-solaris-x86.ads
1121
1122   LIBGNAT_TARGET_PAIRS_64 = \
1123   $(X86_64_TARGET_PAIRS) \
1124   system.ads<system-solaris-x86_64.ads
1125
1126   ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
1127     ifeq ($(strip $(MULTISUBDIR)),/amd64)
1128       LIBGNAT_TARGET_PAIRS = \
1129       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1130     else
1131       LIBGNAT_TARGET_PAIRS = \
1132       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1133     endif
1134   else
1135     ifeq ($(strip $(MULTISUBDIR)),/32)
1136       LIBGNAT_TARGET_PAIRS = \
1137       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1138     else
1139       LIBGNAT_TARGET_PAIRS = \
1140       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1141     endif
1142   endif
1143
1144   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
1145
1146   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1147
1148   EH_MECHANISM=-gcc
1149   THREADSLIB = -lposix4 -lthread
1150   MISCLIB = -lposix4 -lnsl -lsocket
1151   SO_OPTS = -Wl,-h,
1152   GNATLIB_SHARED = gnatlib-shared-dual
1153   GMEM_LIB = gmemlib
1154   LIBRARY_VERSION := $(LIB_VERSION)
1155 endif
1156
1157 # x86 Linux
1158 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
1159   LIBGNAT_TARGET_PAIRS = \
1160   a-intnam.ads<a-intnam-linux.ads \
1161   a-synbar.adb<a-synbar-posix.adb \
1162   a-synbar.ads<a-synbar-posix.ads \
1163   s-inmaop.adb<s-inmaop-posix.adb \
1164   s-intman.adb<s-intman-posix.adb \
1165   s-tpopsp.adb<s-tpopsp-tls.adb \
1166   g-sercom.adb<g-sercom-linux.adb \
1167   a-exetim.adb<a-exetim-posix.adb \
1168   a-exetim.ads<a-exetim-default.ads \
1169   s-linux.ads<s-linux.ads \
1170   s-osinte.adb<s-osinte-posix.adb \
1171   $(ATOMICS_TARGET_PAIRS)
1172
1173   LIBGNAT_TARGET_PAIRS_32 = \
1174   $(X86_TARGET_PAIRS) \
1175   system.ads<system-linux-x86.ads
1176
1177   LIBGNAT_TARGET_PAIRS_64 = \
1178   $(X86_64_TARGET_PAIRS) \
1179   system.ads<system-linux-x86_64.ads
1180
1181   ifeq ($(strip $(MULTISUBDIR)),/64)
1182     LIBGNAT_TARGET_PAIRS += $(LIBGNAT_TARGET_PAIRS_64)
1183   else
1184     LIBGNAT_TARGET_PAIRS += $(LIBGNAT_TARGET_PAIRS_32)
1185   endif
1186
1187   ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
1188     LIBGNAT_TARGET_PAIRS += \
1189     s-osinte.ads<s-osinte-linux-xenomai.ads \
1190     s-osprim.adb<s-osprim-linux-xenomai.adb \
1191     s-taprop.adb<s-taprop-linux-xenomai.adb \
1192     s-taspri.ads<s-taspri-linux-xenomai.ads
1193   else
1194     LIBGNAT_TARGET_PAIRS += \
1195     s-mudido.adb<s-mudido-affinity.adb \
1196     s-osinte.ads<s-osinte-linux.ads \
1197     s-osprim.adb<s-osprim-posix.adb \
1198     s-taprop.adb<s-taprop-linux.adb \
1199     s-tasinf.ads<s-tasinf-linux.ads \
1200     s-tasinf.adb<s-tasinf-linux.adb \
1201     s-taspri.ads<s-taspri-posix.ads
1202   endif
1203
1204   EH_MECHANISM=-gcc
1205   THREADSLIB = -lpthread -lrt
1206   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1207   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
1208
1209   TOOLS_TARGET_PAIRS =  \
1210     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1211     indepsw.adb<indepsw-gnu.adb
1212
1213   GNATLIB_SHARED = gnatlib-shared-dual
1214   GMEM_LIB = gmemlib
1215   LIBRARY_VERSION := $(LIB_VERSION)
1216 endif
1217
1218 # x86 kfreebsd
1219 ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
1220   LIBGNAT_TARGET_PAIRS = \
1221   a-intnam.ads<a-intnam-freebsd.ads \
1222   s-inmaop.adb<s-inmaop-posix.adb \
1223   s-intman.adb<s-intman-posix.adb \
1224   s-osinte.adb<s-osinte-posix.adb \
1225   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
1226   s-osprim.adb<s-osprim-posix.adb \
1227   s-taprop.adb<s-taprop-linux.adb \
1228   s-tasinf.ads<s-tasinf-linux.ads \
1229   s-tasinf.adb<s-tasinf-linux.adb \
1230   s-taspri.ads<s-taspri-posix.ads \
1231   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1232   $(ATOMICS_TARGET_PAIRS) \
1233   $(X86_TARGET_PAIRS) \
1234   system.ads<system-freebsd-x86.ads
1235
1236   TOOLS_TARGET_PAIRS =  \
1237     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1238     indepsw.adb<indepsw-gnu.adb
1239
1240   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1241
1242   EH_MECHANISM=-gcc
1243   THREADSLIB = -lpthread
1244   GNATLIB_SHARED = gnatlib-shared-dual
1245   GMEM_LIB = gmemlib
1246   LIBRARY_VERSION := $(LIB_VERSION)
1247   MISCLIB = -lutil
1248 endif
1249
1250 ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(arch) $(osys))),)
1251   LIBGNAT_TARGET_PAIRS = \
1252   a-intnam.ads<a-intnam-freebsd.ads \
1253   a-numaux.adb<a-numaux-x86.adb \
1254   a-numaux.ads<a-numaux-x86.ads \
1255   s-inmaop.adb<s-inmaop-posix.adb \
1256   s-intman.adb<s-intman-posix.adb \
1257   s-osinte.adb<s-osinte-posix.adb \
1258   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
1259   s-osprim.adb<s-osprim-posix.adb \
1260   s-taprop.adb<s-taprop-linux.adb \
1261   s-tasinf.ads<s-tasinf-linux.ads \
1262   s-tasinf.adb<s-tasinf-linux.adb \
1263   s-taspri.ads<s-taspri-posix.ads \
1264   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1265   system.ads<system-freebsd-x86_64.ads
1266
1267   TOOLS_TARGET_PAIRS =  \
1268     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1269     indepsw.adb<indepsw-gnu.adb
1270
1271   EH_MECHANISM=-gcc
1272   THREADSLIB = -lpthread
1273   GNATLIB_SHARED = gnatlib-shared-dual
1274   GMEM_LIB = gmemlib
1275   LIBRARY_VERSION := $(LIB_VERSION)
1276 endif
1277
1278 # x86 FreeBSD
1279 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
1280   LIBGNAT_TARGET_PAIRS = \
1281   a-intnam.ads<a-intnam-freebsd.ads \
1282   s-inmaop.adb<s-inmaop-posix.adb \
1283   s-intman.adb<s-intman-posix.adb \
1284   s-osinte.adb<s-osinte-freebsd.adb \
1285   s-osinte.ads<s-osinte-freebsd.ads \
1286   s-osprim.adb<s-osprim-posix.adb \
1287   s-taprop.adb<s-taprop-posix.adb \
1288   s-taspri.ads<s-taspri-posix.ads \
1289   s-tpopsp.adb<s-tpopsp-posix.adb \
1290   $(ATOMICS_TARGET_PAIRS) \
1291   $(X86_TARGET_PAIRS) \
1292   system.ads<system-freebsd-x86.ads
1293
1294   TOOLS_TARGET_PAIRS = \
1295   mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1296   GNATLIB_SHARED = gnatlib-shared-dual
1297
1298   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1299
1300   EH_MECHANISM=-gcc
1301   THREADSLIB= -lpthread
1302   GMEM_LIB = gmemlib
1303   LIBRARY_VERSION := $(LIB_VERSION)
1304   MISCLIB = -lutil
1305 endif
1306
1307 # x86-64 FreeBSD
1308 ifeq ($(strip $(filter-out %86_64 freebsd%,$(arch) $(osys))),)
1309   LIBGNAT_TARGET_PAIRS = \
1310   a-intnam.ads<a-intnam-freebsd.ads \
1311   s-inmaop.adb<s-inmaop-posix.adb \
1312   s-intman.adb<s-intman-posix.adb \
1313   s-osinte.adb<s-osinte-freebsd.adb \
1314   s-osinte.ads<s-osinte-freebsd.ads \
1315   s-osprim.adb<s-osprim-posix.adb \
1316   s-taprop.adb<s-taprop-posix.adb \
1317   s-taspri.ads<s-taspri-posix.ads \
1318   s-tpopsp.adb<s-tpopsp-posix.adb \
1319   $(ATOMICS_TARGET_PAIRS) \
1320   $(X86_64_TARGET_PAIRS) \
1321   system.ads<system-freebsd-x86_64.ads
1322
1323   TOOLS_TARGET_PAIRS = \
1324   mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1325   GNATLIB_SHARED = gnatlib-shared-dual
1326
1327   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1328
1329   EH_MECHANISM=-gcc
1330   THREADSLIB= -lpthread
1331   GMEM_LIB = gmemlib
1332   LIBRARY_VERSION := $(LIB_VERSION)
1333   MISCLIB = -lutil
1334 endif
1335
1336 # S390 Linux
1337 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
1338   LIBGNAT_TARGET_PAIRS_COMMON = \
1339   a-intnam.ads<a-intnam-linux.ads \
1340   s-inmaop.adb<s-inmaop-posix.adb \
1341   s-intman.adb<s-intman-posix.adb \
1342   s-linux.ads<s-linux.ads \
1343   s-osinte.adb<s-osinte-posix.adb \
1344   s-osinte.ads<s-osinte-linux.ads \
1345   s-osprim.adb<s-osprim-posix.adb \
1346   s-taprop.adb<s-taprop-linux.adb \
1347   s-tasinf.ads<s-tasinf-linux.ads \
1348   s-tasinf.adb<s-tasinf-linux.adb \
1349   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1350   s-tpopsp.adb<s-tpopsp-posix-foreign.adb
1351
1352   LIBGNAT_TARGET_PAIRS_32 = \
1353   system.ads<system-linux-s390.ads
1354
1355   LIBGNAT_TARGET_PAIRS_64 = \
1356   system.ads<system-linux-s390x.ads
1357
1358   ifeq ($(strip $(filter-out s390x,$(arch))),)
1359     ifeq ($(strip $(MULTISUBDIR)),/32)
1360       LIBGNAT_TARGET_PAIRS = \
1361       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1362     else
1363       LIBGNAT_TARGET_PAIRS = \
1364       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1365     endif
1366   else
1367     LIBGNAT_TARGET_PAIRS = \
1368     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1369   endif
1370
1371   TOOLS_TARGET_PAIRS =  \
1372     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1373     indepsw.adb<indepsw-gnu.adb
1374
1375   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1376   EH_MECHANISM=-gcc
1377   THREADSLIB = -lpthread
1378   GNATLIB_SHARED = gnatlib-shared-dual
1379   LIBRARY_VERSION := $(LIB_VERSION)
1380 endif
1381
1382 # HP/PA HP-UX 10
1383 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
1384   LIBGNAT_TARGET_PAIRS = \
1385   a-excpol.adb<a-excpol-abort.adb \
1386   a-intnam.ads<a-intnam-hpux.ads \
1387   s-inmaop.adb<s-inmaop-posix.adb \
1388   s-interr.adb<s-interr-sigaction.adb \
1389   s-intman.adb<s-intman-posix.adb \
1390   s-osinte.adb<s-osinte-hpux-dce.adb \
1391   s-osinte.ads<s-osinte-hpux-dce.ads \
1392   s-parame.ads<s-parame-hpux.ads \
1393   s-osprim.adb<s-osprim-posix.adb \
1394   s-taprop.adb<s-taprop-hpux-dce.adb \
1395   s-taspri.ads<s-taspri-hpux-dce.ads \
1396   s-tpopsp.adb<s-tpopsp-posix.adb \
1397   system.ads<system-hpux.ads
1398
1399   EH_MECHANISM=-gcc
1400 endif
1401
1402 # HP/PA HP-UX 11
1403 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
1404   LIBGNAT_TARGET_PAIRS = \
1405   a-intnam.ads<a-intnam-hpux.ads \
1406   s-inmaop.adb<s-inmaop-posix.adb \
1407   s-intman.adb<s-intman-posix.adb \
1408   s-osinte.adb<s-osinte-posix.adb \
1409   s-osinte.ads<s-osinte-hpux.ads \
1410   s-parame.ads<s-parame-hpux.ads \
1411   s-osprim.adb<s-osprim-posix.adb \
1412   s-traceb.adb<s-traceb-hpux.adb \
1413   s-taprop.adb<s-taprop-posix.adb \
1414   s-taspri.ads<s-taspri-posix.ads \
1415   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1416   system.ads<system-hpux.ads
1417
1418   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
1419   EH_MECHANISM=-gcc
1420   TGT_LIB = /usr/lib/libcl.a
1421   THREADSLIB = -lpthread
1422   GMEM_LIB = gmemlib
1423   soext = .sl
1424   SO_OPTS = -Wl,+h,
1425   GNATLIB_SHARED = gnatlib-shared-dual
1426   LIBRARY_VERSION := $(LIB_VERSION)
1427 endif
1428
1429 # IBM AIX
1430 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1431   LIBGNAT_TARGET_PAIRS_COMMON = \
1432   a-intnam.ads<a-intnam-aix.ads \
1433   s-inmaop.adb<s-inmaop-posix.adb \
1434   s-intman.adb<s-intman-posix.adb \
1435   s-osinte.adb<s-osinte-aix.adb \
1436   s-osinte.ads<s-osinte-aix.ads \
1437   s-osprim.adb<s-osprim-posix.adb \
1438   s-taprop.adb<s-taprop-posix.adb \
1439   s-taspri.ads<s-taspri-posix.ads \
1440   s-tpopsp.adb<s-tpopsp-posix.adb \
1441   $(ATOMICS_TARGET_PAIRS) \
1442   $(ATOMICS_BUILTINS_TARGET_PAIRS)
1443
1444   LIBGNAT_TARGET_PAIRS_32 = \
1445   system.ads<system-aix.ads
1446
1447   LIBGNAT_TARGET_PAIRS_64 = \
1448   system.ads<system-aix64.ads
1449
1450   ifeq ($(findstring ppc64, \
1451           $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) \
1452                    -print-multi-os-directory)), \
1453         ppc64)
1454     LIBGNAT_TARGET_PAIRS = \
1455     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1456     TOOLS_TARGET_PAIRS = \
1457     indepsw.adb<indepsw-aix.adb
1458   else
1459     LIBGNAT_TARGET_PAIRS = \
1460     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1461     TOOLS_TARGET_PAIRS = \
1462     indepsw.adb<indepsw-gnu.adb
1463   endif
1464
1465   THREADSLIB = -lpthreads
1466   EH_MECHANISM=-gcc
1467   TOOLS_TARGET_PAIRS += \
1468   mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb
1469
1470   GMEM_LIB = gmemlib
1471 endif
1472
1473 # RTEMS
1474 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1475   LIBGNAT_TARGET_PAIRS = \
1476   system.ads<system-rtems.ads \
1477   a-intnam.ads<a-intnam-rtems.ads \
1478   s-inmaop.adb<s-inmaop-posix.adb \
1479   s-intman.adb<s-intman-posix.adb \
1480   s-osinte.adb<s-osinte-rtems.adb \
1481   s-osinte.ads<s-osinte-rtems.ads \
1482   s-osprim.adb<s-osprim-posix.adb \
1483   s-parame.adb<s-parame-rtems.adb \
1484   s-taprop.adb<s-taprop-posix.adb \
1485   s-taspri.ads<s-taspri-posix.ads \
1486   s-tpopsp.adb<s-tpopsp-rtems.adb \
1487   s-stchop.adb<s-stchop-rtems.adb \
1488   s-interr.adb<s-interr-hwint.adb
1489 endif
1490
1491 # OpenVMS (host)
1492 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
1493
1494 soext  = .exe
1495 hyphen = _
1496 LN = cp -p
1497 LN_S = cp -p
1498
1499 endif
1500
1501 # OpenVMS (target)
1502 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1503   LIBGNAT_TARGET_PAIRS = \
1504     a-caldel.adb<a-caldel-vms.adb \
1505     a-calend.adb<a-calend-vms.adb \
1506     a-calend.ads<a-calend-vms.ads \
1507     a-dirval.adb<a-dirval-vms.adb \
1508     a-excpol.adb<a-excpol-abort.adb \
1509     a-intnam.ads<a-intnam-vms.ads \
1510     a-numaux.ads<a-numaux-vms.ads \
1511     g-expect.adb<g-expect-vms.adb \
1512     g-socthi.ads<g-socthi-vms.ads \
1513     g-socthi.adb<g-socthi-vms.adb \
1514     g-stsifd.adb<g-stsifd-sockets.adb \
1515     i-cstrea.adb<i-cstrea-vms.adb \
1516     memtrack.adb<memtrack-vms_64.adb \
1517     s-auxdec.ads<s-auxdec-vms_64.ads \
1518     s-inmaop.adb<s-inmaop-vms.adb \
1519     s-interr.adb<s-interr-vms.adb \
1520     s-intman.adb<s-intman-vms.adb \
1521     s-intman.ads<s-intman-vms.ads \
1522     s-memory.adb<s-memory-vms_64.adb \
1523     s-memory.ads<s-memory-vms_64.ads \
1524     s-ransee.adb<s-ransee-vms.adb \
1525     s-osprim.adb<s-osprim-vms.adb \
1526     s-osprim.ads<s-osprim-vms.ads \
1527     s-osinte.adb<s-osinte-vms.adb \
1528     s-osinte.ads<s-osinte-vms.ads \
1529     s-taprop.adb<s-taprop-vms.adb \
1530     s-tasdeb.adb<s-tasdeb-vms.adb \
1531     s-taspri.ads<s-taspri-vms.ads \
1532     s-tpopsp.adb<s-tpopsp-vms.adb \
1533     s-tpopde.adb<s-tpopde-vms.adb \
1534     s-tpopde.ads<s-tpopde-vms.ads
1535
1536   ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1537     LIBGNAT_TARGET_PAIRS += \
1538       g-enblsp.adb<g-enblsp-vms-ia64.adb \
1539       g-trasym.adb<g-trasym-vms-ia64.adb \
1540       s-asthan.adb<s-asthan-vms-ia64.adb \
1541       s-auxdec.adb<s-auxdec-vms-ia64.adb \
1542       s-vaflop.adb<s-vaflop-vms-ia64.adb \
1543       system.ads<system-vms-ia64.ads \
1544       s-parame.ads<s-parame-vms-ia64.ads \
1545       $(ATOMICS_TARGET_PAIRS) \
1546       $(ATOMICS_BUILTINS_TARGET_PAIRS)
1547
1548     EXTRA_LIBGNAT_SRCS+=tb-ivms.c
1549     override GNATRTL_ALTIVEC_OBJS=
1550
1551     TOOLS_TARGET_PAIRS= \
1552       mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
1553       symbols.adb<symbols-vms.adb \
1554       symbols-processing.adb<symbols-processing-vms-ia64.adb
1555   else
1556     ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1557       LIBGNAT_TARGET_PAIRS += \
1558         g-enblsp.adb<g-enblsp-vms-alpha.adb \
1559         g-trasym.adb<g-trasym-vms-alpha.adb \
1560         s-asthan.adb<s-asthan-vms-alpha.adb \
1561         s-auxdec.adb<s-auxdec-vms-alpha.adb \
1562         s-traent.adb<s-traent-vms.adb \
1563         s-traent.ads<s-traent-vms.ads \
1564         s-vaflop.adb<s-vaflop-vms-alpha.adb \
1565         system.ads<system-vms_64.ads \
1566         s-parame.ads<s-parame-vms-alpha.ads \
1567         $(ATOMICS_TARGET_PAIRS) \
1568         $(ATOMICS_BUILTINS_TARGET_PAIRS)
1569
1570     EXTRA_LIBGNAT_SRCS+=tb-alvms.c
1571
1572     TOOLS_TARGET_PAIRS= \
1573       mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
1574       symbols.adb<symbols-vms.adb \
1575       symbols-processing.adb<symbols-processing-vms-alpha.adb
1576     endif
1577   endif
1578
1579   EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
1580
1581   GMEM_LIB = gmemlib
1582   EH_MECHANISM=-gcc
1583   GNATLIB_SHARED=gnatlib-shared-vms
1584   EXTRA_GNATRTL_NONTASKING_OBJS+=s-po32gl.o
1585   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1586   EXTRA_GNATTOOLS = \
1587      ../../gnatsym$(exeext)
1588   # This command transforms (YYYYMMDD) into YY,MMDD
1589   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
1590   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1591   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1592 endif
1593
1594 # *-elf
1595 ifeq ($(strip $(filter-out avr none powerpc% eabispe leon% erc32% unknown elf,$(targ))),)
1596   TOOLS_TARGET_PAIRS=\
1597   mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb \
1598   indepsw.adb<indepsw-gnu.adb
1599 endif
1600
1601 # Cygwin/Mingw32
1602 ifeq ($(strip $(filter-out cygwin% mingw32% pe,$(osys))),)
1603   # Cygwin provides a full Posix environment, and so we use the default
1604   # versions of s-memory and g-socthi rather than the Windows-specific
1605   # MinGW versions.  Ideally we would use all the default versions for
1606   # Cygwin and none of the MinGW versions, but for historical reasons
1607   # the Cygwin port has always been a CygMing frankenhybrid and it is
1608   # a long-term project to disentangle them.
1609   ifeq ($(strip $(filter-out cygwin%,$(osys))),)
1610     LIBGNAT_TARGET_PAIRS = \
1611     s-memory.adb<s-memory.adb \
1612     g-socthi.ads<g-socthi.ads \
1613     g-socthi.adb<g-socthi.adb
1614   else
1615     LIBGNAT_TARGET_PAIRS = \
1616     s-memory.adb<s-memory-mingw.adb \
1617     g-socthi.ads<g-socthi-mingw.ads \
1618     g-socthi.adb<g-socthi-mingw.adb
1619   endif
1620   LIBGNAT_TARGET_PAIRS += \
1621   a-dirval.adb<a-dirval-mingw.adb \
1622   a-excpol.adb<a-excpol-abort.adb \
1623   s-gloloc.adb<s-gloloc-mingw.adb \
1624   s-inmaop.adb<s-inmaop-dummy.adb \
1625   s-taspri.ads<s-taspri-mingw.ads \
1626   s-tasinf.adb<s-tasinf-mingw.adb \
1627   s-tasinf.ads<s-tasinf-mingw.ads \
1628   g-stsifd.adb<g-stsifd-sockets.adb \
1629   g-soliop.ads<g-soliop-mingw.ads \
1630   $(ATOMICS_TARGET_PAIRS)
1631
1632   ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
1633     LIBGNAT_TARGET_PAIRS += \
1634     s-intman.adb<s-intman-dummy.adb \
1635     s-osinte.ads<s-osinte-rtx.ads \
1636     s-osprim.adb<s-osprim-rtx.adb \
1637     s-taprop.adb<s-taprop-rtx.adb \
1638     $(X86_TARGET_PAIRS)
1639
1640     EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
1641
1642     ifeq ($(strip $(filter-out rtx_w32,$(THREAD_KIND))),)
1643        LIBGNAT_TARGET_PAIRS += system.ads<system-rtx.ads
1644
1645        EH_MECHANISM=-gcc
1646     else
1647        LIBGNAT_TARGET_PAIRS += \
1648        system.ads<system-rtx-rtss.ads \
1649        s-parame.adb<s-parame-vxworks.adb
1650
1651        EH_MECHANISM=
1652     endif
1653
1654   else
1655     LIBGNAT_TARGET_PAIRS += \
1656     a-exetim.adb<a-exetim-mingw.adb \
1657     a-exetim.ads<a-exetim-mingw.ads \
1658     a-intnam.ads<a-intnam-mingw.ads \
1659     g-sercom.adb<g-sercom-mingw.adb \
1660     s-interr.adb<s-interr-sigaction.adb \
1661     s-intman.adb<s-intman-mingw.adb \
1662     s-mudido.adb<s-mudido-affinity.adb \
1663     s-osinte.ads<s-osinte-mingw.ads \
1664     s-osprim.adb<s-osprim-mingw.adb \
1665     s-taprop.adb<s-taprop-mingw.adb
1666
1667     ifeq ($(strip $(filter-out x86_64%,$(arch))),)
1668       ifeq ($(strip $(MULTISUBDIR)),/32)
1669         LIBGNAT_TARGET_PAIRS += \
1670           $(X86_TARGET_PAIRS) \
1671           system.ads<system-mingw.ads
1672         SO_OPTS= -m32 -Wl,-soname,
1673       else
1674         LIBGNAT_TARGET_PAIRS += \
1675           $(X86_64_TARGET_PAIRS) \
1676           system.ads<system-mingw-x86_64.ads
1677         SO_OPTS = -m64 -Wl,-soname,
1678       endif
1679     else
1680       ifeq ($(strip $(MULTISUBDIR)),/64)
1681         LIBGNAT_TARGET_PAIRS += \
1682           $(X86_64_TARGET_PAIRS) \
1683           system.ads<system-mingw-x86_64.ads
1684         SO_OPTS = -m64 -Wl,-soname,
1685       else
1686         LIBGNAT_TARGET_PAIRS += \
1687           $(X86_TARGET_PAIRS) \
1688           system.ads<system-mingw.ads
1689         SO_OPTS = -m32 -Wl,-soname,
1690       endif
1691     endif
1692
1693     EXTRA_GNATRTL_NONTASKING_OBJS = \
1694         s-win32.o s-winext.o g-regist.o g-sse.o g-ssvety.o
1695     EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
1696
1697     MISCLIB = -lws2_32
1698
1699     # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
1700     # auto-import support for array/record will be done.
1701     GNATLIB_SHARED = gnatlib-shared-win32
1702
1703     EH_MECHANISM=-gcc
1704   endif
1705
1706   TOOLS_TARGET_PAIRS= \
1707   mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
1708   indepsw.adb<indepsw-mingw.adb
1709
1710   GMEM_LIB = gmemlib
1711   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1712   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1713   soext = .dll
1714   LIBRARY_VERSION := $(LIB_VERSION)
1715 endif
1716
1717 # Mips Linux
1718 ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
1719   LIBGNAT_TARGET_PAIRS = \
1720   a-intnam.ads<a-intnam-linux.ads \
1721   s-inmaop.adb<s-inmaop-posix.adb \
1722   s-intman.adb<s-intman-posix.adb \
1723   s-linux.ads<s-linux.ads \
1724   s-osinte.adb<s-osinte-posix.adb \
1725   s-osinte.ads<s-osinte-linux.ads \
1726   s-osprim.adb<s-osprim-posix.adb \
1727   s-taprop.adb<s-taprop-linux.adb \
1728   s-tasinf.ads<s-tasinf-linux.ads \
1729   s-tasinf.adb<s-tasinf-linux.adb \
1730   s-taspri.ads<s-taspri-posix.ads \
1731   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1732   system.ads<system-linux-mips.ads
1733
1734   EH_MECHANISM=-gcc
1735   THREADSLIB = -lpthread
1736   GNATLIB_SHARED = gnatlib-shared-dual
1737   GMEM_LIB = gmemlib
1738   LIBRARY_VERSION := $(LIB_VERSION)
1739 endif
1740
1741 # Mips/el Linux
1742 ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
1743   LIBGNAT_TARGET_PAIRS_COMMON = \
1744   a-intnam.ads<a-intnam-linux.ads \
1745   s-inmaop.adb<s-inmaop-posix.adb \
1746   s-intman.adb<s-intman-posix.adb \
1747   s-linux.ads<s-linux-mipsel.ads \
1748   s-osinte.adb<s-osinte-posix.adb \
1749   s-osinte.ads<s-osinte-linux.ads \
1750   s-osprim.adb<s-osprim-posix.adb \
1751   s-taprop.adb<s-taprop-linux.adb \
1752   s-tasinf.ads<s-tasinf-linux.ads \
1753   s-tasinf.adb<s-tasinf-linux.adb \
1754   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1755   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1756   g-sercom.adb<g-sercom-linux.adb
1757
1758   LIBGNAT_TARGET_PAIRS_32 = \
1759   system.ads<system-linux-mipsel.ads
1760
1761   LIBGNAT_TARGET_PAIRS_64 = \
1762   system.ads<system-linux-mips64el.ads
1763
1764   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1765     LIBGNAT_TARGET_PAIRS = \
1766     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1767   else
1768     LIBGNAT_TARGET_PAIRS = \
1769     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1770   endif
1771
1772   TOOLS_TARGET_PAIRS =  \
1773     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1774     indepsw.adb<indepsw-gnu.adb
1775
1776   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1777   EH_MECHANISM=-gcc
1778   THREADSLIB = -lpthread
1779   GNATLIB_SHARED = gnatlib-shared-dual
1780   GMEM_LIB = gmemlib
1781   LIBRARY_VERSION := $(LIB_VERSION)
1782 endif
1783
1784 # Mips64/el Linux
1785 ifeq ($(strip $(filter-out mips64el linux%,$(arch) $(osys))),)
1786   LIBGNAT_TARGET_PAIRS_COMMON = \
1787   a-intnam.ads<a-intnam-linux.ads \
1788   s-inmaop.adb<s-inmaop-posix.adb \
1789   s-intman.adb<s-intman-posix.adb \
1790   s-linux.ads<s-linux-mipsel.ads \
1791   s-osinte.adb<s-osinte-posix.adb \
1792   s-osinte.ads<s-osinte-linux.ads \
1793   s-osprim.adb<s-osprim-posix.adb \
1794   s-taprop.adb<s-taprop-linux.adb \
1795   s-tasinf.ads<s-tasinf-linux.ads \
1796   s-tasinf.adb<s-tasinf-linux.adb \
1797   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1798   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1799   g-sercom.adb<g-sercom-linux.adb
1800
1801   LIBGNAT_TARGET_PAIRS_32 = \
1802   system.ads<system-linux-mipsel.ads
1803
1804   LIBGNAT_TARGET_PAIRS_64 = \
1805   system.ads<system-linux-mips64el.ads
1806
1807   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1808     LIBGNAT_TARGET_PAIRS = \
1809     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1810   else
1811     LIBGNAT_TARGET_PAIRS = \
1812     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1813   endif
1814
1815   TOOLS_TARGET_PAIRS =  \
1816     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1817     indepsw.adb<indepsw-gnu.adb
1818
1819   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1820   EH_MECHANISM=-gcc
1821   THREADSLIB = -lpthread
1822   GNATLIB_SHARED = gnatlib-shared-dual
1823   GMEM_LIB = gmemlib
1824   LIBRARY_VERSION := $(LIB_VERSION)
1825 endif
1826
1827 # PowerPC and e500v2 Linux
1828 ifeq ($(strip $(filter-out powerpc% e500% linux%,$(arch) $(osys))),)
1829   LIBGNAT_TARGET_PAIRS_COMMON = \
1830   a-exetim.adb<a-exetim-posix.adb \
1831   a-exetim.ads<a-exetim-default.ads \
1832   a-intnam.ads<a-intnam-linux.ads \
1833   a-synbar.adb<a-synbar-posix.adb \
1834   a-synbar.ads<a-synbar-posix.ads \
1835   s-inmaop.adb<s-inmaop-posix.adb \
1836   s-intman.adb<s-intman-posix.adb \
1837   s-linux.ads<s-linux.ads \
1838   s-osinte.adb<s-osinte-posix.adb \
1839   s-tpopsp.adb<s-tpopsp-tls.adb \
1840   g-sercom.adb<g-sercom-linux.adb \
1841   $(ATOMICS_TARGET_PAIRS) \
1842   $(ATOMICS_BUILTINS_TARGET_PAIRS)
1843
1844   ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
1845     LIBGNAT_TARGET_PAIRS = \
1846       $(LIBGNAT_TARGET_PAIRS_COMMON)
1847
1848     LIBGNAT_TARGET_PAIRS += \
1849     s-osinte.ads<s-osinte-linux-xenomai.ads \
1850     s-osprim.adb<s-osprim-linux-xenomai.adb \
1851     s-taprop.adb<s-taprop-linux-xenomai.adb \
1852     s-taspri.ads<s-taspri-linux-xenomai.ads \
1853     system.ads<system-linux-ppc.ads
1854   else
1855     LIBGNAT_TARGET_PAIRS_32 = \
1856     system.ads<system-linux-ppc.ads
1857
1858     LIBGNAT_TARGET_PAIRS_64 = \
1859     system.ads<system-linux-ppc64.ads
1860
1861     ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1862       LIBGNAT_TARGET_PAIRS = \
1863       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1864     else
1865       LIBGNAT_TARGET_PAIRS = \
1866       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1867     endif
1868
1869     LIBGNAT_TARGET_PAIRS += \
1870     s-mudido.adb<s-mudido-affinity.adb \
1871     s-osinte.ads<s-osinte-linux.ads \
1872     s-osprim.adb<s-osprim-posix.adb \
1873     s-taprop.adb<s-taprop-linux.adb \
1874     s-tasinf.ads<s-tasinf-linux.ads \
1875     s-tasinf.adb<s-tasinf-linux.adb \
1876     s-taspri.ads<s-taspri-posix-noaltstack.ads
1877   endif
1878
1879   TOOLS_TARGET_PAIRS =  \
1880     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1881     indepsw.adb<indepsw-gnu.adb
1882
1883   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
1884   EH_MECHANISM=-gcc
1885   THREADSLIB = -lpthread -lrt
1886   GNATLIB_SHARED = gnatlib-shared-dual
1887   GMEM_LIB = gmemlib
1888   LIBRARY_VERSION := $(LIB_VERSION)
1889 endif
1890
1891 ifeq ($(strip $(filter-out arm%-linux,$(arch)-$(osys)) $(if $(findstring eabi,$(word 4,$(targ))),,$(word 4,$(targ)))),)
1892   LIBGNAT_TARGET_PAIRS = \
1893   a-intnam.ads<a-intnam-linux.ads \
1894   s-inmaop.adb<s-inmaop-posix.adb \
1895   s-intman.adb<s-intman-posix.adb \
1896   s-linux.ads<s-linux.ads \
1897   s-osinte.adb<s-osinte-posix.adb \
1898   s-osinte.ads<s-osinte-linux.ads \
1899   s-osprim.adb<s-osprim-posix.adb \
1900   s-taprop.adb<s-taprop-linux.adb \
1901   s-tasinf.ads<s-tasinf-linux.ads \
1902   s-tasinf.adb<s-tasinf-linux.adb \
1903   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1904   s-tpopsp.adb<s-tpopsp-posix-foreign.adb
1905
1906   ifeq ($(strip $(filter-out arm%b,$(arch))),)
1907     LIBGNAT_TARGET_PAIRS += \
1908     system.ads<system-linux-armeb.ads
1909   else
1910     LIBGNAT_TARGET_PAIRS += \
1911     system.ads<system-linux-armel.ads
1912   endif
1913
1914   TOOLS_TARGET_PAIRS =  \
1915     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1916     indepsw.adb<indepsw-gnu.adb
1917
1918   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1919   EH_MECHANISM=
1920   THREADSLIB = -lpthread
1921   GNATLIB_SHARED = gnatlib-shared-dual
1922   GMEM_LIB = gmemlib
1923   LIBRARY_VERSION := $(LIB_VERSION)
1924 endif
1925
1926 # Sparc Linux
1927 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
1928   LIBGNAT_TARGET_PAIRS_COMMON = \
1929   a-intnam.ads<a-intnam-linux.ads \
1930   s-inmaop.adb<s-inmaop-posix.adb \
1931   s-intman.adb<s-intman-posix.adb \
1932   s-linux.ads<s-linux-sparc.ads \
1933   s-osinte.adb<s-osinte-posix.adb \
1934   s-osinte.ads<s-osinte-linux.ads \
1935   s-osprim.adb<s-osprim-posix.adb \
1936   s-taprop.adb<s-taprop-linux.adb \
1937   s-tasinf.ads<s-tasinf-linux.ads \
1938   s-tasinf.adb<s-tasinf-linux.adb \
1939   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1940   s-tpopsp.adb<s-tpopsp-tls.adb
1941
1942   LIBGNAT_TARGET_PAIRS_32 = \
1943   system.ads<system-linux-sparc.ads
1944
1945   LIBGNAT_TARGET_PAIRS_64 = \
1946   system.ads<system-linux-sparcv9.ads
1947
1948   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1949     LIBGNAT_TARGET_PAIRS = \
1950     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1951   else
1952     LIBGNAT_TARGET_PAIRS = \
1953     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1954   endif
1955
1956   TOOLS_TARGET_PAIRS =  \
1957     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1958     indepsw.adb<indepsw-gnu.adb
1959
1960   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1961   EH_MECHANISM=-gcc
1962   THREADSLIB = -lpthread
1963   GNATLIB_SHARED = gnatlib-shared-dual
1964   GMEM_LIB = gmemlib
1965   LIBRARY_VERSION := $(LIB_VERSION)
1966 endif
1967
1968 # HP/PA Linux
1969 ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
1970   LIBGNAT_TARGET_PAIRS = \
1971   a-intnam.ads<a-intnam-linux.ads \
1972   s-inmaop.adb<s-inmaop-posix.adb \
1973   s-intman.adb<s-intman-posix.adb \
1974   s-linux.ads<s-linux-hppa.ads \
1975   s-osinte.adb<s-osinte-posix.adb \
1976   s-osinte.ads<s-osinte-linux.ads \
1977   s-osprim.adb<s-osprim-posix.adb \
1978   s-taprop.adb<s-taprop-linux.adb \
1979   s-tasinf.ads<s-tasinf-linux.ads \
1980   s-tasinf.adb<s-tasinf-linux.adb \
1981   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1982   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1983   system.ads<system-linux-hppa.ads
1984
1985   TOOLS_TARGET_PAIRS =  \
1986     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1987     indepsw.adb<indepsw-gnu.adb
1988
1989   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1990   EH_MECHANISM=-gcc
1991   THREADSLIB = -lpthread
1992   GNATLIB_SHARED = gnatlib-shared-dual
1993   GMEM_LIB = gmemlib
1994   LIBRARY_VERSION := $(LIB_VERSION)
1995 endif
1996
1997 # SH4 Linux
1998 ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
1999   LIBGNAT_TARGET_PAIRS = \
2000   a-intnam.ads<a-intnam-linux.ads \
2001   s-inmaop.adb<s-inmaop-posix.adb \
2002   s-intman.adb<s-intman-posix.adb \
2003   s-linux.ads<s-linux.ads \
2004   s-osinte.adb<s-osinte-posix.adb \
2005   s-osinte.ads<s-osinte-linux.ads \
2006   s-osprim.adb<s-osprim-posix.adb \
2007   s-taprop.adb<s-taprop-linux.adb \
2008   s-tasinf.ads<s-tasinf-linux.ads \
2009   s-tasinf.adb<s-tasinf-linux.adb \
2010   s-taspri.ads<s-taspri-posix-noaltstack.ads \
2011   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2012   system.ads<system-linux-sh4.ads
2013
2014   TOOLS_TARGET_PAIRS =  \
2015     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2016     indepsw.adb<indepsw-linux.adb
2017
2018   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
2019   EH_MECHANISM=-gcc
2020   MISCLIB=
2021   THREADSLIB = -lpthread
2022   GNATLIB_SHARED = gnatlib-shared-dual
2023   GMEM_LIB = gmemlib
2024   LIBRARY_VERSION := $(LIB_VERSION)
2025 endif
2026
2027 # IA64 Linux
2028 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
2029   LIBGNAT_TARGET_PAIRS = \
2030   a-exetim.adb<a-exetim-posix.adb \
2031   a-exetim.ads<a-exetim-default.ads \
2032   a-intnam.ads<a-intnam-linux.ads \
2033   a-numaux.ads<a-numaux-libc-x86.ads \
2034   a-synbar.adb<a-synbar-posix.adb \
2035   a-synbar.ads<a-synbar-posix.ads \
2036   s-inmaop.adb<s-inmaop-posix.adb \
2037   s-intman.adb<s-intman-posix.adb \
2038   s-linux.ads<s-linux.ads \
2039   s-mudido.adb<s-mudido-affinity.adb \
2040   s-osinte.ads<s-osinte-linux.ads \
2041   s-osinte.adb<s-osinte-posix.adb \
2042   s-osprim.adb<s-osprim-posix.adb \
2043   s-taprop.adb<s-taprop-linux.adb \
2044   s-tasinf.ads<s-tasinf-linux.ads \
2045   s-tasinf.adb<s-tasinf-linux.adb \
2046   s-tpopsp.adb<s-tpopsp-tls.adb \
2047   s-taspri.ads<s-taspri-posix-noaltstack.ads \
2048   g-sercom.adb<g-sercom-linux.adb \
2049   system.ads<system-linux-ia64.ads \
2050   $(ATOMICS_TARGET_PAIRS) \
2051   $(ATOMICS_BUILTINS_TARGET_PAIRS)
2052
2053   TOOLS_TARGET_PAIRS =  \
2054     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2055     indepsw.adb<indepsw-gnu.adb
2056
2057   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
2058   EH_MECHANISM=-gcc
2059   MISCLIB=
2060   THREADSLIB=-lpthread -lrt
2061   GNATLIB_SHARED=gnatlib-shared-dual
2062   GMEM_LIB = gmemlib
2063   LIBRARY_VERSION := $(LIB_VERSION)
2064 endif
2065
2066 # IA64 HP-UX
2067 ifeq ($(strip $(filter-out ia64% hp hpux%,$(targ))),)
2068   LIBGNAT_TARGET_PAIRS = \
2069   a-intnam.ads<a-intnam-hpux.ads \
2070   s-inmaop.adb<s-inmaop-posix.adb \
2071   s-intman.adb<s-intman-posix.adb \
2072   s-osinte.adb<s-osinte-posix.adb \
2073   s-osinte.ads<s-osinte-hpux.ads \
2074   s-osprim.adb<s-osprim-posix.adb \
2075   s-taprop.adb<s-taprop-posix.adb \
2076   s-taspri.ads<s-taspri-posix.ads \
2077   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2078   system.ads<system-hpux-ia64.ads \
2079   $(ATOMICS_TARGET_PAIRS) \
2080   $(ATOMICS_BUILTINS_TARGET_PAIRS)
2081
2082   TOOLS_TARGET_PAIRS = \
2083   mlib-tgt-specific.adb<mlib-tgt-specific-ia64-hpux.adb
2084
2085   MISCLIB=
2086   EH_MECHANISM=-gcc
2087   THREADSLIB=-lpthread
2088   GNATLIB_SHARED=gnatlib-shared-dual
2089   GMEM_LIB = gmemlib
2090   soext = .so
2091   SO_OPTS = -Wl,+h,
2092   LIBRARY_VERSION := $(LIB_VERSION)
2093 endif
2094
2095 # Alpha Linux
2096 ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
2097   LIBGNAT_TARGET_PAIRS = \
2098   a-intnam.ads<a-intnam-linux.ads \
2099   s-inmaop.adb<s-inmaop-posix.adb \
2100   s-intman.adb<s-intman-posix.adb \
2101   s-linux.ads<s-linux-alpha.ads \
2102   s-osinte.ads<s-osinte-linux.ads \
2103   s-osinte.adb<s-osinte-posix.adb \
2104   s-osprim.adb<s-osprim-posix.adb \
2105   s-taprop.adb<s-taprop-linux.adb \
2106   s-tasinf.ads<s-tasinf-linux.ads \
2107   s-tasinf.adb<s-tasinf-linux.adb \
2108   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2109   s-taspri.ads<s-taspri-posix-noaltstack.ads \
2110   system.ads<system-linux-alpha.ads \
2111   $(ATOMICS_TARGET_PAIRS) \
2112   $(ATOMICS_BUILTINS_TARGET_PAIRS)
2113
2114   TOOLS_TARGET_PAIRS =  \
2115     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2116     indepsw.adb<indepsw-gnu.adb
2117
2118   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
2119   EH_MECHANISM=-gcc
2120   MISCLIB=
2121   THREADSLIB=-lpthread
2122   GNATLIB_SHARED=gnatlib-shared-dual
2123   LIBRARY_VERSION := $(LIB_VERSION)
2124 endif
2125
2126 # x86-64 Linux
2127 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
2128   LIBGNAT_TARGET_PAIRS = \
2129   a-exetim.adb<a-exetim-posix.adb \
2130   a-exetim.ads<a-exetim-default.ads \
2131   a-intnam.ads<a-intnam-linux.ads \
2132   a-synbar.adb<a-synbar-posix.adb \
2133   a-synbar.ads<a-synbar-posix.ads \
2134   s-inmaop.adb<s-inmaop-posix.adb \
2135   s-intman.adb<s-intman-posix.adb \
2136   s-linux.ads<s-linux.ads \
2137   s-mudido.adb<s-mudido-affinity.adb \
2138   s-osinte.ads<s-osinte-linux.ads \
2139   s-osinte.adb<s-osinte-posix.adb \
2140   s-osprim.adb<s-osprim-posix.adb \
2141   s-taprop.adb<s-taprop-linux.adb \
2142   s-tasinf.ads<s-tasinf-linux.ads \
2143   s-tasinf.adb<s-tasinf-linux.adb \
2144   s-tpopsp.adb<s-tpopsp-tls.adb \
2145   s-taspri.ads<s-taspri-posix.ads \
2146   g-sercom.adb<g-sercom-linux.adb \
2147   $(ATOMICS_TARGET_PAIRS) \
2148   $(X86_64_TARGET_PAIRS) \
2149   system.ads<system-linux-x86_64.ads
2150
2151   TOOLS_TARGET_PAIRS =  \
2152     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2153     indepsw.adb<indepsw-gnu.adb
2154
2155   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
2156   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
2157   EH_MECHANISM=-gcc
2158   THREADSLIB=-lpthread -lrt
2159   GNATLIB_SHARED=gnatlib-shared-dual
2160   GMEM_LIB = gmemlib
2161   LIBRARY_VERSION := $(LIB_VERSION)
2162 endif
2163
2164 ifeq ($(strip $(filter-out %x32 linux%,$(arch) $(osys))),)
2165   LIBGNAT_TARGET_PAIRS = \
2166   a-exetim.adb<a-exetim-posix.adb \
2167   a-exetim.ads<a-exetim-default.ads \
2168   a-intnam.ads<a-intnam-linux.ads \
2169   a-synbar.adb<a-synbar-posix.adb \
2170   a-synbar.ads<a-synbar-posix.ads \
2171   s-inmaop.adb<s-inmaop-posix.adb \
2172   s-intman.adb<s-intman-posix.adb \
2173   s-linux.ads<s-linux.ads \
2174   s-mudido.adb<s-mudido-affinity.adb \
2175   s-osinte.ads<s-osinte-linux.ads \
2176   s-osinte.adb<s-osinte-posix.adb \
2177   s-osprim.adb<s-osprim-posix.adb \
2178   s-taprop.adb<s-taprop-linux.adb \
2179   s-tasinf.ads<s-tasinf-linux.ads \
2180   s-tasinf.adb<s-tasinf-linux.adb \
2181   s-tpopsp.adb<s-tpopsp-tls.adb \
2182   s-taspri.ads<s-taspri-posix.ads \
2183   g-sercom.adb<g-sercom-linux.adb \
2184   $(ATOMICS_TARGET_PAIRS) \
2185   $(X86_64_TARGET_PAIRS) \
2186   system.ads<system-linux-x86.ads
2187
2188   TOOLS_TARGET_PAIRS =  \
2189     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2190     indepsw.adb<indepsw-gnu.adb
2191
2192   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
2193   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
2194   EH_MECHANISM=-gcc
2195   THREADSLIB=-lpthread -lrt
2196   GNATLIB_SHARED=gnatlib-shared-dual
2197   GMEM_LIB = gmemlib
2198   LIBRARY_VERSION := $(LIB_VERSION)
2199 endif
2200
2201 # Darwin (Mac OS X)
2202 ifeq ($(strip $(filter-out darwin%,$(osys))),)
2203   SO_OPTS = -shared-libgcc
2204   LIBGNAT_TARGET_PAIRS = \
2205     a-intnam.ads<a-intnam-darwin.ads \
2206     s-inmaop.adb<s-inmaop-posix.adb \
2207     s-osinte.adb<s-osinte-darwin.adb \
2208     s-osinte.ads<s-osinte-darwin.ads \
2209     s-taprop.adb<s-taprop-posix.adb \
2210     s-taspri.ads<s-taspri-posix.ads \
2211     s-tpopsp.adb<s-tpopsp-posix-foreign.adb
2212
2213   ifeq ($(strip $(filter-out %86,$(arch))),)
2214     LIBGNAT_TARGET_PAIRS += \
2215       s-intman.adb<s-intman-susv3.adb \
2216       s-osprim.adb<s-osprim-darwin.adb \
2217       $(ATOMICS_TARGET_PAIRS)
2218
2219     ifeq ($(strip $(MULTISUBDIR)),/x86_64)
2220       LIBGNAT_TARGET_PAIRS += \
2221         $(X86_64_TARGET_PAIRS) \
2222         system.ads<system-darwin-x86_64.ads
2223       SO_OPTS += -m64
2224     else
2225       LIBGNAT_TARGET_PAIRS += \
2226         $(X86_TARGET_PAIRS) \
2227         system.ads<system-darwin-x86.ads
2228     endif
2229
2230     EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
2231   endif
2232
2233   ifeq ($(strip $(filter-out %x86_64,$(arch))),)
2234     LIBGNAT_TARGET_PAIRS += \
2235       s-intman.adb<s-intman-susv3.adb \
2236       s-osprim.adb<s-osprim-darwin.adb \
2237       $(ATOMICS_TARGET_PAIRS)
2238
2239     ifeq ($(strip $(MULTISUBDIR)),/i386)
2240       LIBGNAT_TARGET_PAIRS += \
2241         $(X86_TARGET_PAIRS) \
2242         system.ads<system-darwin-x86.ads
2243       SO_OPTS += -m32
2244     else
2245       LIBGNAT_TARGET_PAIRS += \
2246         $(X86_64_TARGET_PAIRS) \
2247         system.ads<system-darwin-x86_64.ads
2248     endif
2249
2250     EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
2251   endif
2252
2253   ifeq ($(strip $(filter-out powerpc%,$(arch))),)
2254     LIBGNAT_TARGET_PAIRS += \
2255       s-intman.adb<s-intman-posix.adb \
2256       s-osprim.adb<s-osprim-posix.adb \
2257       a-numaux.ads<a-numaux-darwin.ads \
2258       a-numaux.adb<a-numaux-darwin.adb
2259
2260     ifeq ($(strip $(MULTISUBDIR)),/ppc64)
2261       LIBGNAT_TARGET_PAIRS += \
2262         system.ads<system-darwin-ppc64.ads
2263         SO_OPTS += -m64
2264     else
2265       LIBGNAT_TARGET_PAIRS += \
2266       system.ads<system-darwin-ppc.ads
2267     endif
2268   endif
2269
2270   TOOLS_TARGET_PAIRS =  \
2271     mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb \
2272     indepsw.adb<indepsw-darwin.adb
2273
2274   EH_MECHANISM=-gcc
2275   GNATLIB_SHARED = gnatlib-shared-darwin
2276   GMEM_LIB = gmemlib
2277   LIBRARY_VERSION := $(LIB_VERSION)
2278   soext = .dylib
2279   GCC_LINK_FLAGS=
2280 endif
2281
2282 # ARM Nucleus
2283 ifeq ($(strip $(filter-out arm nucleus%,$(arch) $(osys))),)
2284   LIBGNAT_TARGET_PAIRS = \
2285   system.ads<system-nucleus-arm.ads \
2286   a-numaux.ads<a-numaux-vxworks.ads \
2287   a-intnam.ads<a-intnam-nucleus.ads \
2288   s-inmaop.adb<s-inmaop-posix.adb \
2289   s-intman.adb<s-intman-posix.adb \
2290   s-osinte.ads<s-osinte-nucleus.ads \
2291   s-osinte.adb<s-osinte-nucleus.adb \
2292   s-osprim.adb<s-osprim-nucleus.adb \
2293   s-parame.adb<s-parame-vxworks.adb \
2294   s-taprop.adb<s-taprop-posix.adb \
2295   s-taspri.ads<s-taspri-posix.ads \
2296   s-tpopsp.adb<s-tpopsp-posix.adb \
2297   $(DUMMY_SOCKETS_TARGET_PAIRS)
2298
2299   LIBRARY_VERSION := $(LIB_VERSION)
2300   GNATRTL_SOCKETS_OBJS =
2301 endif
2302
2303 ifneq ($(EH_MECHANISM),)
2304   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
2305   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
2306 endif
2307
2308 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
2309 # explicitly already. The base files (a-except.ad?) are used only for building
2310 # the compiler and other basic tools.
2311 # These base versions lack Ada 2005 additions which would cause bootstrap
2312 # problems if included in the compiler and other basic tools.
2313
2314 ifeq ($(filter a-except%,$(LIBGNAT_TARGET_PAIRS)),)
2315   LIBGNAT_TARGET_PAIRS += \
2316     a-except.ads<a-except-2005.ads \
2317     a-except.adb<a-except-2005.adb
2318 endif
2319
2320 # LIBGNAT_SRCS is the list of all C files (including headers) of the runtime
2321 # library.  LIBGNAT_OBJS is the list of object files for libgnat.
2322 # thread.c is special as put into GNATRTL_TASKING_OBJS by Makefile.rtl
2323 LIBGNAT_OBJS = adadecode.o adaint.o argv.o aux-io.o                     \
2324   cal.o cio.o cstreams.o ctrl_c.o                                       \
2325   env.o errno.o exit.o expect.o final.o                                 \
2326   init.o initialize.o locales.o mkdir.o                                 \
2327   raise.o seh_init.o socket.o sysdep.o                                  \
2328   targext.o terminals.o tracebak.o                                      \
2329   $(EXTRA_LIBGNAT_OBJS)
2330
2331 # NOTE ??? - when the -I option for compiling Ada code is made to work,
2332 #  the library installation will change and there will be a
2333 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
2334 #  from ADA_INCLUDE_SRCS.
2335
2336 LIBGNAT_SRCS = $(patsubst %.o,%.c,$(LIBGNAT_OBJS))                      \
2337   adadecode.h adaint.h env.h gsocket.h raise.h                          \
2338   tb-gcc.c thread.c $(EXTRA_LIBGNAT_SRCS)
2339
2340 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
2341 # the following include file:
2342
2343 include $(fsrcdir)/ada/Makefile.rtl
2344
2345 # memtrack.o is special as not put into libgnat.
2346 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
2347   memtrack.o
2348
2349 # Run time source files
2350 ADA_INCLUDE_SRCS =\
2351  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
2352  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
2353  sequenio.ads system.ads memtrack.adb \
2354  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
2355  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
2356
2357 # Files that are in ADA_INCLUDE_SRCS but not in all configurations.
2358 # They will be removed from the run time if not used.
2359 ADA_EXCLUDE_SRCS =\
2360   s-bb.ads \
2361   s-bbbosu.ads s-bbcaco.ads s-bbcppr.ads s-bbexti.adb s-bbexti.ads \
2362   s-bbinte.adb s-bbinte.ads s-bbprot.adb s-bbprot.ads s-bbsle3.ads \
2363   s-bbsuer.ads s-bbsule.ads s-bbthqu.adb s-bbthqu.ads s-bbthre.adb \
2364   s-bbthre.ads s-bbtiev.adb s-bbtiev.ads s-bbtime.adb s-bbtime.ads \
2365   s-bcprmu.adb s-bcprmu.ads s-btstch.adb s-btstch.ads \
2366   s-po32gl.adb s-po32gl.ads \
2367   s-stache.adb s-stache.ads \
2368   s-thread.ads \
2369   s-vxwexc.adb s-vxwexc.ads s-vxwext.adb s-vxwext.ads \
2370   s-win32.ads  s-winext.ads \
2371   g-regist.adb g-regist.ads g-sse.ads    g-ssvety.ads \
2372   i-vxwoio.adb i-vxwoio.ads i-vxwork.ads \
2373   g-allein.ads g-alleve.ads g-altcon.ads g-alveop.adb g-alvety.ads \
2374   g-alleve.adb g-altcon.adb g-altive.ads g-alveop.ads g-alvevi.ads
2375
2376 # ADA_EXCLUDE_SRCS without the sources used by the target
2377 ADA_EXCLUDE_FILES=$(filter-out \
2378   $(patsubst %$(objext),%.ads,$(GNATRTL_OBJS)) \
2379   $(patsubst %$(objext),%.adb,$(GNATRTL_OBJS)), \
2380   $(ADA_EXCLUDE_SRCS))
2381
2382 LIBGNAT=../$(RTSDIR)/libgnat.a
2383
2384 TOOLS_FLAGS_TO_PASS=            \
2385         "CC=$(CC)"              \
2386         "CFLAGS=$(CFLAGS)"      \
2387         "LDFLAGS=$(LDFLAGS)"    \
2388         "ADAFLAGS=$(ADAFLAGS)"  \
2389         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
2390         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
2391         "libsubdir=$(libsubdir)"        \
2392         "exeext=$(exeext)"      \
2393         "fsrcdir=$(fsrcdir)"    \
2394         "srcdir=$(fsrcdir)"     \
2395         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
2396         "GNATMAKE=$(GNATMAKE)"  \
2397         "GNATLINK=$(GNATLINK)"  \
2398         "GNATBIND=$(GNATBIND)"
2399
2400 GCC_LINK=$(CC) $(GCC_LINK_FLAGS) $(ADA_INCLUDES)
2401
2402 # Build directory for the tools. Let's copy the target-dependent
2403 # sources using the same mechanism as for gnatlib. The other sources are
2404 # accessed using the vpath directive below
2405 # Note: dummy target, stamp-tools is mainly handled by gnattools.
2406
2407 ../stamp-tools:
2408         touch ../stamp-tools
2409
2410 # when compiling the tools, the runtime has to be first on the path so that
2411 # it hides the runtime files lying with the rest of the sources
2412 ifeq ($(TOOLSCASE),native)
2413   vpath %.ads ../$(RTSDIR) ../
2414   vpath %.adb ../$(RTSDIR) ../
2415   vpath %.c   ../$(RTSDIR) ../
2416   vpath %.h   ../$(RTSDIR) ../
2417 endif
2418
2419 # in the cross tools case, everything is compiled with the native
2420 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
2421 ifeq ($(TOOLSCASE),cross)
2422   vpath %.ads ../
2423   vpath %.adb ../
2424   vpath %.c   ../
2425   vpath %.h   ../
2426 endif
2427
2428 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
2429 # reasons: gnatmake should be built with a recent compiler, a recent compiler
2430 # may not generate ALI files compatible with an old gnatmake so it is important
2431 # to be able to build gnatmake without a version of gnatmake around. Once
2432 # everything has been compiled once, gnatmake can be recompiled with itself
2433 # (see target gnattools1-re)
2434 gnattools1: ../stamp-tools ../stamp-gnatlib-$(RTSDIR)
2435         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2436           TOOLSCASE=native \
2437           ../../gnatmake$(exeext) ../../gnatlink$(exeext)
2438
2439 # gnatmake/link can be built with recent gnatmake/link if they are available.
2440 # This is especially convenient for building cross tools or for rebuilding
2441 # the tools when the original bootstrap has already be done.
2442 gnattools1-re: ../stamp-tools
2443         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2444           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
2445
2446 # these tools are built with gnatmake & are common to native and cross
2447 gnattools2: ../stamp-tools
2448         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2449           TOOLSCASE=native common-tools $(EXTRA_GNATTOOLS)
2450
2451 # those tools are only built for the cross version
2452 gnattools4: ../stamp-tools
2453 ifeq ($(ENABLE_VXADDR2LINE),true)
2454         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2455           TOOLSCASE=cross top_buildir=../../.. \
2456           ../../vxaddr2line$(exeext)
2457 endif
2458
2459 common-tools: ../stamp-tools
2460         $(GNATMAKE) -j0 -c -b $(ADA_INCLUDES) \
2461           --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
2462           gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
2463           gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
2464         $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
2465                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2466         $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
2467                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2468         $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
2469                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2470         $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
2471                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2472         $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
2473                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2474         $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
2475                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2476         $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
2477                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2478         $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
2479                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2480         $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
2481                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2482
2483 ../../gnatsym$(exeext): ../stamp-tools
2484         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
2485         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
2486         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2487
2488 ../../gnatdll$(exeext): ../stamp-tools
2489         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
2490         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
2491         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2492
2493 ../../vxaddr2line$(exeext): ../stamp-tools targext.o
2494         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
2495         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
2496         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
2497
2498 gnatmake-re: ../stamp-tools link.o targext.o
2499         $(GNATMAKE) -j0 $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
2500         $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
2501         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
2502         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
2503                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2504
2505 # Note the use of the "mv" command in order to allow gnatlink to be linked with
2506 # with the former version of gnatlink itself which cannot override itself.
2507 # gnatlink-re cannot be run at the same time as gnatmake-re, hence the
2508 # dependency
2509 gnatlink-re: ../stamp-tools link.o targext.o gnatmake-re
2510         $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
2511         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
2512         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
2513                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2514         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
2515
2516 # Needs to be built with CC=gcc
2517 # Since the RTL should be built with the latest compiler, remove the
2518 #  stamp target in the parent directory whenever gnat1 is rebuilt
2519
2520 # Likewise for the tools
2521 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
2522         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
2523                     $(TOOLS_LIBS)
2524
2525 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
2526         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
2527                     $(TOOLS_LIBS)
2528
2529 ../stamp-gnatlib-$(RTSDIR):
2530         @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
2531         then \
2532           $(ECHO) You must first build the GNAT library: make gnatlib; \
2533           false; \
2534         else \
2535           true; \
2536         fi
2537
2538 install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
2539 #       Create the directory before deleting it, in case the directory is
2540 #       a list of directories (as it may be on VMS). This ensures we are
2541 #       deleting the right one.
2542         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2543         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2544         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2545         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2546         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2547         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2548         for file in $(RTSDIR)/*.ali; do \
2549             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2550         done
2551         -cd $(RTSDIR); for file in *$(arext);do \
2552             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2553             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
2554         done
2555         -$(foreach file, $(EXTRA_ADALIB_FILES), \
2556             $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
2557         ) true
2558 #     Install the shared libraries, if any, using $(INSTALL) instead
2559 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
2560 #     for shared libraries on some targets, e.g. on HP-UX where the x
2561 #     permission is required.
2562 #     Also install the .dSYM directories if they exist (these directories
2563 #     contain the debug information for the shared libraries on darwin)
2564         for file in gnat gnarl; do \
2565            if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
2566               $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
2567                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2568            fi; \
2569            if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
2570               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
2571               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
2572            fi; \
2573            if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
2574               $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
2575                 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2576            fi; \
2577         done
2578 # This copy must be done preserving the date on the original file.
2579         for file in $(RTSDIR)/*.ad?; do \
2580             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
2581         done
2582         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
2583         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
2584
2585 ../stamp-gnatlib2-$(RTSDIR):
2586         $(RM) $(RTSDIR)/s-*.ali
2587         $(RM) $(RTSDIR)/s-*$(objext)
2588         $(RM) $(RTSDIR)/a-*.ali
2589         $(RM) $(RTSDIR)/a-*$(objext)
2590         $(RM) $(RTSDIR)/*.ali
2591         $(RM) $(RTSDIR)/*$(objext)
2592         $(RM) $(RTSDIR)/*$(arext)
2593         $(RM) $(RTSDIR)/*$(soext)
2594         touch ../stamp-gnatlib2-$(RTSDIR)
2595         $(RM) ../stamp-gnatlib-$(RTSDIR)
2596
2597 ../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
2598         $(RMDIR) $(RTSDIR)
2599         $(MKDIR) $(RTSDIR)
2600         $(CHMOD) u+w $(RTSDIR)
2601 # Copy target independent sources
2602         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
2603           $(LN_S) $(fsrcpfx)ada/$(f) $(RTSDIR) ;) true
2604 # Remove files not used
2605         $(RM) $(patsubst %,$(RTSDIR)/%,$(ADA_EXCLUDE_FILES))
2606 # Remove files to be replaced by target dependent sources
2607         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2608                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
2609         for f in $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb; do \
2610           case "$$f" in \
2611             $(RTSDIR)/s-stratt-*) ;; \
2612             *) $(RM) $$f ;; \
2613           esac; \
2614         done
2615 # Copy new target dependent sources
2616         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2617                   $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \
2618                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
2619 # Copy tsystem.h
2620         $(CP) $(srcdir)/tsystem.h $(RTSDIR)
2621         $(RM) ../stamp-gnatlib-$(RTSDIR)
2622         touch ../stamp-gnatlib1-$(RTSDIR)
2623
2624 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(subst -, ,$(host)))),)
2625 OSCONS_CPP=../../$(DECC) -E /comment=as_is -DNATIVE \
2626              -DTARGET='""$(target)""' $(fsrcpfx)ada/s-oscons-tmplt.c
2627
2628 OSCONS_EXTRACT=../../$(DECC) -DNATIVE \
2629                  -DTARGET='""$(target)""' $(fsrcpfx)ada/s-oscons-tmplt.c ; \
2630   ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \
2631   ./s-oscons-tmplt.exe > s-oscons-tmplt.s
2632
2633 else
2634 # GCC_FOR_TARGET has paths relative to the gcc directory, so we need to adjust
2635 # for running it from $(RTSDIR)
2636 OSCONS_CC=`echo "$(GCC_FOR_TARGET)" \
2637   | sed -e 's^\./xgcc^../../xgcc^' -e 's^-B./^-B../../^'`
2638 OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \
2639   -DTARGET=\"$(target)\" $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i
2640 OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS) -S s-oscons-tmplt.i
2641 endif
2642
2643 ./bldtools/oscons/xoscons: xoscons.adb xutil.ads xutil.adb
2644         -$(MKDIR) ./bldtools/oscons
2645         $(RM) $(addprefix ./bldtools/oscons/,$(notdir $^))
2646         $(CP) $^ ./bldtools/oscons
2647         (cd ./bldtools/oscons ; gnatmake -q xoscons)
2648
2649 $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib1-$(RTSDIR) s-oscons-tmplt.c gsocket.h ./bldtools/oscons/xoscons
2650         $(RM) $(RTSDIR)/s-oscons-tmplt.i $(RTSDIR)/s-oscons-tmplt.s
2651         (cd $(RTSDIR) ; \
2652             $(OSCONS_CPP) ; \
2653             $(OSCONS_EXTRACT) ; \
2654             ../bldtools/oscons/xoscons s-oscons)
2655
2656 # Don't use semicolon separated shell commands that involve list expansions.
2657 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
2658 # line lengths in excess of 256 characters.
2659 # Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS)
2660 # is guaranteed to overflow the buffer.
2661
2662 gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads
2663 # C files
2664         $(MAKE) -C $(RTSDIR) \
2665                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2666                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2667                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
2668                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
2669                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2670                 srcdir=$(fsrcdir) \
2671                 -f ../Makefile $(LIBGNAT_OBJS)
2672 # Ada files
2673         $(MAKE) -C $(RTSDIR) \
2674                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2675                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2676                 ADA_INCLUDES="" \
2677                 CFLAGS="$(GNATLIBCFLAGS)" \
2678                 ADAFLAGS="$(GNATLIBFLAGS)" \
2679                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2680                 srcdir=$(fsrcdir) \
2681                 -f ../Makefile $(GNATRTL_OBJS)
2682         $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
2683         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
2684            $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
2685         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
2686         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
2687            $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
2688         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
2689         ifeq ($(GMEM_LIB),gmemlib)
2690                 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
2691                   $(RTSDIR)/memtrack.o
2692                 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
2693         endif
2694         $(CHMOD) a-wx $(RTSDIR)/*.ali
2695         touch ../stamp-gnatlib-$(RTSDIR)
2696
2697 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2698 gnatlib-shared-default:
2699         $(MAKE) $(FLAGS_TO_PASS) \
2700              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2701              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2702              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \
2703              MULTISUBDIR="$(MULTISUBDIR)" \
2704              THREAD_KIND="$(THREAD_KIND)" \
2705              gnatlib
2706         $(RM) $(RTSDIR)/libgna*$(soext)
2707         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2708                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
2709                 $(PICFLAG_FOR_TARGET) \
2710                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2711                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2712                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2713                 $(MISCLIB) -lm
2714         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2715                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
2716                 $(PICFLAG_FOR_TARGET) \
2717                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2718                 $(GNATRTL_TASKING_OBJS) \
2719                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2720                 $(THREADSLIB)
2721         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2722                 libgnat$(soext)
2723         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2724                 libgnarl$(soext)
2725
2726 gnatlib-shared-dual:
2727         $(MAKE) $(FLAGS_TO_PASS) \
2728              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2729              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2730              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2731              MULTISUBDIR="$(MULTISUBDIR)" \
2732              THREAD_KIND="$(THREAD_KIND)" \
2733              gnatlib-shared-default
2734         $(MV) $(RTSDIR)/libgna*$(soext) .
2735         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2736         $(MAKE) $(FLAGS_TO_PASS) \
2737              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2738              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2739              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2740              MULTISUBDIR="$(MULTISUBDIR)" \
2741              THREAD_KIND="$(THREAD_KIND)" \
2742              gnatlib
2743         $(MV) libgna*$(soext) $(RTSDIR)
2744
2745 gnatlib-shared-dual-win32:
2746         $(MAKE) $(FLAGS_TO_PASS) \
2747              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2748              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2749              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2750              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" \
2751              MULTISUBDIR="$(MULTISUBDIR)" \
2752              THREAD_KIND="$(THREAD_KIND)" \
2753              gnatlib-shared-win32
2754         $(MV) $(RTSDIR)/libgna*$(soext) .
2755         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2756         $(MAKE) $(FLAGS_TO_PASS) \
2757              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2758              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2759              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2760              MULTISUBDIR="$(MULTISUBDIR)" \
2761              THREAD_KIND="$(THREAD_KIND)" \
2762              gnatlib
2763         $(MV) libgna*$(soext) $(RTSDIR)
2764
2765 # ??? we need to add the option to support auto-import of arrays/records to
2766 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
2767 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
2768 # Windows.
2769 gnatlib-shared-win32:
2770         $(MAKE) $(FLAGS_TO_PASS) \
2771              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2772              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2773              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \
2774              MULTISUBDIR="$(MULTISUBDIR)" \
2775              THREAD_KIND="$(THREAD_KIND)" \
2776              gnatlib
2777         $(RM) $(RTSDIR)/libgna*$(soext)
2778         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2779                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
2780                 $(PICFLAG_FOR_TARGET) \
2781                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2782                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2783                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2784         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2785                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
2786                 $(PICFLAG_FOR_TARGET) \
2787                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2788                 $(GNATRTL_TASKING_OBJS) \
2789                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2790                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2791
2792 gnatlib-shared-darwin:
2793         $(MAKE) $(FLAGS_TO_PASS) \
2794              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2795              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2796              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET) -fno-common" \
2797              MULTISUBDIR="$(MULTISUBDIR)" \
2798              THREAD_KIND="$(THREAD_KIND)" \
2799              gnatlib
2800         $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
2801         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2802                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
2803                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2804                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2805                 $(SO_OPTS) \
2806                 -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2807                 $(MISCLIB)
2808         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2809                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
2810                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2811                 $(GNATRTL_TASKING_OBJS) \
2812                 $(SO_OPTS) \
2813                 -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2814                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2815         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2816                 libgnat$(soext)
2817         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2818                 libgnarl$(soext)
2819         cd $(RTSDIR); dsymutil libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2820         cd $(RTSDIR); dsymutil libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
2821
2822 gnatlib-shared-vms:
2823         $(MAKE) $(FLAGS_TO_PASS) \
2824              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2825              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2826              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2827              MULTISUBDIR="$(MULTISUBDIR)" \
2828              THREAD_KIND="$(THREAD_KIND)" \
2829              gnatlib
2830         $(RM) $(RTSDIR)/libgna*$(soext)
2831         cd $(RTSDIR) && \
2832         ../../gnatsym -s SYMVEC_$$$$.opt \
2833         $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
2834         ../../xgcc -g -B../../ -shared -shared-libgcc \
2835            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
2836            sys\$$library:trace.exe \
2837            --for-linker=/noinform \
2838            --for-linker=SYMVEC_$$$$.opt \
2839            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2840         cd $(RTSDIR) && \
2841         ../../gnatsym -s SYMVEC_$$$$.opt \
2842         $(GNATRTL_TASKING_OBJS) && \
2843         ../../xgcc -g -B../../ -shared -shared-libgcc \
2844            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2845            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2846            sys\$$library:trace.exe \
2847            --for-linker=/noinform \
2848            --for-linker=SYMVEC_$$$$.opt \
2849            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2850
2851 gnatlib-shared:
2852         $(MAKE) $(FLAGS_TO_PASS) \
2853              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2854              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2855              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2856              MULTISUBDIR="$(MULTISUBDIR)" \
2857              THREAD_KIND="$(THREAD_KIND)" \
2858              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" \
2859              $(GNATLIB_SHARED)
2860
2861 # When building a SJLJ runtime for VxWorks, in addition to forcing
2862 # ZCX_By_default to False, we need to ensure that extra linker options
2863 # are not passed to prevent the inclusion of useless objects and
2864 # potential troubles from the presence of extra symbols and references
2865 # in some configurations.  The inhibition is performed by commenting
2866 # the pragma instead of deleting the line, as the latter might result
2867 # in getting multiple blank lines, hence a style check error, as a
2868 # result.
2869 gnatlib-sjlj:
2870         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" \
2871         THREAD_KIND="$(THREAD_KIND)" ../stamp-gnatlib1-$(RTSDIR)
2872         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2873         sed -e 's/\(pragma Linker.*crtbe.*\)/--  \1/' $(RTSDIR)/s.ads > $(RTSDIR)/s2.ads
2874         $(RM) $(RTSDIR)/s.ads
2875         $(MV) $(RTSDIR)/s2.ads $(RTSDIR)/system.ads
2876         $(MAKE) $(FLAGS_TO_PASS) \
2877              EH_MECHANISM="" \
2878              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2879              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2880              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2881              FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2882              MULTISUBDIR="$(MULTISUBDIR)" \
2883              THREAD_KIND="$(THREAD_KIND)" \
2884              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" gnatlib
2885
2886 gnatlib-zcx:
2887         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" \
2888           THREAD_KIND="$(THREAD_KIND)" ../stamp-gnatlib1-$(RTSDIR)
2889         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2890         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2891         $(MAKE) $(FLAGS_TO_PASS) \
2892              EH_MECHANISM="-gcc" \
2893              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2894              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2895              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2896              FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2897              MULTISUBDIR="$(MULTISUBDIR)" \
2898              THREAD_KIND="$(THREAD_KIND)" \
2899              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" gnatlib
2900
2901 # Compiling object files from source files.
2902
2903 # Note that dependencies on obstack.h are not written
2904 # because that file is not part of GCC.
2905 # Dependencies on gvarargs.h are not written
2906 # because all that file does, when not compiling with GCC,
2907 # is include the system varargs.h.
2908
2909 b_gnatl.adb : $(GNATLINK_OBJS)
2910         $(GNATBIND) $(ADA_INCLUDES) -o b_gnatl.adb gnatlink.ali
2911
2912 b_gnatl.o : b_gnatl.adb
2913         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) -gnatws -gnatyN \
2914             $< $(OUTPUT_OPTION)
2915
2916 b_gnatm.adb : $(GNATMAKE_OBJS)
2917         $(GNATBIND) $(ADA_INCLUDES) -o b_gnatm.adb gnatmake.ali
2918
2919 b_gnatm.o : b_gnatm.adb
2920         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) -gnatws -gnatyN \
2921             $< $(OUTPUT_OPTION)
2922
2923 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2924 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2925
2926 # Special flags
2927
2928 # force no sibling call optimization on s-traceb.o so the number of stack
2929 # frames to be skipped when computing a call chain is not modified by
2930 # optimization.
2931
2932 s-traceb.o  : s-traceb.adb s-traceb.ads
2933         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2934               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2935
2936 # force debugging information on s-tasdeb.o so that it is always
2937 # possible to set conditional breakpoints on tasks.
2938
2939 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
2940         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2941               $< $(OUTPUT_OPTION)
2942
2943 # force debugging information on s-vaflop.o so that it is always
2944 # possible to call the VAX float debug print routines.
2945 # force at least -O so that the inline assembly works.
2946
2947 s-vaflop.o  : s-vaflop.adb s-vaflop.ads
2948         $(CC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
2949               $< $(OUTPUT_OPTION)
2950
2951 # force no function reordering on a-except.o because of the exclusion bounds
2952 # mechanism (see the source file for more detailed information).
2953 # force debugging information on a-except.o so that it is always
2954 # possible to set conditional breakpoints on exceptions.
2955 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
2956
2957 a-except.o  : a-except.adb a-except.ads
2958         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
2959               $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2960
2961 # compile s-excdeb.o without optimization and with debug info to let the
2962 # debugger set breakpoints and inspect subprogram parameters on exception
2963 # related events.
2964
2965 s-excdeb.o  : s-excdeb.adb s-excdeb.ads s-except.ads
2966         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2967               $< $(OUTPUT_OPTION)
2968
2969 # force debugging information on s-assert.o so that it is always
2970 # possible to set breakpoint on assert failures.
2971
2972 s-assert.o  : s-assert.adb s-assert.ads
2973         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
2974               $< $(OUTPUT_OPTION)
2975
2976 # force debugging information on a-tags.o so that the debugger can find
2977 # the description of Ada.Tags.Type_Specific_Data.
2978
2979 a-tags.o  : a-tags.adb a-tags.ads
2980         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
2981               $< $(OUTPUT_OPTION)
2982
2983 # need to keep the frame pointer in this file to pop the stack properly on
2984 # some targets.
2985 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
2986         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
2987               $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2988
2989 adadecode.o : adadecode.c adadecode.h
2990 aux-io.o  : aux-io.c
2991 argv.o    : argv.c
2992 cal.o     : cal.c
2993 deftarg.o : deftarg.c
2994 errno.o   : errno.c
2995 exit.o    : adaint.h exit.c
2996 expect.o  : expect.c
2997 final.o   : final.c
2998 locales.o : locales.c
2999 mkdir.o   : mkdir.c
3000 socket.o  : socket.c gsocket.h
3001 sysdep.o  : sysdep.c
3002 raise.o   : raise.c raise.h
3003 sigtramp-ppcvxw.o : sigtramp-ppcvxw.c sigtramp.h
3004 terminals.o : terminals.c
3005 vx_stack_info.o : vx_stack_info.c
3006
3007 raise-gcc.o : raise-gcc.c raise.h
3008         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
3009                 -iquote $(srcdir) -iquote $(srcdir)/../libgcc \
3010                 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
3011
3012 cio.o     : cio.c
3013         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
3014                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
3015
3016 init.o    : init.c adaint.h raise.h
3017         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
3018                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
3019
3020 initialize.o : initialize.c raise.h
3021         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
3022                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
3023
3024 link.o : link.c
3025         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
3026                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
3027                 $< $(OUTPUT_OPTION)
3028
3029 targext.o : targext.c
3030         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
3031                 -iquote $(srcdir) \
3032                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
3033                 $< $(OUTPUT_OPTION)
3034
3035 # In GNU Make, ignore whether `stage*' exists.
3036 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
3037 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
3038
3039 force: