OSDN Git Service

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