OSDN Git Service

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