OSDN Git Service

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