OSDN Git Service

* gcc-interface/Makefile.in (darwin, SO_OPTS): Provide architecture
[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 aspects.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 scil_ll.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 LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
411
412 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
413 # $(strip STRING) removes leading and trailing spaces from STRING.
414 # If what's left is null then it's a match.
415
416 ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
417   LIBGNAT_TARGET_PAIRS = \
418   a-intnam.ads<a-intnam-vxworks.ads \
419   a-numaux.ads<a-numaux-vxworks.ads \
420   s-inmaop.adb<s-inmaop-posix.adb \
421   s-interr.adb<s-interr-hwint.adb \
422   s-intman.ads<s-intman-vxworks.ads \
423   s-intman.adb<s-intman-vxworks.adb \
424   s-osinte.adb<s-osinte-vxworks.adb \
425   s-osinte.ads<s-osinte-vxworks.ads \
426   s-osprim.adb<s-osprim-vxworks.adb \
427   s-parame.ads<s-parame-vxworks.ads \
428   s-parame.adb<s-parame-vxworks.adb \
429   s-stchop.ads<s-stchop-limit.ads \
430   s-stchop.adb<s-stchop-vxworks.adb \
431   s-taprop.adb<s-taprop-vxworks.adb \
432   s-tasinf.ads<s-tasinf-vxworks.ads \
433   s-taspri.ads<s-taspri-vxworks.ads \
434   s-tpopsp.adb<s-tpopsp-vxworks.adb \
435   s-vxwork.ads<s-vxwork-m68k.ads \
436   g-socthi.ads<g-socthi-vxworks.ads \
437   g-socthi.adb<g-socthi-vxworks.adb \
438   g-stsifd.adb<g-stsifd-sockets.adb \
439   g-trasym.ads<g-trasym-unimplemented.ads \
440   g-trasym.adb<g-trasym-unimplemented.adb \
441   system.ads<system-vxworks-m68k.ads
442
443   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
444
445   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
446   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
447
448   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
449   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
450
451   ifeq ($(strip $(filter-out yes,$(TRACE))),)
452     LIBGNAT_TARGET_PAIRS += \
453     s-traces.adb<s-traces-default.adb \
454     s-tratas.adb<s-tratas-default.adb \
455     s-trafor.adb<s-trafor-default.adb \
456     s-trafor.ads<s-trafor-default.ads \
457     s-tfsetr.adb<s-tfsetr-vxworks.adb
458   endif
459 endif
460
461 ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
462   LIBGNAT_TARGET_PAIRS = \
463   a-intnam.ads<a-intnam-vxworks.ads \
464   a-numaux.ads<a-numaux-vxworks.ads \
465   s-inmaop.adb<s-inmaop-posix.adb \
466   s-intman.ads<s-intman-vxworks.ads \
467   s-intman.adb<s-intman-vxworks.adb \
468   s-osinte.ads<s-osinte-vxworks.ads \
469   s-osinte.adb<s-osinte-vxworks.adb \
470   s-osprim.adb<s-osprim-vxworks.adb \
471   s-parame.ads<s-parame-vxworks.ads \
472   s-parame.adb<s-parame-vxworks.adb \
473   s-stchop.ads<s-stchop-limit.ads \
474   s-stchop.adb<s-stchop-vxworks.adb \
475   s-taprop.adb<s-taprop-vxworks.adb \
476   s-tasinf.ads<s-tasinf-vxworks.ads \
477   s-taspri.ads<s-taspri-vxworks.ads \
478   s-vxwork.ads<s-vxwork-ppc.ads \
479   g-socthi.ads<g-socthi-vxworks.ads \
480   g-socthi.adb<g-socthi-vxworks.adb \
481   g-stsifd.adb<g-stsifd-sockets.adb \
482   g-trasym.ads<g-trasym-unimplemented.ads \
483   g-trasym.adb<g-trasym-unimplemented.adb \
484   $(ATOMICS_TARGET_PAIRS)
485
486   TOOLS_TARGET_PAIRS=\
487   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
488   indepsw.adb<indepsw-gnu.adb
489
490   ifeq ($(strip $(filter-out yes,$(TRACE))),)
491     LIBGNAT_TARGET_PAIRS += \
492     s-traces.adb<s-traces-default.adb \
493     s-trafor.adb<s-trafor-default.adb \
494     s-trafor.ads<s-trafor-default.ads \
495     s-tratas.adb<s-tratas-default.adb \
496     s-tfsetr.adb<s-tfsetr-vxworks.adb
497   endif
498
499   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
500     LIBGNAT_TARGET_PAIRS += \
501     s-vxwext.ads<s-vxwext-rtp.ads \
502     s-vxwext.adb<s-vxwext-rtp.adb \
503     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
504     system.ads<system-vxworks-ppc-rtp.ads
505
506     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
507   else
508     ifeq ($(strip $(filter-out rtp-smp,$(THREAD_KIND))),)
509       LIBGNAT_TARGET_PAIRS += \
510       s-vxwext.ads<s-vxwext-rtp.ads \
511       s-vxwext.adb<s-vxwext-rtp-smp.adb \
512       s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
513       system.ads<system-vxworks-ppc-rtp.ads
514
515       EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
516       EXTRA_GNATRTL_TASKING_OBJS=affinity.o
517     else
518       ifeq ($(strip $(filter-out kernel-smp,$(THREAD_KIND))),)
519         LIBGNAT_TARGET_PAIRS += \
520         s-interr.adb<s-interr-hwint.adb \
521         s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
522         s-vxwext.ads<s-vxwext-kernel.ads \
523         s-vxwext.adb<s-vxwext-kernel-smp.adb \
524         system.ads<system-vxworks-ppc-kernel.ads
525
526         EXTRA_GNATRTL_TASKING_OBJS=affinity.o
527       else
528         LIBGNAT_TARGET_PAIRS += \
529         s-interr.adb<s-interr-hwint.adb \
530         s-tpopsp.adb<s-tpopsp-vxworks.adb
531
532         ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
533           LIBGNAT_TARGET_PAIRS += \
534           s-vxwext.ads<s-vxwext-kernel.ads \
535           s-vxwext.adb<s-vxwext-kernel.adb \
536           system.ads<system-vxworks-ppc-kernel.ads
537         else
538           LIBGNAT_TARGET_PAIRS += \
539           system.ads<system-vxworks-ppc.ads
540         endif
541       endif
542       EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
543     endif
544   endif
545
546   EXTRA_GNATRTL_TASKING_OBJS += s-vxwork.o s-vxwext.o
547
548   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
549   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
550 endif
551
552 # vxworks 653
553 ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
554   # target pairs for vthreads runtime
555   LIBGNAT_TARGET_PAIRS = \
556   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
557   a-intnam.ads<a-intnam-vxworks.ads \
558   a-numaux.ads<a-numaux-vxworks.ads \
559   g-io.adb<g-io-vxworks-ppc-cert.adb \
560   g-io.ads<g-io-vxworks-ppc-cert.ads \
561   s-inmaop.adb<s-inmaop-posix.adb \
562   s-interr.adb<s-interr-hwint.adb \
563   s-intman.ads<s-intman-vxworks.ads \
564   s-intman.adb<s-intman-vxworks.adb \
565   s-osinte.adb<s-osinte-vxworks.adb \
566   s-osinte.ads<s-osinte-vxworks.ads \
567   s-osprim.adb<s-osprim-vxworks.adb \
568   s-parame.ads<s-parame-ae653.ads \
569   s-parame.adb<s-parame-vxworks.adb \
570   s-taprop.adb<s-taprop-vxworks.adb \
571   s-tasinf.ads<s-tasinf-vxworks.ads \
572   s-taspri.ads<s-taspri-vxworks.ads \
573   s-tpopsp.adb<s-tpopsp-vxworks.adb \
574   s-vxwext.adb<s-vxwext-noints.adb \
575   s-vxwext.ads<s-vxwext-vthreads.ads \
576   s-vxwork.ads<s-vxwork-ppc.ads \
577   g-trasym.ads<g-trasym-unimplemented.ads \
578   g-trasym.adb<g-trasym-unimplemented.adb \
579   system.ads<system-vxworks-ppc-vthread.ads \
580   $(ATOMICS_TARGET_PAIRS)
581
582   TOOLS_TARGET_PAIRS=\
583   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
584   indepsw.adb<indepsw-gnu.adb
585
586   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
587   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
588
589   # Extra pairs for the vthreads runtime
590   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
591     LIBGNAT_TARGET_PAIRS += \
592     s-thread.adb<s-thread-ae653.adb \
593     $(DUMMY_SOCKETS_TARGET_PAIRS)
594
595     GNATRTL_SOCKETS_OBJS =
596     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
597   else
598     LIBGNAT_TARGET_PAIRS += \
599     g-socthi.ads<g-socthi-vxworks.ads \
600     g-socthi.adb<g-socthi-vxworks.adb \
601     g-stsifd.adb<g-stsifd-sockets.adb
602   endif
603
604   ifeq ($(strip $(filter-out yes,$(TRACE))),)
605     LIBGNAT_TARGET_PAIRS += \
606     s-traces.adb<s-traces-default.adb \
607     s-trafor.adb<s-trafor-default.adb \
608     s-trafor.ads<s-trafor-default.ads \
609     s-tratas.adb<s-tratas-default.adb \
610     s-tfsetr.adb<s-tfsetr-vxworks.adb
611   endif
612 endif
613
614 # vxworks MILS
615 ifeq ($(strip $(filter-out powerpc% wrs vxworksmils,$(targ))),)
616   # target pairs for vthreads runtime
617   LIBGNAT_TARGET_PAIRS = \
618   a-intnam.ads<a-intnam-vxworks.ads \
619   a-numaux.ads<a-numaux-vxworks.ads \
620   g-io.adb<g-io-vxworks-ppc-cert.adb \
621   g-io.ads<g-io-vxworks-ppc-cert.ads \
622   s-inmaop.adb<s-inmaop-posix.adb \
623   s-interr.adb<s-interr-hwint.adb \
624   s-intman.ads<s-intman-vxworks.ads \
625   s-intman.adb<s-intman-vxworks.adb \
626   s-osinte.adb<s-osinte-vxworks.adb \
627   s-osinte.ads<s-osinte-vxworks.ads \
628   s-osprim.adb<s-osprim-vxworks.adb \
629   s-parame.ads<s-parame-ae653.ads \
630   s-parame.adb<s-parame-vxworks.adb \
631   s-stchop.adb<s-stchop-vxworks.adb \
632   s-stchop.ads<s-stchop-limit.ads \
633   s-taprop.adb<s-taprop-vxworks.adb \
634   s-tasinf.ads<s-tasinf-vxworks.ads \
635   s-taspri.ads<s-taspri-vxworks.ads \
636   s-thread.adb<s-thread-ae653.adb \
637   s-tpopsp.adb<s-tpopsp-vxworks.adb \
638   s-vxwork.ads<s-vxwork-ppc.ads \
639   g-trasym.ads<g-trasym-unimplemented.ads \
640   g-trasym.adb<g-trasym-unimplemented.adb \
641   system.ads<system-vxworks-ppc.ads \
642   $(ATOMICS_TARGET_PAIRS) \
643   $(DUMMY_SOCKETS_TARGET_PAIRS)
644
645   TOOLS_TARGET_PAIRS=\
646   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
647   indepsw.adb<indepsw-gnu.adb
648
649   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-thread.o s-vxwexc.o
650   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
651
652   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
653   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
654   GNATRTL_SOCKETS_OBJS =
655
656   ifeq ($(strip $(filter-out yes,$(TRACE))),)
657     LIBGNAT_TARGET_PAIRS += \
658     s-traces.adb<s-traces-default.adb \
659     s-trafor.adb<s-trafor-default.adb \
660     s-trafor.ads<s-trafor-default.ads \
661     s-tratas.adb<s-tratas-default.adb \
662     s-tfsetr.adb<s-tfsetr-vxworks.adb
663   endif
664 endif
665
666 # vxworksae / vxworks 653 for x86 (vxsim) - ?? vxworksmils not implemented
667 ifeq ($(strip $(filter-out %86 wrs vxworksae vxworksmils,$(targ))),)
668   # target pairs for kernel + vthreads runtime
669   LIBGNAT_TARGET_PAIRS = \
670   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
671   a-intnam.ads<a-intnam-vxworks.ads \
672   a-numaux.ads<a-numaux-x86.ads \
673   a-numaux.adb<a-numaux-x86.adb \
674   a-sytaco.ads<1asytaco.ads \
675   a-sytaco.adb<1asytaco.adb \
676   g-bytswa.adb<g-bytswa-x86.adb \
677   g-io.adb<g-io-vxworks-ppc-cert.adb \
678   g-io.ads<g-io-vxworks-ppc-cert.ads \
679   s-inmaop.adb<s-inmaop-posix.adb \
680   s-interr.adb<s-interr-hwint.adb \
681   s-intman.ads<s-intman-vxworks.ads \
682   s-intman.adb<s-intman-vxworks.adb \
683   s-osinte.adb<s-osinte-vxworks.adb \
684   s-osinte.ads<s-osinte-vxworks.ads \
685   s-osprim.adb<s-osprim-vxworks.adb \
686   s-parame.ads<s-parame-ae653.ads \
687   s-taprop.adb<s-taprop-vxworks.adb \
688   s-tasinf.ads<s-tasinf-vxworks.ads \
689   s-taspri.ads<s-taspri-vxworks.ads \
690   s-tpopsp.adb<s-tpopsp-vxworks.adb \
691   s-vxwext.adb<s-vxwext-noints.adb \
692   s-vxwext.ads<s-vxwext-vthreads.ads \
693   s-vxwork.ads<s-vxwork-x86.ads \
694   g-trasym.ads<g-trasym-unimplemented.ads \
695   g-trasym.adb<g-trasym-unimplemented.adb \
696   system.ads<system-vxworks-x86.ads
697
698   TOOLS_TARGET_PAIRS=\
699   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
700   indepsw.adb<indepsw-gnu.adb
701
702   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
703   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
704
705   # Extra pairs for the vthreads runtime
706   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
707     LIBGNAT_TARGET_PAIRS += \
708     s-thread.adb<s-thread-ae653.adb \
709     $(DUMMY_SOCKETS_TARGET_PAIRS)
710
711     GNATRTL_SOCKETS_OBJS =
712     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
713   else
714     LIBGNAT_TARGET_PAIRS += \
715     g-socthi.ads<g-socthi-vxworks.ads \
716     g-socthi.adb<g-socthi-vxworks.adb \
717     g-stsifd.adb<g-stsifd-sockets.adb
718   endif
719
720   ifeq ($(strip $(filter-out yes,$(TRACE))),)
721     LIBGNAT_TARGET_PAIRS += \
722     s-traces.adb<s-traces-default.adb \
723     s-trafor.adb<s-trafor-default.adb \
724     s-trafor.ads<s-trafor-default.ads \
725     s-tratas.adb<s-tratas-default.adb \
726     s-tfsetr.adb<s-tfsetr-vxworks.adb
727   endif
728 endif
729
730 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
731   LIBGNAT_TARGET_PAIRS = \
732   a-intnam.ads<a-intnam-vxworks.ads \
733   a-numaux.ads<a-numaux-vxworks.ads \
734   s-inmaop.adb<s-inmaop-posix.adb \
735   s-interr.adb<s-interr-hwint.adb \
736   s-intman.ads<s-intman-vxworks.ads \
737   s-intman.adb<s-intman-vxworks.adb \
738   s-osinte.adb<s-osinte-vxworks.adb \
739   s-osinte.ads<s-osinte-vxworks.ads \
740   s-osprim.adb<s-osprim-vxworks.adb \
741   s-parame.ads<s-parame-vxworks.ads \
742   s-parame.adb<s-parame-vxworks.adb \
743   s-stchop.ads<s-stchop-limit.ads \
744   s-stchop.adb<s-stchop-vxworks.adb \
745   s-taprop.adb<s-taprop-vxworks.adb \
746   s-tasinf.ads<s-tasinf-vxworks.ads \
747   s-taspri.ads<s-taspri-vxworks.ads \
748   s-tpopsp.adb<s-tpopsp-vxworks.adb \
749   s-vxwork.ads<s-vxwork-sparcv9.ads \
750   g-socthi.ads<g-socthi-vxworks.ads \
751   g-socthi.adb<g-socthi-vxworks.adb \
752   g-stsifd.adb<g-stsifd-sockets.adb \
753   g-trasym.ads<g-trasym-unimplemented.ads \
754   g-trasym.adb<g-trasym-unimplemented.adb \
755   system.ads<system-vxworks-sparcv9.ads   \
756
757   TOOLS_TARGET_PAIRS=\
758   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
759   indepsw.adb<indepsw-gnu.adb
760
761   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
762   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
763
764   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
765   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
766 endif
767
768 ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
769   LIBGNAT_TARGET_PAIRS = \
770   a-intnam.ads<a-intnam-vxworks.ads \
771   i-vxwork.ads<i-vxwork-x86.ads \
772   s-osinte.adb<s-osinte-vxworks.adb \
773   s-osinte.ads<s-osinte-vxworks.ads \
774   s-inmaop.adb<s-inmaop-posix.adb \
775   s-intman.ads<s-intman-vxworks.ads \
776   s-intman.adb<s-intman-vxworks.adb \
777   a-numaux.adb<a-numaux-x86.adb \
778   a-numaux.ads<a-numaux-x86.ads \
779   s-osprim.adb<s-osprim-vxworks.adb \
780   s-parame.ads<s-parame-vxworks.ads \
781   s-parame.adb<s-parame-vxworks.adb \
782   s-stchop.ads<s-stchop-limit.ads \
783   s-stchop.adb<s-stchop-vxworks.adb \
784   s-taprop.adb<s-taprop-vxworks.adb \
785   s-tasinf.ads<s-tasinf-vxworks.ads \
786   s-taspri.ads<s-taspri-vxworks.ads \
787   s-vxwork.ads<s-vxwork-x86.ads \
788   g-bytswa.adb<g-bytswa-x86.adb \
789   g-socthi.ads<g-socthi-vxworks.ads \
790   g-socthi.adb<g-socthi-vxworks.adb \
791   g-stsifd.adb<g-stsifd-sockets.adb \
792   g-trasym.ads<g-trasym-unimplemented.ads \
793   g-trasym.adb<g-trasym-unimplemented.adb
794
795   TOOLS_TARGET_PAIRS=\
796   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
797   indepsw.adb<indepsw-gnu.adb
798
799   ifeq ($(strip $(filter-out yes,$(TRACE))),)
800     LIBGNAT_TARGET_PAIRS += \
801     s-traces.adb<s-traces-default.adb \
802     s-trafor.adb<s-trafor-default.adb \
803     s-trafor.ads<s-trafor-default.ads \
804     s-tratas.adb<s-tratas-default.adb \
805     s-tfsetr.adb<s-tfsetr-vxworks.adb
806   endif
807
808   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
809     LIBGNAT_TARGET_PAIRS += \
810     s-vxwext.ads<s-vxwext-rtp.ads \
811     s-vxwext.adb<s-vxwext-rtp.adb \
812     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
813     system.ads<system-vxworks-x86-rtp.ads
814
815     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
816   else
817     ifeq ($(strip $(filter-out rtp-smp, $(THREAD_KIND))),)
818       LIBGNAT_TARGET_PAIRS += \
819       s-vxwext.ads<s-vxwext-rtp.ads \
820       s-vxwext.adb<s-vxwext-rtp-smp.adb \
821       s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
822       system.ads<system-vxworks-x86-rtp.ads
823
824       EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
825       EXTRA_GNATRTL_TASKING_OBJS=affinity.o
826     else
827       ifeq ($(strip $(filter-out kernel-smp, $(THREAD_KIND))),)
828         LIBGNAT_TARGET_PAIRS += \
829         s-interr.adb<s-interr-hwint.adb \
830         s-tpopsp.adb<s-tpopsp-vxworks-tls.adb \
831         s-vxwext.ads<s-vxwext-kernel.ads \
832         s-vxwext.adb<s-vxwext-kernel-smp.adb \
833         system.ads<system-vxworks-x86-kernel.ads
834         EXTRA_GNATRTL_TASKING_OBJS=affinity.o
835       else
836         LIBGNAT_TARGET_PAIRS += \
837         s-interr.adb<s-interr-hwint.adb \
838         s-tpopsp.adb<s-tpopsp-vxworks.adb
839
840         ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
841           LIBGNAT_TARGET_PAIRS += \
842           s-vxwext.ads<s-vxwext-kernel.ads \
843           s-vxwext.adb<s-vxwext-kernel.adb \
844           system.ads<system-vxworks-x86-kernel.ads
845         else
846           LIBGNAT_TARGET_PAIRS += \
847           system.ads<system-vxworks-x86.ads
848         endif
849       endif
850
851       EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
852     endif
853   endif
854   EXTRA_GNATRTL_TASKING_OBJS += s-vxwork.o s-vxwext.o
855
856   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
857   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
858 endif
859
860 ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
861   LIBGNAT_TARGET_PAIRS = \
862   a-intnam.ads<a-intnam-vxworks.ads \
863   a-numaux.ads<a-numaux-vxworks.ads \
864   s-inmaop.adb<s-inmaop-posix.adb \
865   s-interr.adb<s-interr-hwint.adb \
866   s-intman.ads<s-intman-vxworks.ads \
867   s-intman.adb<s-intman-vxworks.adb \
868   s-osinte.adb<s-osinte-vxworks.adb \
869   s-osinte.ads<s-osinte-vxworks.ads \
870   s-osprim.adb<s-osprim-vxworks.adb \
871   s-parame.ads<s-parame-vxworks.ads \
872   s-parame.adb<s-parame-vxworks.adb \
873   s-stchop.ads<s-stchop-limit.ads \
874   s-stchop.adb<s-stchop-vxworks.adb \
875   s-taprop.adb<s-taprop-vxworks.adb \
876   s-tasinf.ads<s-tasinf-vxworks.ads \
877   s-taspri.ads<s-taspri-vxworks.ads \
878   s-tpopsp.adb<s-tpopsp-vxworks.adb \
879   s-vxwork.ads<s-vxwork-arm.ads \
880   g-socthi.ads<g-socthi-vxworks.ads \
881   g-socthi.adb<g-socthi-vxworks.adb \
882   g-stsifd.adb<g-stsifd-sockets.adb \
883   g-trasym.ads<g-trasym-unimplemented.ads \
884   g-trasym.adb<g-trasym-unimplemented.adb \
885   system.ads<system-vxworks-arm.ads
886
887   TOOLS_TARGET_PAIRS=\
888   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
889   indepsw.adb<indepsw-gnu.adb
890
891   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
892   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
893
894   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
895   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
896 endif
897
898 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
899   LIBGNAT_TARGET_PAIRS = \
900   a-intnam.ads<a-intnam-vxworks.ads \
901   a-numaux.ads<a-numaux-vxworks.ads \
902   s-inmaop.adb<s-inmaop-posix.adb \
903   s-interr.adb<s-interr-hwint.adb \
904   s-intman.ads<s-intman-vxworks.ads \
905   s-intman.adb<s-intman-vxworks.adb \
906   s-osinte.adb<s-osinte-vxworks.adb \
907   s-osinte.ads<s-osinte-vxworks.ads \
908   s-osprim.adb<s-osprim-vxworks.adb \
909   s-parame.ads<s-parame-vxworks.ads \
910   s-parame.adb<s-parame-vxworks.adb \
911   s-stchop.ads<s-stchop-limit.ads \
912   s-stchop.adb<s-stchop-vxworks.adb \
913   s-taprop.adb<s-taprop-vxworks.adb \
914   s-tasinf.ads<s-tasinf-vxworks.ads \
915   s-taspri.ads<s-taspri-vxworks.ads \
916   s-tpopsp.adb<s-tpopsp-vxworks.adb \
917   s-vxwork.ads<s-vxwork-mips.ads \
918   g-socthi.ads<g-socthi-vxworks.ads \
919   g-socthi.adb<g-socthi-vxworks.adb \
920   g-stsifd.adb<g-stsifd-sockets.adb \
921   g-trasym.ads<g-trasym-unimplemented.ads \
922   g-trasym.adb<g-trasym-unimplemented.adb \
923   system.ads<system-vxworks-mips.ads
924
925   TOOLS_TARGET_PAIRS=\
926   mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb \
927   indepsw.adb<indepsw-gnu.adb
928
929   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
930   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o s-vxwext.o
931
932   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
933   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
934 endif
935
936 ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
937   LIBGNAT_TARGET_PAIRS_COMMON = \
938   a-intnam.ads<a-intnam-solaris.ads \
939   s-inmaop.adb<s-inmaop-posix.adb \
940   s-intman.adb<s-intman-solaris.adb \
941   s-osinte.adb<s-osinte-solaris.adb \
942   s-osinte.ads<s-osinte-solaris.ads \
943   s-osprim.adb<s-osprim-solaris.adb \
944   s-taprop.adb<s-taprop-solaris.adb \
945   s-tasinf.adb<s-tasinf-solaris.adb \
946   s-tasinf.ads<s-tasinf-solaris.ads \
947   s-taspri.ads<s-taspri-solaris.ads \
948   s-tpopsp.adb<s-tpopsp-solaris.adb \
949   g-soliop.ads<g-soliop-solaris.ads
950
951   LIBGNAT_TARGET_PAIRS_32 = \
952   system.ads<system-solaris-sparc.ads
953
954   LIBGNAT_TARGET_PAIRS_64 = \
955   system.ads<system-solaris-sparcv9.ads \
956   $(ATOMICS_TARGET_PAIRS)
957
958   ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
959     ifeq ($(strip $(MULTISUBDIR)),/sparcv9)
960       LIBGNAT_TARGET_PAIRS = \
961       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
962     else
963       LIBGNAT_TARGET_PAIRS = \
964       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
965     endif
966   else
967     ifeq ($(strip $(MULTISUBDIR)),/sparcv8plus)
968       LIBGNAT_TARGET_PAIRS = \
969       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
970     else
971       LIBGNAT_TARGET_PAIRS = \
972       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
973     endif
974   endif
975
976   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
977
978   EH_MECHANISM=-gcc
979   THREADSLIB = -lposix4 -lthread
980   MISCLIB = -lposix4 -lnsl -lsocket
981   SO_OPTS = -Wl,-h,
982   GNATLIB_SHARED = gnatlib-shared-dual
983   GMEM_LIB = gmemlib
984   LIBRARY_VERSION := $(LIB_VERSION)
985
986   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
987     LIBGNAT_TARGET_PAIRS = \
988     a-intnam.ads<a-intnam-solaris.ads \
989     s-inmaop.adb<s-inmaop-posix.adb \
990     s-intman.adb<s-intman-posix.adb \
991     s-osinte.adb<s-osinte-posix.adb \
992     s-osinte.ads<s-osinte-solaris-posix.ads \
993     s-osprim.adb<s-osprim-solaris.adb \
994     s-taprop.adb<s-taprop-posix.adb \
995     s-taspri.ads<s-taspri-posix.ads \
996     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
997     g-soliop.ads<g-soliop-solaris.ads \
998     system.ads<system-solaris-sparc.ads
999
1000     THREADSLIB = -lposix4 -lpthread
1001   endif
1002
1003   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
1004     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
1005   endif
1006 endif
1007
1008 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
1009   LIBGNAT_TARGET_PAIRS = \
1010   a-numaux.adb<a-numaux-x86.adb \
1011   a-numaux.ads<a-numaux-x86.ads \
1012   a-intnam.ads<a-intnam-solaris.ads \
1013   s-inmaop.adb<s-inmaop-posix.adb \
1014   s-intman.adb<s-intman-solaris.adb \
1015   s-osinte.adb<s-osinte-solaris.adb \
1016   s-osinte.ads<s-osinte-solaris.ads \
1017   s-osprim.adb<s-osprim-solaris.adb \
1018   s-taprop.adb<s-taprop-solaris.adb \
1019   s-tasinf.adb<s-tasinf-solaris.adb \
1020   s-tasinf.ads<s-tasinf-solaris.ads \
1021   s-taspri.ads<s-taspri-solaris.ads \
1022   s-tpopsp.adb<s-tpopsp-solaris.adb \
1023   g-soliop.ads<g-soliop-solaris.ads
1024
1025   ifeq ($(strip $(MULTISUBDIR)),/amd64)
1026     LIBGNAT_TARGET_PAIRS += \
1027     system.ads<system-solaris-x86_64.ads
1028   else
1029     LIBGNAT_TARGET_PAIRS += \
1030     g-bytswa.adb<g-bytswa-x86.adb \
1031     system.ads<system-solaris-x86.ads
1032   endif
1033
1034   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
1035
1036   EH_MECHANISM=-gcc
1037   THREADSLIB = -lposix4 -lthread
1038   MISCLIB = -lposix4 -lnsl -lsocket
1039   SO_OPTS = -Wl,-h,
1040   GNATLIB_SHARED = gnatlib-shared-dual
1041   GMEM_LIB = gmemlib
1042   LIBRARY_VERSION := $(LIB_VERSION)
1043 endif
1044
1045 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
1046   LIBGNAT_TARGET_PAIRS = \
1047   a-intnam.ads<a-intnam-linux.ads \
1048   a-numaux.adb<a-numaux-x86.adb \
1049   a-numaux.ads<a-numaux-x86.ads \
1050   g-bytswa.adb<g-bytswa-x86.adb \
1051   s-inmaop.adb<s-inmaop-posix.adb \
1052   s-intman.adb<s-intman-posix.adb \
1053   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1054   g-sercom.adb<g-sercom-linux.adb
1055
1056   ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
1057     LIBGNAT_TARGET_PAIRS += \
1058     a-exetim.adb<a-exetim-linux-marte.adb \
1059     a-exetim.ads<a-exetim-linux-marte.ads \
1060     a-extiti.adb<a-extiti-linux-marte.adb \
1061     a-extiti.ads<a-extiti-linux-marte.ads \
1062     a-rttiev.adb<a-rttiev-linux-marte.adb \
1063     a-rttiev.ads<a-rttiev-linux-marte.ads \
1064     s-osinte.adb<s-osinte-linux-marte.adb \
1065     s-osinte.ads<s-osinte-linux-marte.ads \
1066     s-osprim.adb<s-osprim-posix.adb \
1067     s-taprop.adb<s-taprop-linux-marte.adb \
1068     s-taspri.ads<s-taspri-posix.ads \
1069     system.ads<system-linux-x86.ads
1070
1071     EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
1072
1073     EH_MECHANISM=
1074     THREADSLIB = -lmarte
1075   else
1076     LIBGNAT_TARGET_PAIRS += \
1077     a-exetim.adb<a-exetim-posix.adb \
1078     a-exetim.ads<a-exetim-default.ads \
1079     s-linux.ads<s-linux.ads \
1080     s-osinte.adb<s-osinte-posix.adb
1081
1082     ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
1083       LIBGNAT_TARGET_PAIRS += \
1084       s-osinte.ads<s-osinte-linux-xenomai.ads \
1085       s-osprim.adb<s-osprim-linux-xenomai.adb \
1086       s-taprop.adb<s-taprop-linux-xenomai.adb \
1087       s-taspri.ads<s-taspri-linux-xenomai.ads \
1088       system.ads<system-linux-x86-xenomai.ads
1089
1090       EH_MECHANISM=-gcc
1091     else
1092       LIBGNAT_TARGET_PAIRS += \
1093       s-osinte.ads<s-osinte-linux.ads \
1094       s-osprim.adb<s-osprim-posix.adb \
1095       s-taprop.adb<s-taprop-linux.adb \
1096       s-tasinf.ads<s-tasinf-linux.ads \
1097       s-tasinf.adb<s-tasinf-linux.adb \
1098       s-taspri.ads<s-taspri-posix.ads \
1099       system.ads<system-linux-x86.ads
1100
1101       EH_MECHANISM=-gcc
1102     endif
1103
1104     THREADSLIB = -lpthread -lrt
1105     EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
1106     EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
1107   endif
1108
1109   TOOLS_TARGET_PAIRS =  \
1110     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1111     indepsw.adb<indepsw-gnu.adb
1112
1113   GNATLIB_SHARED = gnatlib-shared-dual
1114   GMEM_LIB = gmemlib
1115   LIBRARY_VERSION := $(LIB_VERSION)
1116 endif
1117
1118 ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
1119   LIBGNAT_TARGET_PAIRS = \
1120   a-intnam.ads<a-intnam-freebsd.ads \
1121   a-numaux.adb<a-numaux-x86.adb \
1122   a-numaux.ads<a-numaux-x86.ads \
1123   s-inmaop.adb<s-inmaop-posix.adb \
1124   s-intman.adb<s-intman-posix.adb \
1125   s-osinte.adb<s-osinte-posix.adb \
1126   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
1127   s-osprim.adb<s-osprim-posix.adb \
1128   s-taprop.adb<s-taprop-linux.adb \
1129   s-tasinf.ads<s-tasinf-linux.ads \
1130   s-tasinf.adb<s-tasinf-linux.adb \
1131   s-taspri.ads<s-taspri-posix.ads \
1132   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1133   system.ads<system-freebsd-x86.ads
1134
1135   TOOLS_TARGET_PAIRS =  \
1136     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1137     indepsw.adb<indepsw-gnu.adb
1138
1139   EH_MECHANISM=-gcc
1140   THREADSLIB = -lpthread
1141   GNATLIB_SHARED = gnatlib-shared-dual
1142   GMEM_LIB = gmemlib
1143   LIBRARY_VERSION := $(LIB_VERSION)
1144 endif
1145
1146 ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(arch) $(osys))),)
1147   LIBGNAT_TARGET_PAIRS = \
1148   a-intnam.ads<a-intnam-freebsd.ads \
1149   a-numaux.adb<a-numaux-x86.adb \
1150   a-numaux.ads<a-numaux-x86.ads \
1151   s-inmaop.adb<s-inmaop-posix.adb \
1152   s-intman.adb<s-intman-posix.adb \
1153   s-osinte.adb<s-osinte-posix.adb \
1154   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
1155   s-osprim.adb<s-osprim-posix.adb \
1156   s-taprop.adb<s-taprop-linux.adb \
1157   s-tasinf.ads<s-tasinf-linux.ads \
1158   s-tasinf.adb<s-tasinf-linux.adb \
1159   s-taspri.ads<s-taspri-posix.ads \
1160   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1161   system.ads<system-freebsd-x86_64.ads
1162
1163   TOOLS_TARGET_PAIRS =  \
1164     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1165     indepsw.adb<indepsw-gnu.adb
1166
1167   EH_MECHANISM=-gcc
1168   THREADSLIB = -lpthread
1169   GNATLIB_SHARED = gnatlib-shared-dual
1170   GMEM_LIB = gmemlib
1171   LIBRARY_VERSION := $(LIB_VERSION)
1172 endif
1173
1174 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
1175   LIBGNAT_TARGET_PAIRS = \
1176   a-intnam.ads<a-intnam-freebsd.ads \
1177   a-numaux.adb<a-numaux-x86.adb \
1178   a-numaux.ads<a-numaux-x86.ads \
1179   g-bytswa.adb<g-bytswa-x86.adb \
1180   s-inmaop.adb<s-inmaop-posix.adb \
1181   s-intman.adb<s-intman-posix.adb \
1182   s-osinte.adb<s-osinte-freebsd.adb \
1183   s-osinte.ads<s-osinte-freebsd.ads \
1184   s-osprim.adb<s-osprim-posix.adb \
1185   s-taprop.adb<s-taprop-posix.adb \
1186   s-taspri.ads<s-taspri-posix.ads \
1187   s-tpopsp.adb<s-tpopsp-posix.adb \
1188   system.ads<system-freebsd-x86.ads
1189
1190   TOOLS_TARGET_PAIRS = \
1191   mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
1192   GNATLIB_SHARED = gnatlib-shared-dual
1193
1194   EH_MECHANISM=-gcc
1195   THREADSLIB= -lpthread
1196   GMEM_LIB = gmemlib
1197   LIBRARY_VERSION := $(LIB_VERSION)
1198 endif
1199
1200 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
1201   LIBGNAT_TARGET_PAIRS_COMMON = \
1202   a-intnam.ads<a-intnam-linux.ads \
1203   s-inmaop.adb<s-inmaop-posix.adb \
1204   s-intman.adb<s-intman-posix.adb \
1205   s-linux.ads<s-linux.ads \
1206   s-osinte.adb<s-osinte-posix.adb \
1207   s-osinte.ads<s-osinte-linux.ads \
1208   s-osprim.adb<s-osprim-posix.adb \
1209   s-taprop.adb<s-taprop-linux.adb \
1210   s-tasinf.ads<s-tasinf-linux.ads \
1211   s-tasinf.adb<s-tasinf-linux.adb \
1212   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1213   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1214   g-trasym.ads<g-trasym-unimplemented.ads \
1215   g-trasym.adb<g-trasym-unimplemented.adb
1216
1217   LIBGNAT_TARGET_PAIRS_32 = \
1218   system.ads<system-linux-s390.ads
1219
1220   LIBGNAT_TARGET_PAIRS_64 = \
1221   system.ads<system-linux-s390x.ads
1222
1223   ifeq ($(strip $(filter-out s390x,$(arch))),)
1224     ifeq ($(strip $(MULTISUBDIR)),/32)
1225       LIBGNAT_TARGET_PAIRS = \
1226       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1227     else
1228       LIBGNAT_TARGET_PAIRS = \
1229       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1230     endif
1231   else
1232     LIBGNAT_TARGET_PAIRS = \
1233     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1234   endif
1235
1236   TOOLS_TARGET_PAIRS =  \
1237     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1238     indepsw.adb<indepsw-gnu.adb
1239
1240   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1241   EH_MECHANISM=-gcc
1242   THREADSLIB = -lpthread
1243   GNATLIB_SHARED = gnatlib-shared-dual
1244   LIBRARY_VERSION := $(LIB_VERSION)
1245 endif
1246
1247 ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
1248   LIBGNAT_TARGET_PAIRS = \
1249   a-intnam.ads<a-intnam-irix.ads \
1250   s-inmaop.adb<s-inmaop-posix.adb \
1251   s-intman.adb<s-intman-irix.adb \
1252   s-mastop.adb<s-mastop-irix.adb \
1253   s-osinte.adb<s-osinte-irix.adb \
1254   s-osinte.ads<s-osinte-irix.ads \
1255   s-osprim.adb<s-osprim-posix.adb \
1256   s-proinf.adb<s-proinf-irix-athread.adb \
1257   s-proinf.ads<s-proinf-irix-athread.ads \
1258   s-taprop.adb<s-taprop-irix.adb \
1259   s-tasinf.ads<s-tasinf-irix.ads \
1260   s-taspri.ads<s-taspri-posix.ads \
1261   s-tpopsp.adb<s-tpopsp-posix.adb \
1262   s-traceb.adb<s-traceb-mastop.adb
1263
1264   ifeq ($(strip $(MULTISUBDIR)),/64)
1265     LIBGNAT_TARGET_PAIRS += \
1266     system.ads<system-irix-n64.ads
1267   else
1268     ifeq ($(strip $(MULTISUBDIR)),/32)
1269       LIBGNAT_TARGET_PAIRS += \
1270       system.ads<system-irix-o32.ads
1271     else
1272       LIBGNAT_TARGET_PAIRS += \
1273       system.ads<system-irix-n32.ads
1274     endif
1275   endif
1276
1277   THREADSLIB = -lpthread
1278   GNATLIB_SHARED = gnatlib-shared-default
1279
1280   EH_MECHANISM=-gcc
1281   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb
1282   TGT_LIB = -lexc
1283   MISCLIB = -lexc
1284   LIBRARY_VERSION := $(LIB_VERSION)
1285   GMEM_LIB = gmemlib
1286 endif
1287
1288 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
1289   LIBGNAT_TARGET_PAIRS = \
1290   a-excpol.adb<a-excpol-abort.adb \
1291   a-intnam.ads<a-intnam-hpux.ads \
1292   s-inmaop.adb<s-inmaop-posix.adb \
1293   s-interr.adb<s-interr-sigaction.adb \
1294   s-intman.adb<s-intman-posix.adb \
1295   s-osinte.adb<s-osinte-hpux-dce.adb \
1296   s-osinte.ads<s-osinte-hpux-dce.ads \
1297   s-parame.ads<s-parame-hpux.ads \
1298   s-osprim.adb<s-osprim-posix.adb \
1299   s-taprop.adb<s-taprop-hpux-dce.adb \
1300   s-taspri.ads<s-taspri-hpux-dce.ads \
1301   s-tpopsp.adb<s-tpopsp-posix.adb \
1302   system.ads<system-hpux.ads
1303
1304   EH_MECHANISM=-gcc
1305 endif
1306
1307 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
1308   LIBGNAT_TARGET_PAIRS = \
1309   a-intnam.ads<a-intnam-hpux.ads \
1310   s-inmaop.adb<s-inmaop-posix.adb \
1311   s-intman.adb<s-intman-posix.adb \
1312   s-osinte.adb<s-osinte-posix.adb \
1313   s-osinte.ads<s-osinte-hpux.ads \
1314   s-parame.ads<s-parame-hpux.ads \
1315   s-osprim.adb<s-osprim-posix.adb \
1316   s-traceb.adb<s-traceb-hpux.adb \
1317   s-taprop.adb<s-taprop-posix.adb \
1318   s-taspri.ads<s-taspri-posix.ads \
1319   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1320   system.ads<system-hpux.ads
1321
1322   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
1323   EH_MECHANISM=-gcc
1324   TGT_LIB = /usr/lib/libcl.a
1325   THREADSLIB = -lpthread
1326   GMEM_LIB = gmemlib
1327   soext = .sl
1328   SO_OPTS = -Wl,+h,
1329   GNATLIB_SHARED = gnatlib-shared-dual
1330   LIBRARY_VERSION := $(LIB_VERSION)
1331 endif
1332
1333 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1334   LIBGNAT_TARGET_PAIRS_COMMON = \
1335   a-intnam.ads<a-intnam-aix.ads \
1336   s-inmaop.adb<s-inmaop-posix.adb \
1337   s-intman.adb<s-intman-posix.adb \
1338   s-osinte.adb<s-osinte-aix.adb \
1339   s-osinte.ads<s-osinte-aix.ads \
1340   s-osprim.adb<s-osprim-posix.adb \
1341   s-taprop.adb<s-taprop-posix.adb \
1342   s-taspri.ads<s-taspri-posix.ads \
1343   s-tpopsp.adb<s-tpopsp-posix.adb \
1344   $(ATOMICS_TARGET_PAIRS)
1345
1346   LIBGNAT_TARGET_PAIRS_32 = \
1347   system.ads<system-aix.ads
1348
1349   LIBGNAT_TARGET_PAIRS_64 = \
1350   system.ads<system-aix64.ads
1351
1352   ifeq ($(findstring ppc64, \
1353           $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) \
1354                    -print-multi-os-directory)), \
1355         ppc64)
1356     LIBGNAT_TARGET_PAIRS = \
1357     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1358   else
1359     LIBGNAT_TARGET_PAIRS = \
1360     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1361   endif
1362
1363   THREADSLIB = -lpthreads
1364
1365   TOOLS_TARGET_PAIRS = \
1366   mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
1367   indepsw.adb<indepsw-aix.adb
1368
1369   GMEM_LIB = gmemlib
1370 endif
1371
1372 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1373   TOOLS_TARGET_PAIRS = \
1374   mlib-tgt-specific.adb<mlib-tgt-specific-lynxos.adb \
1375   indepsw.adb<indepsw-gnu.adb
1376
1377   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1378     LIBGNAT_TARGET_PAIRS = \
1379     a-numaux.adb<a-numaux-x86.adb \
1380     a-numaux.ads<a-numaux-x86.ads \
1381     a-intnam.ads<a-intnam-lynxos.ads \
1382     g-bytswa.adb<g-bytswa-x86.adb \
1383     s-inmaop.adb<s-inmaop-posix.adb \
1384     s-intman.adb<s-intman-posix.adb \
1385     s-osinte.adb<s-osinte-lynxos.adb \
1386     s-osinte.ads<s-osinte-lynxos.ads \
1387     s-osprim.adb<s-osprim-posix.adb \
1388     s-taprop.adb<s-taprop-lynxos.adb \
1389     s-taspri.ads<s-taspri-lynxos.ads \
1390     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1391     g-trasym.ads<g-trasym-unimplemented.ads \
1392     g-trasym.adb<g-trasym-unimplemented.adb \
1393     system.ads<system-lynxos-x86.ads
1394
1395
1396   else
1397     LIBGNAT_TARGET_PAIRS = \
1398     a-intnam.ads<a-intnam-lynxos.ads \
1399     s-inmaop.adb<s-inmaop-posix.adb \
1400     s-intman.adb<s-intman-posix.adb \
1401     s-osinte.adb<s-osinte-lynxos.adb \
1402     s-osinte.ads<s-osinte-lynxos.ads \
1403     s-osprim.adb<s-osprim-posix.adb \
1404     s-taprop.adb<s-taprop-lynxos.adb \
1405     s-taspri.ads<s-taspri-lynxos.ads \
1406     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1407     g-trasym.ads<g-trasym-unimplemented.ads \
1408     g-trasym.adb<g-trasym-unimplemented.adb \
1409     system.ads<system-lynxos-ppc.ads
1410   endif
1411 endif
1412
1413 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1414   LIBGNAT_TARGET_PAIRS = \
1415   system.ads<system-rtems.ads \
1416   a-intnam.ads<a-intnam-rtems.ads \
1417   s-inmaop.adb<s-inmaop-posix.adb \
1418   s-intman.adb<s-intman-posix.adb \
1419   s-osinte.adb<s-osinte-rtems.adb \
1420   s-osinte.ads<s-osinte-rtems.ads \
1421   s-osprim.adb<s-osprim-posix.adb \
1422   s-parame.adb<s-parame-rtems.adb \
1423   s-taprop.adb<s-taprop-posix.adb \
1424   s-taspri.ads<s-taspri-posix.ads \
1425   s-tpopsp.adb<s-tpopsp-rtems.adb \
1426   s-stchop.adb<s-stchop-rtems.adb \
1427   s-interr.adb<s-interr-hwint.adb \
1428   g-trasym.ads<g-trasym-unimplemented.ads \
1429   g-trasym.adb<g-trasym-unimplemented.adb
1430 endif
1431
1432 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1433   LIBGNAT_TARGET_PAIRS = \
1434   a-intnam.ads<a-intnam-tru64.ads \
1435   s-inmaop.adb<s-inmaop-posix.adb \
1436   s-intman.adb<s-intman-posix.adb \
1437   s-mastop.adb<s-mastop-tru64.adb \
1438   s-osinte.adb<s-osinte-tru64.adb \
1439   s-osinte.ads<s-osinte-tru64.ads \
1440   s-osprim.adb<s-osprim-unix.adb \
1441   s-taprop.adb<s-taprop-tru64.adb \
1442   s-tasinf.ads<s-tasinf-tru64.ads \
1443   s-taspri.ads<s-taspri-tru64.ads \
1444   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1445   s-traceb.adb<s-traceb-mastop.adb \
1446   system.ads<system-tru64.ads \
1447   $(ATOMICS_TARGET_PAIRS)
1448
1449   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-tru64.adb
1450
1451   EH_MECHANISM=-gcc
1452   GMEM_LIB=gmemlib
1453   MISCLIB = -lexc
1454   THREADSLIB = -lpthread -lmach -lexc -lrt
1455   GNATLIB_SHARED = gnatlib-shared-default
1456   LIBRARY_VERSION := $(LIB_VERSION)
1457 endif
1458
1459 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
1460
1461 soext  = .exe
1462 hyphen = _
1463 LN = cp -p
1464 LN_S = cp -p
1465
1466 .SUFFIXES: .sym
1467
1468 .o.sym:
1469         @ gnu:[bin]vmssymvec $<
1470 endif
1471
1472 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1473   ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1474     LIBGNAT_TARGET_PAIRS_AUX1 = \
1475       g-enblsp.adb<g-enblsp-vms-ia64.adb \
1476       g-trasym.adb<g-trasym-vms-ia64.adb \
1477       s-asthan.adb<s-asthan-vms-ia64.adb \
1478       s-auxdec.adb<s-auxdec-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       system.ads<system-vms-ia64.ads
1483
1484     LIBGNAT_TARGET_PAIRS_AUX2 = \
1485       s-parame.ads<s-parame-vms-ia64.ads \
1486       $(ATOMICS_TARGET_PAIRS)
1487   else
1488     ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1489       LIBGNAT_TARGET_PAIRS_AUX1 = \
1490         g-enblsp.adb<g-enblsp-vms-alpha.adb \
1491         g-trasym.adb<g-trasym-vms-alpha.adb \
1492         s-asthan.adb<s-asthan-vms-alpha.adb \
1493         s-auxdec.adb<s-auxdec-vms-alpha.adb \
1494         s-osinte.adb<s-osinte-vms.adb \
1495         s-osinte.ads<s-osinte-vms.ads \
1496         s-traent.adb<s-traent-vms.adb \
1497         s-traent.ads<s-traent-vms.ads \
1498         s-vaflop.adb<s-vaflop-vms-alpha.adb \
1499         system.ads<system-vms_64.ads
1500
1501       ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1502         LIBGNAT_TARGET_PAIRS_AUX2 = \
1503           s-parame.ads<s-parame-vms-restrict.ads
1504       else
1505         LIBGNAT_TARGET_PAIRS_AUX2 = \
1506           s-parame.ads<s-parame-vms-alpha.ads \
1507           $(ATOMICS_TARGET_PAIRS)
1508       endif
1509     endif
1510   endif
1511
1512   LIBGNAT_TARGET_PAIRS = \
1513     a-caldel.adb<a-caldel-vms.adb \
1514     a-calend.adb<a-calend-vms.adb \
1515     a-calend.ads<a-calend-vms.ads \
1516     a-dirval.adb<a-dirval-vms.adb \
1517     a-excpol.adb<a-excpol-abort.adb \
1518     a-intnam.ads<a-intnam-vms.ads \
1519     a-numaux.ads<a-numaux-vms.ads \
1520     g-expect.adb<g-expect-vms.adb \
1521     g-socthi.ads<g-socthi-vms.ads \
1522     g-socthi.adb<g-socthi-vms.adb \
1523     g-stsifd.adb<g-stsifd-sockets.adb \
1524     i-c.ads<i-c-vms_64.ads \
1525     i-cstrin.ads<i-cstrin-vms_64.ads \
1526     i-cstrin.adb<i-cstrin-vms_64.adb \
1527     i-cpoint.ads<i-cpoint-vms_64.ads \
1528     i-cpoint.adb<i-cpoint-vms_64.adb \
1529     i-cstrea.adb<i-cstrea-vms.adb \
1530     memtrack.adb<memtrack-vms_64.adb \
1531     s-auxdec.ads<s-auxdec-vms_64.ads \
1532     s-inmaop.adb<s-inmaop-vms.adb \
1533     s-interr.adb<s-interr-vms.adb \
1534     s-intman.adb<s-intman-vms.adb \
1535     s-intman.ads<s-intman-vms.ads \
1536     s-memory.adb<s-memory-vms_64.adb \
1537     s-memory.ads<s-memory-vms_64.ads \
1538     s-osprim.adb<s-osprim-vms.adb \
1539     s-osprim.ads<s-osprim-vms.ads \
1540     s-taprop.adb<s-taprop-vms.adb \
1541     s-tasdeb.adb<s-tasdeb-vms.adb \
1542     s-taspri.ads<s-taspri-vms.ads \
1543     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1544     s-tpopde.adb<s-tpopde-vms.adb \
1545     s-tpopde.ads<s-tpopde-vms.ads \
1546     $(LIBGNAT_TARGET_PAIRS_AUX1) \
1547     $(LIBGNAT_TARGET_PAIRS_AUX2)
1548
1549   ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1550     TOOLS_TARGET_PAIRS= \
1551       mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
1552       symbols.adb<symbols-vms.adb \
1553       symbols-processing.adb<symbols-processing-vms-ia64.adb
1554   else
1555     TOOLS_TARGET_PAIRS= \
1556       mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
1557       symbols.adb<symbols-vms.adb \
1558       symbols-processing.adb<symbols-processing-vms-alpha.adb
1559   endif
1560
1561 adamsg.o: adamsg.msg
1562         -$(DECC) --cc=message adamsg.msg -o adamsg.o
1563
1564   EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
1565
1566   GMEM_LIB = gmemlib
1567   EH_MECHANISM=-gcc
1568   GNATLIB_SHARED=gnatlib-shared-vms
1569   EXTRA_LIBGNAT_SRCS+=adamsg.msg
1570   EXTRA_LIBGNAT_OBJS+=adamsg.o
1571   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1572   EXTRA_GNATTOOLS = \
1573      ../../gnatsym$(exeext)
1574   # This command transforms (YYYYMMDD) into YY,MMDD
1575   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
1576   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1577   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1578 endif
1579
1580 ifeq ($(strip $(filter-out avr none powerpc% eabispe leon% erc32% unknown elf,$(targ))),)
1581   TOOLS_TARGET_PAIRS=\
1582   mlib-tgt-specific.adb<mlib-tgt-specific-xi.adb \
1583   indepsw.adb<indepsw-gnu.adb
1584 endif
1585
1586 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1587   LIBGNAT_TARGET_PAIRS = \
1588   a-dirval.adb<a-dirval-mingw.adb \
1589   a-excpol.adb<a-excpol-abort.adb \
1590   a-numaux.adb<a-numaux-x86.adb \
1591   a-numaux.ads<a-numaux-x86.ads \
1592   s-gloloc.adb<s-gloloc-mingw.adb \
1593   s-inmaop.adb<s-inmaop-dummy.adb \
1594   s-memory.adb<s-memory-mingw.adb \
1595   s-taspri.ads<s-taspri-mingw.ads \
1596   s-tasinf.adb<s-tasinf-mingw.adb \
1597   s-tasinf.ads<s-tasinf-mingw.ads \
1598   g-bytswa.adb<g-bytswa-x86.adb \
1599   g-socthi.ads<g-socthi-mingw.ads \
1600   g-socthi.adb<g-socthi-mingw.adb \
1601   g-stsifd.adb<g-stsifd-sockets.adb \
1602   g-soliop.ads<g-soliop-mingw.ads
1603
1604   ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
1605     LIBGNAT_TARGET_PAIRS += \
1606     s-intman.adb<s-intman-dummy.adb \
1607     s-osinte.ads<s-osinte-rtx.ads \
1608     s-osprim.adb<s-osprim-rtx.adb \
1609     s-taprop.adb<s-taprop-rtx.adb
1610
1611     EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
1612
1613     ifeq ($(strip $(filter-out rtx_w32,$(THREAD_KIND))),)
1614        LIBGNAT_TARGET_PAIRS += system.ads<system-rtx.ads
1615
1616        EH_MECHANISM=-gcc
1617     else
1618        LIBGNAT_TARGET_PAIRS += \
1619        system.ads<system-rtx-rtss.ads \
1620        s-parame.adb<s-parame-vxworks.adb
1621
1622        EH_MECHANISM=
1623     endif
1624
1625   else
1626     LIBGNAT_TARGET_PAIRS += \
1627     a-exetim.adb<a-exetim-mingw.adb \
1628     a-exetim.ads<a-exetim-mingw.ads \
1629     a-intnam.ads<a-intnam-mingw.ads \
1630     g-sercom.adb<g-sercom-mingw.adb \
1631     s-interr.adb<s-interr-sigaction.adb \
1632     s-intman.adb<s-intman-mingw.adb \
1633     s-osinte.ads<s-osinte-mingw.ads \
1634     s-osprim.adb<s-osprim-mingw.adb \
1635     s-taprop.adb<s-taprop-mingw.adb
1636
1637     ifeq ($(strip $(filter-out x86_64%,$(arch))),)
1638       ifeq ($(strip $(MULTISUBDIR)),/32)
1639         LIBGNAT_TARGET_PAIRS += \
1640           system.ads<system-mingw.ads
1641       else
1642         LIBGNAT_TARGET_PAIRS += \
1643           system.ads<system-mingw-x86_64.ads
1644       endif
1645     else
1646       ifeq ($(strip $(MULTISUBDIR)),/64)
1647         LIBGNAT_TARGET_PAIRS += \
1648           system.ads<system-mingw-x86_64.ads
1649       else
1650         LIBGNAT_TARGET_PAIRS += \
1651           system.ads<system-mingw.ads
1652       endif
1653     endif
1654
1655     EXTRA_GNATRTL_NONTASKING_OBJS = \
1656         s-win32.o s-winext.o g-regist.o g-sse.o g-ssvety.o
1657     EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
1658
1659     MISCLIB = -lws2_32
1660
1661     # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
1662     # auto-import support for array/record will be done.
1663     GNATLIB_SHARED = gnatlib-shared-win32
1664   endif
1665
1666   TOOLS_TARGET_PAIRS= \
1667   mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
1668   indepsw.adb<indepsw-mingw.adb
1669
1670   GMEM_LIB = gmemlib
1671   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1672   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1673   soext = .dll
1674   LIBRARY_VERSION := $(LIB_VERSION)
1675 endif
1676
1677 ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
1678   LIBGNAT_TARGET_PAIRS = \
1679   a-intnam.ads<a-intnam-linux.ads \
1680   s-inmaop.adb<s-inmaop-posix.adb \
1681   s-intman.adb<s-intman-posix.adb \
1682   s-linux.ads<s-linux.ads \
1683   s-osinte.adb<s-osinte-posix.adb \
1684   s-osinte.ads<s-osinte-linux.ads \
1685   s-osprim.adb<s-osprim-posix.adb \
1686   s-taprop.adb<s-taprop-linux.adb \
1687   s-tasinf.ads<s-tasinf-linux.ads \
1688   s-tasinf.adb<s-tasinf-linux.adb \
1689   s-taspri.ads<s-taspri-posix.ads \
1690   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1691   system.ads<system-linux-mips.ads
1692
1693   EH_MECHANISM=-gcc
1694   THREADSLIB = -lpthread
1695   GNATLIB_SHARED = gnatlib-shared-dual
1696   GMEM_LIB = gmemlib
1697   LIBRARY_VERSION := $(LIB_VERSION)
1698 endif
1699
1700 ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
1701   LIBGNAT_TARGET_PAIRS_COMMON = \
1702   a-intnam.ads<a-intnam-linux.ads \
1703   s-inmaop.adb<s-inmaop-posix.adb \
1704   s-intman.adb<s-intman-posix.adb \
1705   s-linux.ads<s-linux-mipsel.ads \
1706   s-osinte.adb<s-osinte-posix.adb \
1707   s-osinte.ads<s-osinte-linux.ads \
1708   s-osprim.adb<s-osprim-posix.adb \
1709   s-taprop.adb<s-taprop-linux.adb \
1710   s-tasinf.ads<s-tasinf-linux.ads \
1711   s-tasinf.adb<s-tasinf-linux.adb \
1712   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1713   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1714   g-sercom.adb<g-sercom-linux.adb
1715
1716   LIBGNAT_TARGET_PAIRS_32 = \
1717   system.ads<system-linux-mipsel.ads
1718
1719   LIBGNAT_TARGET_PAIRS_64 = \
1720   system.ads<system-linux-mips64el.ads
1721
1722   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1723     LIBGNAT_TARGET_PAIRS = \
1724     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1725   else
1726     LIBGNAT_TARGET_PAIRS = \
1727     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1728   endif
1729
1730   TOOLS_TARGET_PAIRS =  \
1731     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1732     indepsw.adb<indepsw-gnu.adb
1733
1734   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1735   EH_MECHANISM=-gcc
1736   THREADSLIB = -lpthread
1737   GNATLIB_SHARED = gnatlib-shared-dual
1738   GMEM_LIB = gmemlib
1739   LIBRARY_VERSION := $(LIB_VERSION)
1740 endif
1741
1742 ifeq ($(strip $(filter-out mips64el linux%,$(arch) $(osys))),)
1743   LIBGNAT_TARGET_PAIRS_COMMON = \
1744   a-intnam.ads<a-intnam-linux.ads \
1745   s-inmaop.adb<s-inmaop-posix.adb \
1746   s-intman.adb<s-intman-posix.adb \
1747   s-linux.ads<s-linux-mipsel.ads \
1748   s-osinte.adb<s-osinte-posix.adb \
1749   s-osinte.ads<s-osinte-linux.ads \
1750   s-osprim.adb<s-osprim-posix.adb \
1751   s-taprop.adb<s-taprop-linux.adb \
1752   s-tasinf.ads<s-tasinf-linux.ads \
1753   s-tasinf.adb<s-tasinf-linux.adb \
1754   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1755   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1756   g-sercom.adb<g-sercom-linux.adb
1757
1758   LIBGNAT_TARGET_PAIRS_32 = \
1759   system.ads<system-linux-mipsel.ads
1760
1761   LIBGNAT_TARGET_PAIRS_64 = \
1762   system.ads<system-linux-mips64el.ads
1763
1764   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1765     LIBGNAT_TARGET_PAIRS = \
1766     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1767   else
1768     LIBGNAT_TARGET_PAIRS = \
1769     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1770   endif
1771
1772   TOOLS_TARGET_PAIRS =  \
1773     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1774     indepsw.adb<indepsw-gnu.adb
1775
1776   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1777   EH_MECHANISM=-gcc
1778   THREADSLIB = -lpthread
1779   GNATLIB_SHARED = gnatlib-shared-dual
1780   GMEM_LIB = gmemlib
1781   LIBRARY_VERSION := $(LIB_VERSION)
1782 endif
1783
1784 ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
1785   LIBGNAT_TARGET_PAIRS_COMMON = \
1786   a-exetim.adb<a-exetim-posix.adb \
1787   a-exetim.ads<a-exetim-default.ads \
1788   a-intnam.ads<a-intnam-linux.ads \
1789   s-inmaop.adb<s-inmaop-posix.adb \
1790   s-intman.adb<s-intman-posix.adb \
1791   s-linux.ads<s-linux.ads \
1792   s-osinte.adb<s-osinte-posix.adb \
1793   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1794   g-sercom.adb<g-sercom-linux.adb \
1795   $(ATOMICS_TARGET_PAIRS)
1796
1797   ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
1798     LIBGNAT_TARGET_PAIRS = \
1799       $(LIBGNAT_TARGET_PAIRS_COMMON)
1800
1801     LIBGNAT_TARGET_PAIRS += \
1802     s-osinte.ads<s-osinte-linux-xenomai.ads \
1803     s-osprim.adb<s-osprim-linux-xenomai.adb \
1804     s-taprop.adb<s-taprop-linux-xenomai.adb \
1805     s-taspri.ads<s-taspri-linux-xenomai.ads \
1806     system.ads<system-linux-ppc-xenomai.ads
1807   else
1808     LIBGNAT_TARGET_PAIRS_32 = \
1809     system.ads<system-linux-ppc.ads
1810
1811     LIBGNAT_TARGET_PAIRS_64 = \
1812     system.ads<system-linux-ppc64.ads
1813
1814     ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1815       LIBGNAT_TARGET_PAIRS = \
1816       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1817     else
1818       LIBGNAT_TARGET_PAIRS = \
1819       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1820     endif
1821
1822     LIBGNAT_TARGET_PAIRS += \
1823     s-osinte.ads<s-osinte-linux.ads \
1824     s-osprim.adb<s-osprim-posix.adb \
1825     s-taprop.adb<s-taprop-linux.adb \
1826     s-tasinf.ads<s-tasinf-linux.ads \
1827     s-tasinf.adb<s-tasinf-linux.adb \
1828     s-taspri.ads<s-taspri-posix-noaltstack.ads
1829   endif
1830
1831   TOOLS_TARGET_PAIRS =  \
1832     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1833     indepsw.adb<indepsw-gnu.adb
1834
1835   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
1836   EH_MECHANISM=-gcc
1837   THREADSLIB = -lpthread -lrt
1838   GNATLIB_SHARED = gnatlib-shared-dual
1839   GMEM_LIB = gmemlib
1840   LIBRARY_VERSION := $(LIB_VERSION)
1841 endif
1842
1843 ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) $(osys)-$(word 4,$(targ)))),)
1844   LIBGNAT_TARGET_PAIRS = \
1845   a-intnam.ads<a-intnam-linux.ads \
1846   s-inmaop.adb<s-inmaop-posix.adb \
1847   s-intman.adb<s-intman-posix.adb \
1848   s-linux.ads<s-linux.ads \
1849   s-osinte.adb<s-osinte-posix.adb \
1850   s-osinte.ads<s-osinte-linux.ads \
1851   s-osprim.adb<s-osprim-posix.adb \
1852   s-taprop.adb<s-taprop-linux.adb \
1853   s-tasinf.ads<s-tasinf-linux.ads \
1854   s-tasinf.adb<s-tasinf-linux.adb \
1855   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1856   s-tpopsp.adb<s-tpopsp-posix-foreign.adb
1857
1858   ifeq ($(strip $(filter-out arm%b,$(arch))),)
1859     LIBGNAT_TARGET_PAIRS += \
1860     system.ads<system-linux-armeb.ads
1861   else
1862     LIBGNAT_TARGET_PAIRS += \
1863     system.ads<system-linux-armel.ads
1864   endif
1865
1866   TOOLS_TARGET_PAIRS =  \
1867     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1868     indepsw.adb<indepsw-gnu.adb
1869
1870   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1871   EH_MECHANISM=
1872   THREADSLIB = -lpthread
1873   GNATLIB_SHARED = gnatlib-shared-dual
1874   GMEM_LIB = gmemlib
1875   LIBRARY_VERSION := $(LIB_VERSION)
1876 endif
1877
1878 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
1879   LIBGNAT_TARGET_PAIRS_COMMON = \
1880   a-intnam.ads<a-intnam-linux.ads \
1881   s-inmaop.adb<s-inmaop-posix.adb \
1882   s-intman.adb<s-intman-posix.adb \
1883   s-linux.ads<s-linux-sparc.ads \
1884   s-osinte.adb<s-osinte-posix.adb \
1885   s-osinte.ads<s-osinte-linux.ads \
1886   s-osprim.adb<s-osprim-posix.adb \
1887   s-taprop.adb<s-taprop-linux.adb \
1888   s-tasinf.ads<s-tasinf-linux.ads \
1889   s-tasinf.adb<s-tasinf-linux.adb \
1890   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1891   s-tpopsp.adb<s-tpopsp-posix-foreign.adb
1892
1893   LIBGNAT_TARGET_PAIRS_32 = \
1894   g-trasym.ads<g-trasym-unimplemented.ads \
1895   g-trasym.adb<g-trasym-unimplemented.adb \
1896   system.ads<system-linux-sparc.ads
1897
1898   LIBGNAT_TARGET_PAIRS_64 = \
1899   system.ads<system-linux-sparcv9.ads
1900
1901   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1902     LIBGNAT_TARGET_PAIRS = \
1903     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1904   else
1905     LIBGNAT_TARGET_PAIRS = \
1906     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1907   endif
1908
1909   TOOLS_TARGET_PAIRS =  \
1910     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1911     indepsw.adb<indepsw-gnu.adb
1912
1913   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1914   EH_MECHANISM=-gcc
1915   THREADSLIB = -lpthread
1916   GNATLIB_SHARED = gnatlib-shared-dual
1917   GMEM_LIB = gmemlib
1918   LIBRARY_VERSION := $(LIB_VERSION)
1919 endif
1920
1921 ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
1922   LIBGNAT_TARGET_PAIRS = \
1923   a-intnam.ads<a-intnam-linux.ads \
1924   s-inmaop.adb<s-inmaop-posix.adb \
1925   s-intman.adb<s-intman-posix.adb \
1926   s-linux.ads<s-linux-hppa.ads \
1927   s-osinte.adb<s-osinte-posix.adb \
1928   s-osinte.ads<s-osinte-linux.ads \
1929   s-osprim.adb<s-osprim-posix.adb \
1930   s-taprop.adb<s-taprop-linux.adb \
1931   s-tasinf.ads<s-tasinf-linux.ads \
1932   s-tasinf.adb<s-tasinf-linux.adb \
1933   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1934   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1935   g-trasym.ads<g-trasym-unimplemented.ads \
1936   g-trasym.adb<g-trasym-unimplemented.adb \
1937   system.ads<system-linux-hppa.ads
1938
1939   TOOLS_TARGET_PAIRS =  \
1940     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1941     indepsw.adb<indepsw-gnu.adb
1942
1943   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1944   EH_MECHANISM=-gcc
1945   THREADSLIB = -lpthread
1946   GNATLIB_SHARED = gnatlib-shared-dual
1947   GMEM_LIB = gmemlib
1948   LIBRARY_VERSION := $(LIB_VERSION)
1949 endif
1950
1951 ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
1952   LIBGNAT_TARGET_PAIRS = \
1953   a-intnam.ads<a-intnam-linux.ads \
1954   s-inmaop.adb<s-inmaop-posix.adb \
1955   s-intman.adb<s-intman-posix.adb \
1956   s-linux.ads<s-linux.ads \
1957   s-osinte.adb<s-osinte-posix.adb \
1958   s-osinte.ads<s-osinte-linux.ads \
1959   s-osprim.adb<s-osprim-posix.adb \
1960   s-taprop.adb<s-taprop-linux.adb \
1961   s-tasinf.ads<s-tasinf-linux.ads \
1962   s-tasinf.adb<s-tasinf-linux.adb \
1963   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1964   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1965   system.ads<system-linux-sh4.ads
1966
1967   TOOLS_TARGET_PAIRS =  \
1968     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1969     indepsw.adb<indepsw-linux.adb
1970  
1971   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1972   EH_MECHANISM=-gcc
1973   MISCLIB=
1974   THREADSLIB = -lpthread
1975   GNATLIB_SHARED = gnatlib-shared-dual
1976   GMEM_LIB = gmemlib
1977   LIBRARY_VERSION := $(LIB_VERSION)
1978 endif
1979
1980 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1981   LIBGNAT_TARGET_PAIRS = \
1982   a-exetim.adb<a-exetim-posix.adb \
1983   a-exetim.ads<a-exetim-default.ads \
1984   a-intnam.ads<a-intnam-linux.ads \
1985   a-numaux.ads<a-numaux-libc-x86.ads \
1986   s-inmaop.adb<s-inmaop-posix.adb \
1987   s-intman.adb<s-intman-posix.adb \
1988   s-linux.ads<s-linux.ads \
1989   s-osinte.ads<s-osinte-linux.ads \
1990   s-osinte.adb<s-osinte-posix.adb \
1991   s-osprim.adb<s-osprim-posix.adb \
1992   s-taprop.adb<s-taprop-linux.adb \
1993   s-tasinf.ads<s-tasinf-linux.ads \
1994   s-tasinf.adb<s-tasinf-linux.adb \
1995   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1996   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1997   g-sercom.adb<g-sercom-linux.adb \
1998   system.ads<system-linux-ia64.ads \
1999   $(ATOMICS_TARGET_PAIRS)
2000
2001   TOOLS_TARGET_PAIRS =  \
2002     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2003     indepsw.adb<indepsw-gnu.adb
2004
2005   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
2006   EH_MECHANISM=-gcc
2007   MISCLIB=
2008   THREADSLIB=-lpthread -lrt
2009   GNATLIB_SHARED=gnatlib-shared-dual
2010   GMEM_LIB = gmemlib
2011   LIBRARY_VERSION := $(LIB_VERSION)
2012 endif
2013
2014 ifeq ($(strip $(filter-out ia64% hp hpux%,$(targ))),)
2015   LIBGNAT_TARGET_PAIRS = \
2016   a-intnam.ads<a-intnam-hpux.ads \
2017   s-inmaop.adb<s-inmaop-posix.adb \
2018   s-intman.adb<s-intman-posix.adb \
2019   s-osinte.adb<s-osinte-posix.adb \
2020   s-osinte.ads<s-osinte-hpux.ads \
2021   s-osprim.adb<s-osprim-posix.adb \
2022   s-taprop.adb<s-taprop-posix.adb \
2023   s-taspri.ads<s-taspri-posix-noaltstack.ads \
2024   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2025   system.ads<system-hpux-ia64.ads \
2026   $(ATOMICS_TARGET_PAIRS)
2027
2028   TOOLS_TARGET_PAIRS = \
2029   mlib-tgt-specific.adb<mlib-tgt-specific-ia64-hpux.adb
2030
2031   MISCLIB=
2032   THREADSLIB=-lpthread
2033   GNATLIB_SHARED=gnatlib-shared-dual
2034   GMEM_LIB = gmemlib
2035   soext = .sl
2036   SO_OPTS = -Wl,+h,
2037   LIBRARY_VERSION := $(LIB_VERSION)
2038 endif
2039
2040 ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
2041   LIBGNAT_TARGET_PAIRS = \
2042   a-intnam.ads<a-intnam-linux.ads \
2043   s-inmaop.adb<s-inmaop-posix.adb \
2044   s-intman.adb<s-intman-posix.adb \
2045   s-linux.ads<s-linux-alpha.ads \
2046   s-osinte.ads<s-osinte-linux.ads \
2047   s-osinte.adb<s-osinte-posix.adb \
2048   s-osprim.adb<s-osprim-posix.adb \
2049   s-taprop.adb<s-taprop-linux.adb \
2050   s-tasinf.ads<s-tasinf-linux.ads \
2051   s-tasinf.adb<s-tasinf-linux.adb \
2052   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2053   s-taspri.ads<s-taspri-posix-noaltstack.ads \
2054   g-trasym.ads<g-trasym-unimplemented.ads \
2055   g-trasym.adb<g-trasym-unimplemented.adb \
2056   system.ads<system-linux-alpha.ads \
2057   $(ATOMICS_TARGET_PAIRS)
2058
2059   TOOLS_TARGET_PAIRS =  \
2060     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2061     indepsw.adb<indepsw-gnu.adb
2062
2063   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
2064   EH_MECHANISM=-gcc
2065   MISCLIB=
2066   THREADSLIB=-lpthread
2067   GNATLIB_SHARED=gnatlib-shared-dual
2068   LIBRARY_VERSION := $(LIB_VERSION)
2069 endif
2070
2071 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
2072   LIBGNAT_TARGET_PAIRS = \
2073   a-exetim.adb<a-exetim-posix.adb \
2074   a-exetim.ads<a-exetim-default.ads \
2075   a-intnam.ads<a-intnam-linux.ads \
2076   a-numaux.adb<a-numaux-x86.adb \
2077   a-numaux.ads<a-numaux-x86.ads \
2078   s-inmaop.adb<s-inmaop-posix.adb \
2079   s-intman.adb<s-intman-posix.adb \
2080   s-linux.ads<s-linux.ads \
2081   s-osinte.ads<s-osinte-linux.ads \
2082   s-osinte.adb<s-osinte-posix.adb \
2083   s-osprim.adb<s-osprim-posix.adb \
2084   s-taprop.adb<s-taprop-linux.adb \
2085   s-tasinf.ads<s-tasinf-linux.ads \
2086   s-tasinf.adb<s-tasinf-linux.adb \
2087   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2088   s-taspri.ads<s-taspri-posix.ads \
2089   g-sercom.adb<g-sercom-linux.adb \
2090   system.ads<system-linux-x86_64.ads \
2091   $(ATOMICS_TARGET_PAIRS)
2092
2093   TOOLS_TARGET_PAIRS =  \
2094     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
2095     indepsw.adb<indepsw-gnu.adb
2096
2097   EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
2098   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o a-exetim.o
2099   EH_MECHANISM=-gcc
2100   THREADSLIB=-lpthread -lrt
2101   GNATLIB_SHARED=gnatlib-shared-dual
2102   GMEM_LIB = gmemlib
2103   LIBRARY_VERSION := $(LIB_VERSION)
2104 endif
2105
2106 ifeq ($(strip $(filter-out darwin%,$(osys))),)
2107   SO_OPTS = -Wl,-flat_namespace -shared-libgcc
2108   ifeq ($(strip $(filter-out %86,$(arch))),)
2109     LIBGNAT_TARGET_PAIRS = \
2110     a-intnam.ads<a-intnam-darwin.ads \
2111     i-forbla.adb<i-forbla-darwin.adb \
2112     s-inmaop.adb<s-inmaop-posix.adb \
2113     s-intman.adb<s-intman-susv3.adb \
2114     s-osinte.adb<s-osinte-darwin.adb \
2115     s-osinte.ads<s-osinte-darwin.ads \
2116     s-osprim.adb<s-osprim-darwin.adb \
2117     s-taprop.adb<s-taprop-posix.adb \
2118     s-taspri.ads<s-taspri-posix.ads \
2119     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2120     g-trasym.ads<g-trasym-unimplemented.ads \
2121     g-trasym.adb<g-trasym-unimplemented.adb \
2122     a-numaux.ads<a-numaux-x86.ads \
2123     a-numaux.adb<a-numaux-x86.adb
2124     ifeq ($(strip $(MULTISUBDIR)),/x86_64)
2125       LIBGNAT_TARGET_PAIRS += \
2126       system.ads<system-darwin-x86_64.ads
2127       SO_OPTS += -m64
2128     else
2129       LIBGNAT_TARGET_PAIRS += \
2130       system.ads<system-darwin-x86.ads
2131     endif
2132   endif
2133
2134   ifeq ($(strip $(filter-out %x86_64,$(arch))),)
2135     LIBGNAT_TARGET_PAIRS = \
2136     a-intnam.ads<a-intnam-darwin.ads \
2137     i-forbla.adb<i-forbla-darwin.adb \
2138     s-inmaop.adb<s-inmaop-posix.adb \
2139     s-intman.adb<s-intman-susv3.adb \
2140     s-osinte.adb<s-osinte-darwin.adb \
2141     s-osinte.ads<s-osinte-darwin.ads \
2142     s-osprim.adb<s-osprim-darwin.adb \
2143     s-taprop.adb<s-taprop-posix.adb \
2144     s-taspri.ads<s-taspri-posix.ads \
2145     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2146     g-trasym.ads<g-trasym-unimplemented.ads \
2147     g-trasym.adb<g-trasym-unimplemented.adb \
2148     a-numaux.ads<a-numaux-x86.ads \
2149     a-numaux.adb<a-numaux-x86.adb \
2150     $(ATOMICS_TARGET_PAIRS)
2151     ifeq ($(strip $(MULTISUBDIR)),/i386)
2152       LIBGNAT_TARGET_PAIRS += \
2153       system.ads<system-darwin-x86.ads
2154       SO_OPTS += -m32
2155     else
2156       LIBGNAT_TARGET_PAIRS += \
2157       system.ads<system-darwin-x86_64.ads
2158     endif
2159   endif
2160
2161   ifeq ($(strip $(filter-out powerpc%,$(arch))),)
2162     LIBGNAT_TARGET_PAIRS = \
2163     a-intnam.ads<a-intnam-darwin.ads \
2164     i-forbla.adb<i-forbla-darwin.adb \
2165     s-inmaop.adb<s-inmaop-posix.adb \
2166     s-intman.adb<s-intman-posix.adb \
2167     s-osinte.adb<s-osinte-darwin.adb \
2168     s-osinte.ads<s-osinte-darwin.ads \
2169     s-osprim.adb<s-osprim-posix.adb \
2170     s-taprop.adb<s-taprop-posix.adb \
2171     s-taspri.ads<s-taspri-posix.ads \
2172     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
2173     a-numaux.ads<a-numaux-darwin.ads \
2174     a-numaux.adb<a-numaux-darwin.adb \
2175     g-trasym.ads<g-trasym-unimplemented.ads \
2176     g-trasym.adb<g-trasym-unimplemented.adb \
2177     system.ads<system-darwin-ppc.ads
2178   endif
2179
2180   TOOLS_TARGET_PAIRS =  \
2181     mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb
2182
2183   EH_MECHANISM=-gcc
2184   GNATLIB_SHARED = gnatlib-shared-darwin
2185   RANLIB = ranlib -c
2186   GMEM_LIB = gmemlib
2187   LIBRARY_VERSION := $(LIB_VERSION)
2188   soext = .dylib
2189   GCC_LINK_FLAGS=
2190 endif
2191
2192 ifneq ($(EH_MECHANISM),)
2193   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
2194   EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
2195   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
2196 endif
2197
2198 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
2199 # explicitly already. The base files (a-except.ad?) are used only for building
2200 # the compiler and other basic tools.
2201 # These base versions lack Ada 2005 additions which would cause bootstrap
2202 # problems if included in the compiler and other basic tools.
2203
2204 ifeq ($(filter a-except%,$(LIBGNAT_TARGET_PAIRS)),)
2205   LIBGNAT_TARGET_PAIRS += \
2206     a-except.ads<a-except-2005.ads \
2207     a-except.adb<a-except-2005.adb
2208 endif
2209
2210 # The runtime library for gnat comprises two directories.  One contains the
2211 # Ada source files that the compiler (gnat1) needs -- these files are listed
2212 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
2213 # corresponding .ali files for the parts written in Ada, libgnat.a for
2214 # the parts of the runtime written in C, and libgthreads.a for the pthreads
2215 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
2216 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
2217 # go into the directory.  The pthreads emulation is built in the threads
2218 # subdirectory and copied.
2219 LIBGNAT_SRCS = adadecode.c adadecode.h adaint.c adaint.h        \
2220   argv.c cio.c cstreams.c errno.c exit.c cal.c ctrl_c.c env.c env.h     \
2221   arit64.c raise.h raise.c sysdep.c aux-io.c init.c initialize.c        \
2222   locales.c seh_init.c final.c tracebak.c tb-alvms.c tb-alvxw.c         \
2223   tb-gcc.c expect.c mkdir.c socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
2224
2225 LIBGNAT_OBJS = adadecode.o adaint.o argv.o cio.o cstreams.o ctrl_c.o    \
2226   errno.o exit.o env.o raise.o sysdep.o aux-io.o init.o initialize.o    \
2227   locales.o seh_init.o cal.o arit64.o final.o tracebak.o expect.o       \
2228   mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
2229
2230 # NOTE ??? - when the -I option for compiling Ada code is made to work,
2231 #  the library installation will change and there will be a
2232 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
2233 #  from ADA_INCLUDE_SRCS.
2234
2235 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
2236 # the following include file:
2237
2238 include $(fsrcdir)/ada/Makefile.rtl
2239
2240 GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o a-nllrar.o a-nlrear.o \
2241   a-nucoar.o a-nurear.o i-forbla.o i-forlap.o s-gearop.o
2242
2243 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
2244   $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
2245
2246 # Default run time files
2247
2248 ADA_INCLUDE_SRCS =\
2249  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
2250  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
2251  sequenio.ads system.ads memtrack.adb \
2252  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
2253  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
2254
2255 LIBGNAT=../$(RTSDIR)/libgnat.a
2256
2257 GCC_LINK=$(CC) $(GCC_LINK_FLAGS) $(ADA_INCLUDES)
2258
2259 # when compiling the tools, the runtime has to be first on the path so that
2260 # it hides the runtime files lying with the rest of the sources
2261 ifeq ($(TOOLSCASE),native)
2262   vpath %.ads ../$(RTSDIR) ../
2263   vpath %.adb ../$(RTSDIR) ../
2264   vpath %.c   ../$(RTSDIR) ../
2265   vpath %.h   ../$(RTSDIR) ../
2266 endif
2267
2268 # in the cross tools case, everything is compiled with the native
2269 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
2270 ifeq ($(TOOLSCASE),cross)
2271   vpath %.ads ../
2272   vpath %.adb ../
2273   vpath %.c   ../
2274   vpath %.h   ../
2275 endif
2276
2277 common-tools:
2278         $(GNATMAKE) -c -b $(ADA_INCLUDES) \
2279           --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
2280           gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
2281           gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
2282         $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
2283                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2284         $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
2285                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2286         $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
2287                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2288         $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
2289                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2290         $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
2291                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2292         $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
2293                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2294         $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
2295                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2296         $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
2297                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2298         $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
2299                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2300
2301 ../../gnatsym$(exeext): 
2302         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
2303         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
2304         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2305
2306 ../../gnatdll$(exeext): 
2307         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
2308         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
2309         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2310
2311 ../../vxaddr2line$(exeext): targext.o
2312         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
2313         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
2314         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
2315
2316 gnatmake-re:  link.o targext.o
2317         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
2318         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
2319         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
2320         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
2321                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2322
2323 # Note the use of the "mv" command in order to allow gnatlink to be linked with
2324 # with the former version of gnatlink itself which cannot override itself.
2325 gnatlink-re:  link.o targext.o
2326         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
2327         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
2328         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
2329                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2330         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
2331
2332 # Needs to be built with CC=gcc
2333 # Since the RTL should be built with the latest compiler, remove the
2334 #  stamp target in the parent directory whenever gnat1 is rebuilt
2335
2336 # Likewise for the tools
2337 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
2338         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
2339                     $(TOOLS_LIBS)
2340
2341 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
2342         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
2343                     $(TOOLS_LIBS)
2344
2345 ../stamp-gnatlib-$(RTSDIR):
2346         @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
2347         then \
2348           $(ECHO) You must first build the GNAT library: make gnatlib; \
2349           false; \
2350         else \
2351           true; \
2352         fi
2353
2354 install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
2355 #       Create the directory before deleting it, in case the directory is
2356 #       a list of directories (as it may be on VMS). This ensures we are
2357 #       deleting the right one.
2358         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2359         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2360         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2361         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2362         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2363         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
2364         for file in $(RTSDIR)/*.ali; do \
2365             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2366         done
2367         -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
2368         -cd $(RTSDIR); for file in *$(arext);do \
2369             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2370             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
2371         done
2372         -$(foreach file, $(EXTRA_ADALIB_FILES), \
2373             $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
2374         ) true
2375 #     Install the shared libraries, if any, using $(INSTALL) instead
2376 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
2377 #     for shared libraries on some targets, e.g. on HP-UX where the x
2378 #     permission is required.
2379 #     Also install the .dSYM directories if they exist (these directories
2380 #     contain the debug information for the shared libraries on darwin)
2381         for file in gnat gnarl; do \
2382            if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
2383               $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
2384                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2385            fi; \
2386            if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
2387               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
2388               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
2389            fi; \
2390            if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
2391               $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
2392                 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
2393            fi; \
2394         done
2395 # This copy must be done preserving the date on the original file.
2396         for file in $(RTSDIR)/*.ad?; do \
2397             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
2398         done
2399         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
2400         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
2401
2402 ../stamp-gnatlib2-$(RTSDIR):
2403         $(RM) $(RTSDIR)/s-*.ali
2404         $(RM) $(RTSDIR)/s-*$(objext)
2405         $(RM) $(RTSDIR)/a-*.ali
2406         $(RM) $(RTSDIR)/a-*$(objext)
2407         $(RM) $(RTSDIR)/*.ali
2408         $(RM) $(RTSDIR)/*$(objext)
2409         $(RM) $(RTSDIR)/*$(arext)
2410         $(RM) $(RTSDIR)/*$(soext)
2411         touch ../stamp-gnatlib2-$(RTSDIR)
2412         $(RM) ../stamp-gnatlib-$(RTSDIR)
2413
2414 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
2415 #       successive target commands. Although the Gnu make documentation
2416 #       implies this is true on all systems, I suspect it may not be, So care
2417 #       has been taken to allow a sed script to look for ";)" and substitue
2418 #       for ";" the appropriate character in the range of lines below
2419 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
2420
2421 # GNULLI Begin ###########################################################
2422
2423 ../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
2424         $(RMDIR) $(RTSDIR)
2425         $(MKDIR) $(RTSDIR)
2426         $(CHMOD) u+w $(RTSDIR)
2427 # Copy target independent sources
2428         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
2429           $(LN_S) $(fsrcpfx)ada/$(f) $(RTSDIR) ;) true
2430 # Remove files to be replaced by target dependent sources
2431         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2432                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
2433         for f in $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb; do \
2434           case "$$f" in \
2435             $(RTSDIR)/s-stratt-*) ;; \
2436             *) $(RM) $$f ;; \
2437           esac; \
2438         done
2439 # Copy new target dependent sources
2440         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2441                   $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \
2442                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
2443 # Copy generated target dependent sources
2444         $(RM) $(RTSDIR)/s-oscons.ads
2445         (cd $(RTSDIR); $(LN_S) ../s-oscons.ads s-oscons.ads)
2446         $(RM) ../stamp-gnatlib-$(RTSDIR)
2447         touch ../stamp-gnatlib1-$(RTSDIR)
2448
2449 # GNULLI End #############################################################
2450
2451 # Don't use semicolon separated shell commands that involve list expansions.
2452 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
2453 # line lengths in excess of 256 characters.
2454 # Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS)
2455 # is guaranteed to overflow the buffer.
2456
2457 gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
2458         $(MAKE) -C $(RTSDIR) \
2459                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2460                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2461                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
2462                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
2463                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2464                 srcdir=$(fsrcdir) \
2465                 -f ../Makefile $(LIBGNAT_OBJS)
2466         $(MAKE) -C $(RTSDIR) \
2467                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2468                 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2469                 ADA_INCLUDES="" \
2470                 CFLAGS="$(GNATLIBCFLAGS)" \
2471                 ADAFLAGS="$(GNATLIBFLAGS)" \
2472                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2473                 srcdir=$(fsrcdir) \
2474                 -f ../Makefile \
2475                 $(GNATRTL_OBJS)
2476         $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
2477         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
2478            $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
2479         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
2480         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
2481            $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
2482         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
2483         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnala$(arext) \
2484            $(addprefix $(RTSDIR)/,$(GNATRTL_LINEARALGEBRA_OBJS))
2485         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnala$(arext)
2486         ifeq ($(GMEM_LIB),gmemlib)
2487                 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
2488                   $(RTSDIR)/memtrack.o
2489                 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
2490         endif
2491         $(CHMOD) a-wx $(RTSDIR)/*.ali
2492         touch ../stamp-gnatlib-$(RTSDIR)
2493
2494 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2495 gnatlib-shared-default:
2496         $(MAKE) $(FLAGS_TO_PASS) \
2497              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2498              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2499              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2500              MULTISUBDIR="$(MULTISUBDIR)" \
2501              THREAD_KIND="$(THREAD_KIND)" \
2502              gnatlib
2503         $(RM) $(RTSDIR)/libgna*$(soext)
2504         cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
2505                 $(TARGET_LIBGCC2_CFLAGS) \
2506                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2507                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2508                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2509                 $(MISCLIB) -lm
2510         cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
2511                 $(TARGET_LIBGCC2_CFLAGS) \
2512                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2513                 $(GNATRTL_TASKING_OBJS) \
2514                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2515                 $(THREADSLIB)
2516         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2517                 libgnat$(soext)
2518         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2519                 libgnarl$(soext)
2520
2521 gnatlib-shared-dual:
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-shared-default
2529         $(MV) $(RTSDIR)/libgna*$(soext) .
2530         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2531         $(MAKE) $(FLAGS_TO_PASS) \
2532              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2533              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2534              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2535              MULTISUBDIR="$(MULTISUBDIR)" \
2536              THREAD_KIND="$(THREAD_KIND)" \
2537              gnatlib
2538         $(MV) libgna*$(soext) $(RTSDIR)
2539
2540 gnatlib-shared-dual-win32:
2541         $(MAKE) $(FLAGS_TO_PASS) \
2542              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2543              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2544              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2545              MULTISUBDIR="$(MULTISUBDIR)" \
2546              THREAD_KIND="$(THREAD_KIND)" \
2547              gnatlib-shared-win32
2548         $(MV) $(RTSDIR)/libgna*$(soext) .
2549         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2550         $(MAKE) $(FLAGS_TO_PASS) \
2551              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2552              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2553              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2554              MULTISUBDIR="$(MULTISUBDIR)" \
2555              THREAD_KIND="$(THREAD_KIND)" \
2556              gnatlib
2557         $(MV) libgna*$(soext) $(RTSDIR)
2558
2559 # ??? we need to add the option to support auto-import of arrays/records to
2560 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
2561 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
2562 # Windows.
2563 gnatlib-shared-win32:
2564         $(MAKE) $(FLAGS_TO_PASS) \
2565              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2566              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2567              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2568              MULTISUBDIR="$(MULTISUBDIR)" \
2569              THREAD_KIND="$(THREAD_KIND)" \
2570              gnatlib
2571         $(RM) $(RTSDIR)/libgna*$(soext)
2572         cd $(RTSDIR); ../../xgcc -B../../ -shared -shared-libgcc \
2573                 $(TARGET_LIBGCC2_CFLAGS) \
2574                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2575                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2576                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2577         cd $(RTSDIR); ../../xgcc -B../../ -shared -shared-libgcc \
2578                 $(TARGET_LIBGCC2_CFLAGS) \
2579                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2580                 $(GNATRTL_TASKING_OBJS) \
2581                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2582                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2583
2584 gnatlib-shared-darwin:
2585         $(MAKE) $(FLAGS_TO_PASS) \
2586              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2587              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2588              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) -fno-common" \
2589              MULTISUBDIR="$(MULTISUBDIR)" \
2590              THREAD_KIND="$(THREAD_KIND)" \
2591              gnatlib
2592         $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
2593         cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
2594                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2595                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2596                 $(SO_OPTS) \
2597                 -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2598                 $(MISCLIB) -lm
2599         cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
2600                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2601                 $(GNATRTL_TASKING_OBJS) \
2602                 $(SO_OPTS) \
2603                 -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2604                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2605         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2606                 libgnat$(soext)
2607         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2608                 libgnarl$(soext)
2609         cd $(RTSDIR); dsymutil libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2610         cd $(RTSDIR); dsymutil libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
2611
2612 gnatlib-shared-vms:
2613         $(MAKE) $(FLAGS_TO_PASS) \
2614              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2615              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2616              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2617              MULTISUBDIR="$(MULTISUBDIR)" \
2618              THREAD_KIND="$(THREAD_KIND)" \
2619              gnatlib
2620         $(RM) $(RTSDIR)/libgna*$(soext)
2621         cd $(RTSDIR) && \
2622         ../../gnatsym -s SYMVEC_$$$$.opt \
2623         $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
2624         ../../xgcc -g -B../../ -shared -shared-libgcc \
2625            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
2626            sys\$$library:trace.exe \
2627            --for-linker=/noinform \
2628            --for-linker=SYMVEC_$$$$.opt \
2629            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2630         cd $(RTSDIR) && \
2631         ../../gnatsym -s SYMVEC_$$$$.opt \
2632         $(GNATRTL_TASKING_OBJS) && \
2633         ../../xgcc -g -B../../ -shared -shared-libgcc \
2634            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2635            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2636            sys\$$library:trace.exe \
2637            --for-linker=/noinform \
2638            --for-linker=SYMVEC_$$$$.opt \
2639            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2640
2641 gnatlib-shared:
2642         $(MAKE) $(FLAGS_TO_PASS) \
2643              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2644              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2645              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2646              MULTISUBDIR="$(MULTISUBDIR)" \
2647              THREAD_KIND="$(THREAD_KIND)" \
2648              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2649              $(GNATLIB_SHARED)
2650
2651 gnatlib-sjlj:
2652         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" \
2653         THREAD_KIND="$(THREAD_KIND)" ../stamp-gnatlib1-$(RTSDIR)
2654         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2655         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2656         $(MAKE) $(FLAGS_TO_PASS) \
2657              EH_MECHANISM="" \
2658              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2659              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2660              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2661              MULTISUBDIR="$(MULTISUBDIR)" \
2662              THREAD_KIND="$(THREAD_KIND)" \
2663              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2664
2665 gnatlib-zcx:
2666         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" \
2667         THREAD_KIND="$(THREAD_KIND)" ../stamp-gnatlib1-$(RTSDIR)
2668         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2669         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2670         $(MAKE) $(FLAGS_TO_PASS) \
2671              EH_MECHANISM="-gcc" \
2672              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2673              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2674              GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
2675              MULTISUBDIR="$(MULTISUBDIR)" \
2676              THREAD_KIND="$(THREAD_KIND)" \
2677              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2678
2679 # .s files for cross-building
2680 gnat-cross: force
2681         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2682
2683 # Compiling object files from source files.
2684
2685 # Note that dependencies on obstack.h are not written
2686 # because that file is not part of GCC.
2687 # Dependencies on gvarargs.h are not written
2688 # because all that file does, when not compiling with GCC,
2689 # is include the system varargs.h.
2690
2691 b_gnatl.c : $(GNATLINK_OBJS)
2692         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2693 b_gnatl.o : b_gnatl.c
2694
2695 b_gnatm.c : $(GNATMAKE_OBJS)
2696         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2697 b_gnatm.o : b_gnatm.c
2698
2699 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2700 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2701
2702 # force no sibling call optimization on s-traceb.o so the number of stack
2703 # frames to be skipped when computing a call chain is not modified by
2704 # optimization. However we can do that only when building the runtime
2705 # (not the compiler) because the -fno-optimize-sibling-calls option exists
2706 # only in GCC 3 and above.
2707
2708 ifneq (,$(findstring xgcc,$(CC)))
2709 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
2710 else
2711 NO_SIBLING_ADAFLAGS=
2712 endif
2713
2714 s-traceb.o  : s-traceb.adb
2715         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2716               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
2717       $< $(OUTPUT_OPTION)
2718
2719 # force debugging information on s-tasdeb.o so that it is always
2720 # possible to set conditional breakpoints on tasks.
2721
2722 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
2723         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2724               $< $(OUTPUT_OPTION)
2725
2726 # force no function reordering on a-except.o because of the exclusion bounds
2727 # mechanism (see the source file for more detailed information).
2728
2729 NO_REORDER_ADAFLAGS=-fno-toplevel-reorder
2730
2731 # force debugging information on a-except.o so that it is always
2732 # possible to set conditional breakpoints on exceptions.
2733 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
2734
2735 a-except.o  : a-except.adb a-except.ads
2736         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
2737               $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2738
2739 # compile s-except.o without optimization and with debug info to let the
2740 # debugger set breakpoints and inspect subprogram parameters on exception
2741 # related events.
2742
2743 s-except.o  : s-except.adb s-except.ads
2744         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2745               $< $(OUTPUT_OPTION)
2746
2747 # force debugging information on s-assert.o so that it is always
2748 # possible to set breakpoint on assert failures.
2749
2750 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
2751         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
2752               $< $(OUTPUT_OPTION)
2753
2754 adadecode.o : adadecode.c adadecode.h
2755 aux-io.o  : aux-io.c
2756 argv.o    : argv.c
2757 cal.o     : cal.c
2758 deftarg.o : deftarg.c
2759 errno.o   : errno.c
2760 exit.o    : adaint.h exit.c
2761 expect.o  : expect.c
2762 final.o   : final.c
2763 link.o    : link.c
2764 locales.o : locales.c
2765 mkdir.o   : mkdir.c
2766 socket.o  : socket.c gsocket.h
2767 sysdep.o  : sysdep.c
2768 raise-gcc.o : raise-gcc.c raise.h
2769 raise.o   : raise.c raise.h
2770 vx_stack_info.o : vx_stack_info.c
2771
2772 cio.o     : cio.c
2773         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2774                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2775
2776 init.o    : init.c adaint.h raise.h
2777         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2778                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2779
2780 initialize.o : initialize.c raise.h
2781         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2782                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2783
2784 targext.o : targext.c
2785         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
2786                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
2787                 $< $(OUTPUT_OPTION)
2788
2789 # Need to keep the frame pointer in this file to pop the stack properly on
2790 # some targets.
2791 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
2792         $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
2793               $(INCLUDES) -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2794
2795 # In GNU Make, ignore whether `stage*' exists.
2796 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2797 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2798
2799 force: