OSDN Git Service

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