OSDN Git Service

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