OSDN Git Service

ada:
[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   LIBGNAT_TARGET_PAIRS = \
2140     a-intnam.ads<a-intnam-darwin.ads \
2141     i-forbla.adb<i-forbla-darwin.adb \
2142     s-inmaop.adb<s-inmaop-posix.adb \
2143     s-osinte.adb<s-osinte-darwin.adb \
2144     s-osinte.ads<s-osinte-darwin.ads \
2145     s-taprop.adb<s-taprop-posix.adb \
2146     s-taspri.ads<s-taspri-posix.ads \
2147     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2148     g-trasym.ads<g-trasym-unimplemented.ads \
2149     g-trasym.adb<g-trasym-unimplemented.adb
2150   
2151   ifeq ($(strip $(filter-out %86,$(arch))),)
2152     LIBGNAT_TARGET_PAIRS += \
2153       s-intman.adb<s-intman-susv3.adb \
2154       s-osprim.adb<s-osprim-darwin.adb \
2155       $(ATOMICS_TARGET_PAIRS)
2156
2157     ifeq ($(strip $(MULTISUBDIR)),/x86_64)
2158       LIBGNAT_TARGET_PAIRS += \
2159         $(X86_64_TARGET_PAIRS) \
2160         system.ads<system-darwin-x86_64.ads
2161       SO_OPTS += -m64
2162     else
2163       LIBGNAT_TARGET_PAIRS += \
2164         $(X86_TARGET_PAIRS) \
2165         system.ads<system-darwin-x86.ads
2166     endif
2167   endif
2168
2169   ifeq ($(strip $(filter-out %x86_64,$(arch))),)
2170     LIBGNAT_TARGET_PAIRS += \
2171       s-intman.adb<s-intman-susv3.adb \
2172       s-osprim.adb<s-osprim-darwin.adb \
2173       $(ATOMICS_TARGET_PAIRS)
2174
2175     ifeq ($(strip $(MULTISUBDIR)),/i386)
2176       LIBGNAT_TARGET_PAIRS += \
2177         $(X86_TARGET_PAIRS) \
2178         system.ads<system-darwin-x86.ads
2179       SO_OPTS += -m32
2180     else
2181       LIBGNAT_TARGET_PAIRS += \
2182         $(X86_64_TARGET_PAIRS) \
2183         system.ads<system-darwin-x86_64.ads
2184     endif
2185   endif
2186
2187   ifeq ($(strip $(filter-out powerpc%,$(arch))),)
2188     LIBGNAT_TARGET_PAIRS += \
2189       s-intman.adb<s-intman-posix.adb \
2190       s-osprim.adb<s-osprim-posix.adb \
2191       a-numaux.ads<a-numaux-darwin.ads \
2192       a-numaux.adb<a-numaux-darwin.adb
2193     
2194     ifeq ($(strip $(MULTISUBDIR)),/ppc64)
2195       LIBGNAT_TARGET_PAIRS += \
2196         system.ads<system-darwin-ppc64.ads
2197         SO_OPTS += -m64
2198     else
2199       LIBGNAT_TARGET_PAIRS += \
2200       system.ads<system-darwin-ppc.ads
2201     endif
2202   endif
2203
2204   TOOLS_TARGET_PAIRS =  \
2205     mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb \
2206     indepsw.adb<indepsw-darwin.adb
2207
2208   EH_MECHANISM=-gcc
2209   GNATLIB_SHARED = gnatlib-shared-darwin
2210   RANLIB = ranlib -c
2211   GMEM_LIB = gmemlib
2212   LIBRARY_VERSION := $(LIB_VERSION)
2213   soext = .dylib
2214   GCC_LINK_FLAGS=
2215 endif
2216
2217 ifneq ($(EH_MECHANISM),)
2218   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
2219   EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
2220   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
2221 endif
2222
2223 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
2224 # explicitly already. The base files (a-except.ad?) are used only for building
2225 # the compiler and other basic tools.
2226 # These base versions lack Ada 2005 additions which would cause bootstrap
2227 # problems if included in the compiler and other basic tools.
2228
2229 ifeq ($(filter a-except%,$(LIBGNAT_TARGET_PAIRS)),)
2230   LIBGNAT_TARGET_PAIRS += \
2231     a-except.ads<a-except-2005.ads \
2232     a-except.adb<a-except-2005.adb
2233 endif
2234
2235 # The runtime library for gnat comprises two directories.  One contains the
2236 # Ada source files that the compiler (gnat1) needs -- these files are listed
2237 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
2238 # corresponding .ali files for the parts written in Ada, libgnat.a for
2239 # the parts of the runtime written in C, and libgthreads.a for the pthreads
2240 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
2241 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
2242 # go into the directory.  The pthreads emulation is built in the threads
2243 # subdirectory and copied.
2244 LIBGNAT_SRCS = adadecode.c adadecode.h adaint.c adaint.h        \
2245   argv.c cio.c cstreams.c errno.c exit.c cal.c ctrl_c.c env.c env.h     \
2246   arit64.c raise.h raise.c sysdep.c aux-io.c init.c initialize.c        \
2247   locales.c seh_init.c final.c tracebak.c tb-alvms.c tb-alvxw.c         \
2248   tb-gcc.c expect.c mkdir.c socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
2249
2250 LIBGNAT_OBJS = adadecode.o adaint.o argv.o cio.o cstreams.o ctrl_c.o    \
2251   errno.o exit.o env.o raise.o sysdep.o aux-io.o init.o initialize.o    \
2252   locales.o seh_init.o cal.o arit64.o final.o tracebak.o expect.o       \
2253   mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
2254
2255 # NOTE ??? - when the -I option for compiling Ada code is made to work,
2256 #  the library installation will change and there will be a
2257 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
2258 #  from ADA_INCLUDE_SRCS.
2259
2260 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
2261 # the following include file:
2262
2263 include $(fsrcdir)/ada/Makefile.rtl
2264
2265 GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o \
2266   a-nucoar.o i-forbla.o i-forlap.o s-gearop.o
2267
2268 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
2269   $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
2270
2271 # Default run time files
2272
2273 ADA_INCLUDE_SRCS =\
2274  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
2275  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
2276  sequenio.ads system.ads memtrack.adb \
2277  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
2278  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
2279
2280 LIBGNAT=../$(RTSDIR)/libgnat.a
2281
2282 TOOLS_FLAGS_TO_PASS=            \
2283         "CC=$(CC)"              \
2284         "CFLAGS=$(CFLAGS)"      \
2285         "LDFLAGS=$(LDFLAGS)"    \
2286         "ADAFLAGS=$(ADAFLAGS)"  \
2287         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
2288         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
2289         "libsubdir=$(libsubdir)"        \
2290         "exeext=$(exeext)"      \
2291         "fsrcdir=$(fsrcdir)"    \
2292         "srcdir=$(fsrcdir)"     \
2293         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
2294         "GNATMAKE=$(GNATMAKE)"  \
2295         "GNATLINK=$(GNATLINK)"  \
2296         "GNATBIND=$(GNATBIND)"
2297
2298 GCC_LINK=$(CC) $(GCC_LINK_FLAGS) $(ADA_INCLUDES)
2299
2300 # Build directory for the tools. Let's copy the target-dependent
2301 # sources using the same mechanism as for gnatlib. The other sources are
2302 # accessed using the vpath directive below
2303 # Note: dummy target, stamp-tools is mainly handled by gnattools.
2304
2305 ../stamp-tools:
2306         touch ../stamp-tools
2307
2308 # when compiling the tools, the runtime has to be first on the path so that
2309 # it hides the runtime files lying with the rest of the sources
2310 ifeq ($(TOOLSCASE),native)
2311   vpath %.ads ../$(RTSDIR) ../
2312   vpath %.adb ../$(RTSDIR) ../
2313   vpath %.c   ../$(RTSDIR) ../
2314   vpath %.h   ../$(RTSDIR) ../
2315 endif
2316
2317 # in the cross tools case, everything is compiled with the native
2318 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
2319 ifeq ($(TOOLSCASE),cross)
2320   vpath %.ads ../
2321   vpath %.adb ../
2322   vpath %.c   ../
2323   vpath %.h   ../
2324 endif
2325
2326 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
2327 # reasons: gnatmake should be built with a recent compiler, a recent compiler
2328 # may not generate ALI files compatible with an old gnatmake so it is important
2329 # to be able to build gnatmake without a version of gnatmake around. Once
2330 # everything has been compiled once, gnatmake can be recompiled with itself
2331 # (see target gnattools1-re)
2332 gnattools1: ../stamp-tools ../stamp-gnatlib-$(RTSDIR)
2333         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2334           TOOLSCASE=native \
2335           ../../gnatmake$(exeext) ../../gnatlink$(exeext)
2336
2337 # gnatmake/link can be built with recent gnatmake/link if they are available.
2338 # This is especially convenient for building cross tools or for rebuilding
2339 # the tools when the original bootstrap has already be done.
2340 gnattools1-re: ../stamp-tools
2341         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2342           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
2343
2344 # these tools are built with gnatmake & are common to native and cross
2345 gnattools2: ../stamp-tools
2346         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2347           TOOLSCASE=native common-tools $(EXTRA_GNATTOOLS)
2348
2349 # those tools are only built for the cross version
2350 gnattools4: ../stamp-tools
2351 ifeq ($(ENABLE_VXADDR2LINE),true)
2352         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
2353           TOOLSCASE=cross top_buildir=../../.. \
2354           ../../vxaddr2line$(exeext)
2355 endif
2356
2357 common-tools: ../stamp-tools
2358         $(GNATMAKE) -j0 -c -b $(ADA_INCLUDES) \
2359           --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
2360           gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
2361           gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
2362         $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
2363                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2364         $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
2365                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2366         $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
2367                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2368         $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
2369                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2370         $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
2371                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2372         $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
2373                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2374         $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
2375                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2376         $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
2377                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2378         $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
2379                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2380
2381 ../../gnatsym$(exeext): ../stamp-tools
2382         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
2383         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
2384         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2385
2386 ../../gnatdll$(exeext): ../stamp-tools
2387         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
2388         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
2389         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2390
2391 ../../vxaddr2line$(exeext): ../stamp-tools targext.o
2392         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
2393         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
2394         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
2395
2396 gnatmake-re: ../stamp-tools link.o targext.o
2397         $(GNATMAKE) -j0 $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
2398         $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
2399         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
2400         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
2401                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2402
2403 # Note the use of the "mv" command in order to allow gnatlink to be linked with
2404 # with the former version of gnatlink itself which cannot override itself.
2405 # gnatlink-re cannot be run at the same time as gnatmake-re, hence the
2406 # dependency
2407 gnatlink-re: ../stamp-tools link.o targext.o gnatmake-re
2408         $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
2409         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
2410         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
2411                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2412         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
2413
2414 # Needs to be built with CC=gcc
2415 # Since the RTL should be built with the latest compiler, remove the
2416 #  stamp target in the parent directory whenever gnat1 is rebuilt
2417
2418 # Likewise for the tools
2419 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
2420         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
2421                     $(TOOLS_LIBS)
2422
2423 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
2424         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
2425                     $(TOOLS_LIBS)
2426
2427 ../stamp-gnatlib-$(RTSDIR):
2428         @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
2429         then \
2430           $(ECHO) You must first build the GNAT library: make gnatlib; \
2431           false; \
2432         else \
2433           true; \
2434         fi
2435
2436 install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
2437 #       Create the directory before deleting it, in case the directory is
2438 #       a list of directories (as it may be on VMS). This ensures we are
2439 #       deleting the right one.
2440         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2441         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2442         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2443         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2444         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2445         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2446         for file in $(RTSDIR)/*.ali; do \
2447             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2448         done
2449         -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2450         -cd $(RTSDIR); for file in *$(arext);do \
2451             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2452             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
2453         done
2454         -$(foreach file, $(EXTRA_ADALIB_FILES), \
2455             $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
2456         ) true
2457 #     Install the shared libraries, if any, using $(INSTALL) instead
2458 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
2459 #     for shared libraries on some targets, e.g. on HP-UX where the x
2460 #     permission is required.
2461 #     Also install the .dSYM directories if they exist (these directories
2462 #     contain the debug information for the shared libraries on darwin)
2463         for file in gnat gnarl; do \
2464            if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
2465               $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
2466                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2467            fi; \
2468            if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
2469               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
2470               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
2471            fi; \
2472            if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
2473               $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
2474                 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2475            fi; \
2476         done
2477 # This copy must be done preserving the date on the original file.
2478         for file in $(RTSDIR)/*.ad?; do \
2479             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
2480         done
2481         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
2482         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
2483
2484 ../stamp-gnatlib2-$(RTSDIR):
2485         $(RM) $(RTSDIR)/s-*.ali
2486         $(RM) $(RTSDIR)/s-*$(objext)
2487         $(RM) $(RTSDIR)/a-*.ali
2488         $(RM) $(RTSDIR)/a-*$(objext)
2489         $(RM) $(RTSDIR)/*.ali
2490         $(RM) $(RTSDIR)/*$(objext)
2491         $(RM) $(RTSDIR)/*$(arext)
2492         $(RM) $(RTSDIR)/*$(soext)
2493         touch ../stamp-gnatlib2-$(RTSDIR)
2494         $(RM) ../stamp-gnatlib-$(RTSDIR)
2495
2496 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
2497 #       successive target commands. Although the Gnu make documentation
2498 #       implies this is true on all systems, I suspect it may not be, So care
2499 #       has been taken to allow a sed script to look for ";)" and substitue
2500 #       for ";" the appropriate character in the range of lines below
2501 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
2502
2503 # GNULLI Begin ###########################################################
2504
2505 ../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
2506         $(RMDIR) $(RTSDIR)
2507         $(MKDIR) $(RTSDIR)
2508         $(CHMOD) u+w $(RTSDIR)
2509 # Copy target independent sources
2510         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
2511           $(LN_S) $(fsrcpfx)ada/$(f) $(RTSDIR) ;) true
2512 # Remove files to be replaced by target dependent sources
2513         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2514                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
2515         for f in $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb; do \
2516           case "$$f" in \
2517             $(RTSDIR)/s-stratt-*) ;; \
2518             *) $(RM) $$f ;; \
2519           esac; \
2520         done
2521 # Copy new target dependent sources
2522         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2523                   $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \
2524                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
2525 # Copy tsystem.h
2526         $(CP) $(srcdir)/tsystem.h $(RTSDIR)
2527 # Copy generated target dependent sources
2528         $(RM) $(RTSDIR)/s-oscons.ads
2529         (cd $(RTSDIR); $(LN_S) ../s-oscons.ads s-oscons.ads)
2530         $(RM) ../stamp-gnatlib-$(RTSDIR)
2531         touch ../stamp-gnatlib1-$(RTSDIR)
2532
2533 # GNULLI End #############################################################
2534
2535 # Don't use semicolon separated shell commands that involve list expansions.
2536 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
2537 # line lengths in excess of 256 characters.
2538 # Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS)
2539 # is guaranteed to overflow the buffer.
2540
2541 gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
2542         $(MAKE) -C $(RTSDIR) \
2543                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2544                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2545                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
2546                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
2547                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2548                 srcdir=$(fsrcdir) \
2549                 -f ../Makefile $(LIBGNAT_OBJS)
2550         $(MAKE) -C $(RTSDIR) \
2551                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2552                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2553                 ADA_INCLUDES="" \
2554                 CFLAGS="$(GNATLIBCFLAGS)" \
2555                 ADAFLAGS="$(GNATLIBFLAGS)" \
2556                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2557                 srcdir=$(fsrcdir) \
2558                 -f ../Makefile \
2559                 $(GNATRTL_OBJS)
2560         $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
2561         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
2562            $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
2563         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
2564         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
2565            $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
2566         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
2567         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnala$(arext) \
2568            $(addprefix $(RTSDIR)/,$(GNATRTL_LINEARALGEBRA_OBJS))
2569         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnala$(arext)
2570         ifeq ($(GMEM_LIB),gmemlib)
2571                 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
2572                   $(RTSDIR)/memtrack.o
2573                 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
2574         endif
2575         $(CHMOD) a-wx $(RTSDIR)/*.ali
2576         touch ../stamp-gnatlib-$(RTSDIR)
2577
2578 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2579 gnatlib-shared-default:
2580         $(MAKE) $(FLAGS_TO_PASS) \
2581              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2582              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2583              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2584              MULTISUBDIR="$(MULTISUBDIR)" \
2585              THREAD_KIND="$(THREAD_KIND)" \
2586              gnatlib
2587         $(RM) $(RTSDIR)/libgna*$(soext)
2588         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2589                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
2590                 $(PICFLAG_FOR_TARGET) \
2591                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2592                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2593                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2594                 $(MISCLIB) -lm
2595         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2596                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
2597                 $(PICFLAG_FOR_TARGET) \
2598                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2599                 $(GNATRTL_TASKING_OBJS) \
2600                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2601                 $(THREADSLIB)
2602         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2603                 libgnat$(soext)
2604         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2605                 libgnarl$(soext)
2606
2607 gnatlib-shared-dual:
2608         $(MAKE) $(FLAGS_TO_PASS) \
2609              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2610              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2611              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2612              MULTISUBDIR="$(MULTISUBDIR)" \
2613              THREAD_KIND="$(THREAD_KIND)" \
2614              gnatlib-shared-default
2615         $(MV) $(RTSDIR)/libgna*$(soext) .
2616         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2617         $(MAKE) $(FLAGS_TO_PASS) \
2618              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2619              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2620              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2621              MULTISUBDIR="$(MULTISUBDIR)" \
2622              THREAD_KIND="$(THREAD_KIND)" \
2623              gnatlib
2624         $(MV) libgna*$(soext) $(RTSDIR)
2625
2626 gnatlib-shared-dual-win32:
2627         $(MAKE) $(FLAGS_TO_PASS) \
2628              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2629              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2630              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2631              MULTISUBDIR="$(MULTISUBDIR)" \
2632              THREAD_KIND="$(THREAD_KIND)" \
2633              gnatlib-shared-win32
2634         $(MV) $(RTSDIR)/libgna*$(soext) .
2635         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2636         $(MAKE) $(FLAGS_TO_PASS) \
2637              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2638              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2639              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2640              MULTISUBDIR="$(MULTISUBDIR)" \
2641              THREAD_KIND="$(THREAD_KIND)" \
2642              gnatlib
2643         $(MV) libgna*$(soext) $(RTSDIR)
2644
2645 # ??? we need to add the option to support auto-import of arrays/records to
2646 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
2647 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
2648 # Windows.
2649 gnatlib-shared-win32:
2650         $(MAKE) $(FLAGS_TO_PASS) \
2651              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2652              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2653              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2654              MULTISUBDIR="$(MULTISUBDIR)" \
2655              THREAD_KIND="$(THREAD_KIND)" \
2656              gnatlib
2657         $(RM) $(RTSDIR)/libgna*$(soext)
2658         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2659                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
2660                 $(PICFLAG_FOR_TARGET) \
2661                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2662                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2663                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2664         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2665                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
2666                 $(PICFLAG_FOR_TARGET) \
2667                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2668                 $(GNATRTL_TASKING_OBJS) \
2669                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2670                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2671
2672 gnatlib-shared-darwin:
2673         $(MAKE) $(FLAGS_TO_PASS) \
2674              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2675              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
2676              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) -fno-common" \
2677              MULTISUBDIR="$(MULTISUBDIR)" \
2678              THREAD_KIND="$(THREAD_KIND)" \
2679              gnatlib
2680         $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
2681         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2682                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
2683                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2684                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2685                 $(SO_OPTS) \
2686                 -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2687                 $(MISCLIB)
2688         cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
2689                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
2690                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2691                 $(GNATRTL_TASKING_OBJS) \
2692                 $(SO_OPTS) \
2693                 -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2694                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2695         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2696                 libgnat$(soext)
2697         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2698                 libgnarl$(soext)
2699         cd $(RTSDIR); dsymutil libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2700         cd $(RTSDIR); dsymutil libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
2701
2702 gnatlib-shared-vms:
2703         $(MAKE) $(FLAGS_TO_PASS) \
2704              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2705              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2706              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2707              MULTISUBDIR="$(MULTISUBDIR)" \
2708              THREAD_KIND="$(THREAD_KIND)" \
2709              gnatlib
2710         $(RM) $(RTSDIR)/libgna*$(soext)
2711         cd $(RTSDIR) && \
2712         ../../gnatsym -s SYMVEC_$$$$.opt \
2713         $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
2714         ../../xgcc -g -B../../ -shared -shared-libgcc \
2715            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
2716            sys\$$library:trace.exe \
2717            --for-linker=/noinform \
2718            --for-linker=SYMVEC_$$$$.opt \
2719            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2720         cd $(RTSDIR) && \
2721         ../../gnatsym -s SYMVEC_$$$$.opt \
2722         $(GNATRTL_TASKING_OBJS) && \
2723         ../../xgcc -g -B../../ -shared -shared-libgcc \
2724            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2725            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2726            sys\$$library:trace.exe \
2727            --for-linker=/noinform \
2728            --for-linker=SYMVEC_$$$$.opt \
2729            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2730
2731 gnatlib-shared:
2732         $(MAKE) $(FLAGS_TO_PASS) \
2733              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2734              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2735              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2736              MULTISUBDIR="$(MULTISUBDIR)" \
2737              THREAD_KIND="$(THREAD_KIND)" \
2738              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" \
2739              $(GNATLIB_SHARED)
2740
2741 gnatlib-sjlj:
2742         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" \
2743         THREAD_KIND="$(THREAD_KIND)" ../stamp-gnatlib1-$(RTSDIR)
2744         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2745         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2746         $(MAKE) $(FLAGS_TO_PASS) \
2747              EH_MECHANISM="" \
2748              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2749              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2750              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2751              MULTISUBDIR="$(MULTISUBDIR)" \
2752              THREAD_KIND="$(THREAD_KIND)" \
2753              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" gnatlib
2754
2755 gnatlib-zcx:
2756         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" \
2757           THREAD_KIND="$(THREAD_KIND)" ../stamp-gnatlib1-$(RTSDIR)
2758         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2759         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2760         $(MAKE) $(FLAGS_TO_PASS) \
2761              EH_MECHANISM="-gcc" \
2762              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2763              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2764              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2765              MULTISUBDIR="$(MULTISUBDIR)" \
2766              THREAD_KIND="$(THREAD_KIND)" \
2767              PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" gnatlib
2768
2769 # .s files for cross-building
2770 gnat-cross: force
2771         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2772
2773 # Compiling object files from source files.
2774
2775 # Note that dependencies on obstack.h are not written
2776 # because that file is not part of GCC.
2777 # Dependencies on gvarargs.h are not written
2778 # because all that file does, when not compiling with GCC,
2779 # is include the system varargs.h.
2780
2781 b_gnatl.adb : $(GNATLINK_OBJS)
2782         $(GNATBIND) $(ADA_INCLUDES) -o b_gnatl.adb gnatlink.ali
2783
2784 b_gnatl.o : b_gnatl.adb
2785         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) -gnatws -gnatyN \
2786             $< $(OUTPUT_OPTION)
2787
2788 b_gnatm.adb : $(GNATMAKE_OBJS)
2789         $(GNATBIND) $(ADA_INCLUDES) -o b_gnatm.adb gnatmake.ali
2790
2791 b_gnatm.o : b_gnatm.adb
2792         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) -gnatws -gnatyN \
2793             $< $(OUTPUT_OPTION)
2794
2795 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2796 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2797
2798 # Special flags
2799
2800 # force no sibling call optimization on s-traceb.o so the number of stack
2801 # frames to be skipped when computing a call chain is not modified by
2802 # optimization.
2803
2804 s-traceb.o  : s-traceb.adb s-traceb.ads
2805         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2806               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2807
2808 # force debugging information on s-tasdeb.o so that it is always
2809 # possible to set conditional breakpoints on tasks.
2810
2811 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
2812         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2813               $< $(OUTPUT_OPTION)
2814
2815 # force debugging information on s-vaflop.o so that it is always
2816 # possible to call the VAX float debug print routines.
2817 # force at least -O so that the inline assembly works.
2818
2819 s-vaflop.o  : s-vaflop.adb s-vaflop.ads
2820         $(CC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
2821               $< $(OUTPUT_OPTION)
2822
2823 # force no function reordering on a-except.o because of the exclusion bounds
2824 # mechanism (see the source file for more detailed information).
2825 # force debugging information on a-except.o so that it is always
2826 # possible to set conditional breakpoints on exceptions.
2827 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
2828
2829 a-except.o  : a-except.adb a-except.ads
2830         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
2831               $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2832
2833 # compile s-excdeb.o without optimization and with debug info to let the
2834 # debugger set breakpoints and inspect subprogram parameters on exception
2835 # related events.
2836
2837 s-excdeb.o  : s-excdeb.adb s-excdeb.ads s-except.ads
2838         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2839               $< $(OUTPUT_OPTION)
2840
2841 # force debugging information on s-assert.o so that it is always
2842 # possible to set breakpoint on assert failures.
2843
2844 s-assert.o  : s-assert.adb s-assert.ads
2845         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
2846               $< $(OUTPUT_OPTION)
2847
2848 # force debugging information on a-tags.o so that the debugger can find
2849 # the description of Ada.Tags.Type_Specific_Data.
2850
2851 a-tags.o  : a-tags.adb a-tags.ads
2852         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) \
2853               $< $(OUTPUT_OPTION)
2854
2855 # need to keep the frame pointer in this file to pop the stack properly on
2856 # some targets.
2857 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
2858         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
2859               $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2860
2861 adadecode.o : adadecode.c adadecode.h
2862 aux-io.o  : aux-io.c
2863 argv.o    : argv.c
2864 cal.o     : cal.c
2865 deftarg.o : deftarg.c
2866 errno.o   : errno.c
2867 exit.o    : adaint.h exit.c
2868 expect.o  : expect.c
2869 final.o   : final.c
2870 locales.o : locales.c
2871 mkdir.o   : mkdir.c
2872 socket.o  : socket.c gsocket.h
2873 sysdep.o  : sysdep.c
2874 raise.o   : raise.c raise.h
2875 vx_stack_info.o : vx_stack_info.c
2876
2877 raise-gcc.o : raise-gcc.c raise.h
2878         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2879                 -iquote $(srcdir) -iquote $(srcdir)/../libgcc \
2880                 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2881
2882 cio.o     : cio.c
2883         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2884                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2885
2886 init.o    : init.c adaint.h raise.h
2887         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2888                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2889
2890 initialize.o : initialize.c raise.h
2891         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2892                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2893
2894 link.o : link.c
2895         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2896                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
2897                 $< $(OUTPUT_OPTION)
2898
2899 targext.o : targext.c
2900         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2901                 -iquote $(srcdir) \
2902                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
2903                 $< $(OUTPUT_OPTION)
2904
2905 # In GNU Make, ignore whether `stage*' exists.
2906 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2907 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2908
2909 force: