OSDN Git Service

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