OSDN Git Service

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