OSDN Git Service

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