OSDN Git Service

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