OSDN Git Service

2c69b4a47a68d71a9e0b7ffd9b615de0c2a1d7db
[pf3gnuchains/gcc-fork.git] / gcc / ada / Makefile.in
1 # Makefile for GNU Ada Compiler (GNAT).
2 #   Copyright (C) 1994-2005 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 2, 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 COPYING.  If not, write to
18 #the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19 #Boston, MA 02110-1301, USA.
20
21 # The makefile built from this file lives in the language subdirectory.
22 # Its purpose is to provide support for:
23 #
24 # 1) recursion where necessary, and only then (building .o's), and
25 # 2) building and debugging cc1 from the language subdirectory, and
26 # 3) nothing else.
27 #
28 # The parent makefile handles all other chores, with help from the
29 # language makefile fragment, of course.
30 #
31 # The targets for external use are:
32 # all, TAGS, ???mostlyclean, ???clean.
33
34 # This makefile will only work with Gnu make.
35 # The rules are written assuming a minimum subset of tools are available:
36 #
37 # Required:
38 #      MAKE:    Only Gnu make will work.
39 #      MV:      Must accept (at least) one, maybe wildcard, source argument,
40 #               a file or directory destination, and support creation/
41 #               modification date preservation.  Gnu mv -f works.
42 #      RM:      Must accept an arbitrary number of space separated file
43 #               arguments, or one wildcard argument. Gnu rm works.
44 #      RMDIR:   Must delete a directory and all its contents. Gnu rm -rf works.
45 #      ECHO:    Must support command line redirection. Any Unix-like
46 #               shell will typically provide this, otherwise a custom version
47 #               is trivial to write.
48 #      AR:      Gnu ar works.
49 #      MKDIR:   Gnu mkdir works.
50 #      CHMOD:   Gnu chmod works.
51 #      true:    Does nothing and returns a normal successful return code.
52 #      pwd:     Prints the current directory on stdout.
53 #      cd:      Change directory.
54 #
55 # Optional:
56 #      BISON:   Gnu bison works.
57 #      FLEX:    Gnu flex works.
58 #      Other miscellaneous tools for obscure targets.
59
60 # Tell GNU make 3.79 not to run this directory in parallel.
61 # Not all of the required dependencies are present.
62 .NOTPARALLEL:
63
64 # Suppress smart makes who think they know how to automake Yacc files
65 .y.c:
66
67 # Variables that exist for you to override.
68 # See below for how to change them for certain systems.
69
70 # Various ways of specifying flags for compilations:  
71 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
72 # BOOT_CFLAGS is the value of CFLAGS to pass
73 # to the stage2 and stage3 compilations
74 # XCFLAGS is used for most compilations but not when using the GCC just built.
75 XCFLAGS =
76 CFLAGS = -g
77 BOOT_CFLAGS = -O $(CFLAGS)
78 # These exists to be overridden by the x-* and t-* files, respectively.
79 X_CFLAGS =
80 T_CFLAGS =
81
82 X_CPPFLAGS =
83 T_CPPFLAGS =
84
85 X_ADA_CFLAGS =
86 T_ADA_CFLAGS =
87
88 X_ADAFLAGS =
89 T_ADAFLAGS =
90
91 CC = cc
92 BISON = bison
93 BISONFLAGS =
94 ECHO = echo
95 LEX = flex
96 LEXFLAGS =
97 CHMOD = chmod
98 LN = ln
99 LN_S = ln -s
100 CP = cp -p
101 MV = mv -f
102 RM = rm -f
103 RMDIR = rm -rf
104 MKDIR = mkdir -p
105 AR = ar
106 AR_FLAGS = rc
107 LS = ls
108 RANLIB = @RANLIB@
109 RANLIB_FLAGS = @ranlib_flags@
110
111 SHELL = @SHELL@
112 PWD_COMMAND = $${PWDCMD-pwd}
113 # How to copy preserving the date
114 INSTALL_DATA_DATE = cp -p
115 MAKEINFO = makeinfo
116 TEXI2DVI = texi2dvi
117 GNATBIND = $(STAGE_PREFIX)gnatbind
118 GNATBIND_FLAGS = -static -x
119 ADA_CFLAGS =
120 ADAFLAGS = -W -Wall -gnatpg -gnata
121 SOME_ADAFLAGS =-gnata
122 FORCE_DEBUG_ADAFLAGS = -g
123 GNATLIBFLAGS = -gnatpg -nostdinc
124 GNATLIBCFLAGS = -g -O2
125 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
126         -DIN_RTS
127 ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
128 ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
129         $(ADAFLAGS)
130 MOST_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
131         $(SOME_ADAFLAGS)
132 THREAD_KIND = native
133 THREADSLIB =
134 GMEM_LIB =
135 MISCLIB =
136 SYMDEPS = $(LIBINTL_DEP)
137 OUTPUT_OPTION = @OUTPUT_OPTION@
138
139 objext = .o
140 exeext =
141 arext  = .a
142 soext  = .so
143 shext  =
144 hyphen = -
145
146 # Define this as & to perform parallel make on a Sequent.
147 # Note that this has some bugs, and it seems currently necessary 
148 # to compile all the gen* files first by hand to avoid erroneous results.
149 P =
150
151 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
152 # It omits XCFLAGS, and specifies -B./.
153 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
154 GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
155
156 # Tools to use when building a cross-compiler.
157 # These are used because `configure' appends `cross-make'
158 # to the makefile when making a cross-compiler.
159
160 # We don't use cross-make.  Instead we use the tools from the build tree,
161 # if they are available.
162 # program_transform_name and objdir are set by configure.in.
163 program_transform_name =
164 objdir = .
165
166 target_alias=@target_alias@
167 target=@target@
168 xmake_file = @xmake_file@
169 tmake_file = @tmake_file@
170 host_canonical=@host@
171 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
172 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
173
174 # Directory where sources are, from where we are.
175 srcdir = @srcdir@
176 VPATH = $(srcdir)
177
178 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
179 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
180 fcurdir := $(shell ${PWD_COMMAND})
181 fcurpfx := $(shell ${PWD_COMMAND})/
182
183 # Top build directory, relative to here.
184 top_builddir = ../..
185
186 # Internationalization library.
187 LIBINTL = @LIBINTL@
188 LIBINTL_DEP = @LIBINTL_DEP@
189
190 # Any system libraries needed just for GNAT.
191 SYSLIBS = @GNAT_LIBEXC@
192
193 # List of extra object files linked in with various programs.
194 EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o
195
196 # List of target dependent sources, overridden below as necessary
197 TARGET_ADA_SRCS =
198
199 # Type of tools build we are doing; default is not compiling tools.
200 TOOLSCASE =
201
202 # End of variables for you to override.
203
204 all: all.indirect
205
206 # This tells GNU Make version 3 not to put all variables in the environment.
207 .NOEXPORT:
208
209 # tmake_file and xmake_file expand to lists with entries of the form
210 # $(srcdir)/config/...  but here $(srcdir) is the ada subdirectory so we
211 # need to adjust the paths.  There can't be spaces in the subst arguments
212 # or we get spurious spaces in the actual list of files to include.
213
214 # target overrides
215 ifneq ($(tmake_file),)
216 include $(subst /config,/../config,$(tmake_file))
217 endif
218
219 # host overrides
220 ifneq ($(xmake_file),)
221 include $(subst /config,/../config,$(xmake_file))
222 endif
223 \f
224 # Now figure out from those variables how to compile and link.
225
226 all.indirect: Makefile ../gnat1$(exeext)
227
228 # IN_GCC distinguishes between code compiled into GCC itself and other
229 # programs built during a bootstrap.
230 # autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
231 INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
232
233 # This is the variable actually used when we compile.
234 LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
235 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS) \
236         $(XCFLAGS)
237
238 # Likewise.
239 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
240
241 # This is where we get libiberty.a from.
242 LIBIBERTY = ../../libiberty/libiberty.a
243
244 # How to link with both our special library facilities
245 # and the system's installed libraries.
246 LIBS = $(LIBINTL) $(LIBIBERTY) $(SYSLIBS)
247 LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY)
248 # Default is no TGT_LIB; one might be passed down or something
249 TGT_LIB =
250 TOOLS_LIBS = $(EXTRA_GNATTOOLS_OBJS) targext.o link.o $(LIBGNAT) ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB)
251
252 # Specify the directories to be searched for header files.
253 # Both . and srcdir are used, in that order,
254 # so that tm.h and config.h will be found in the compilation
255 # subdirectory rather than in the source directory.
256 INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \
257         -I$(srcdir)/../../include
258
259 ADA_INCLUDES = -I- -I. -I$(srcdir)
260
261 INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \
262         -I$(fsrcdir)/../../include -I$(fsrcdir)/..
263 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)
264
265 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
266 .SUFFIXES: .in .def
267
268 # Say how to compile Ada programs.
269 .SUFFIXES: .ada .adb .ads .asm
270
271 # Always use -I$(srcdir)/config when compiling.
272 .asm.o:
273         $(CC) -c -x assembler $< $(OUTPUT_OPTION)
274
275 .c.o:
276         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
277           $(OUTPUT_OPTION)
278
279 .adb.o:
280         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
281
282 .ads.o:
283         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
284
285 # how to regenerate this file
286 Makefile: ../config.status $(srcdir)/Makefile.in $(srcdir)/../version.c
287         cd ..; \
288         LANGUAGES="$(CONFIG_LANGUAGES)" \
289         CONFIG_HEADERS= \
290         CONFIG_FILES=ada/Makefile $(SHELL) config.status
291
292 # This tells GNU make version 3 not to export all the variables
293 # defined in this file into the environment.
294 .NOEXPORT:
295 \f
296 # Lists of files for various purposes.
297
298 GNATLINK_OBJS = gnatlink.o \
299  a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o \
300  gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o \
301  osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
302  sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
303  types.o validsw.o widechar.o
304
305 GNATMAKE_OBJS = a-except.o ali.o ali-util.o s-casuti.o \
306  alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
307  erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
308  gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
309  make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \
310  namet.o nlists.o opt.o osint.o osint-m.o output.o \
311  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 \
312  prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
313  rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
314  scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \
315  sinfo.o sinput.o sinput-c.o sinput-p.o \
316  snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \
317  table.o targparm.o tempdir.o tree_io.o types.o \
318  uintp.o  uname.o urealp.o usage.o widechar.o \
319  $(EXTRA_GNATMAKE_OBJS)
320
321 # Convert the target variable into a space separated list of architecture,
322 # manufacturer, and operating system and assign each of those to its own
323 # variable.
324
325 host:=$(subst -, ,$(host_canonical))
326 targ:=$(subst -, ,$(target))
327 arch:=$(word 1,$(targ))
328 ifeq ($(words $(targ)),2)
329   manu:=
330   osys:=$(word 2,$(targ))
331 else
332   manu:=$(word 2,$(targ))
333   osys:=$(word 3,$(targ))
334 endif
335
336 # LIBGNAT_TARGET_PAIRS is a list of pairs of filenames.
337 # The members of each pair must be separated by a '<' and no whitespace.
338 # Each pair must be separated by some amount of whitespace from the following
339 # pair.
340
341 # Non-tasking case:
342
343 LIBGNAT_TARGET_PAIRS = \
344 a-intnam.ads<a-intnam-dummy.ads \
345 s-inmaop.adb<s-inmaop-dummy.adb \
346 s-intman.adb<s-intman-dummy.adb \
347 s-osinte.ads<s-osinte-dummy.ads \
348 s-osprim.adb<s-osprim-posix.adb \
349 s-taprop.adb<s-taprop-dummy.adb \
350 s-taspri.ads<s-taspri-dummy.ads
351
352 # When using the GCC exception handling mechanism, we need to use an
353 # alternate body for a-exexpr.adb (a-exexpr-gcc.adb)
354
355 EH_MECHANISM=
356
357 # Default shared object option. Note that we rely on the fact that the "soname"
358 # option will always be present and last in this flag, so that we can have
359 # $(SO_OPTS)libgnat-x.xx
360
361 SO_OPTS = -Wl,-soname,
362
363 # Default gnatlib-shared target.
364 # By default, equivalent to gnatlib.
365 # Set to gnatlib-shared-default, gnatlib-shared-dual, or a platform specific
366 # target when supported.
367 GNATLIB_SHARED = gnatlib
368
369 # default value for gnatmake's target dependent file
370 MLIB_TGT = mlib-tgt
371
372 # By default, do not distribute prefix.o (in libgccprefix), since it is only
373 # needed by external GNAT tools such as gnatdist and Glide.
374 # Override this variable on native platforms when needed.
375 PREFIX_OBJS =
376
377 # To avoid duplicate code, use this variable to set PREFIX_OBJS when needed:
378 PREFIX_REAL_OBJS = ../prefix.o \
379   ../../libiberty/concat.o     \
380   ../../libiberty/xmalloc.o    \
381   ../../libiberty/xstrdup.o    \
382   ../../libiberty/xexit.o
383
384 LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
385
386 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
387 # $(strip STRING) removes leading and trailing spaces from STRING.
388 # If what's left is null then it's a match.
389
390 ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
391   LIBGNAT_TARGET_PAIRS = \
392   a-intnam.ads<a-intnam-vxworks.ads \
393   a-numaux.ads<a-numaux-vxworks.ads \
394   s-inmaop.adb<s-inmaop-posix.adb \
395   s-interr.adb<s-interr-vxworks.adb \
396   s-intman.ads<s-intman-vxworks.ads \
397   s-intman.adb<s-intman-vxworks.adb \
398   s-osinte.adb<s-osinte-vxworks.adb \
399   s-osinte.ads<s-osinte-vxworks.ads \
400   s-osprim.adb<s-osprim-vxworks.adb \
401   s-parame.ads<s-parame-vxworks.ads \
402   s-parame.adb<s-parame-vxworks.adb \
403   s-stchop.adb<s-stchop-vxworks.adb \
404   s-taprop.adb<s-taprop-vxworks.adb \
405   s-taspri.ads<s-taspri-vxworks.ads \
406   s-tpopsp.adb<s-tpopsp-vxworks.adb \
407   s-vxwork.ads<s-vxwork-m68k.ads \
408   g-soccon.ads<g-soccon-vxworks.ads \
409   g-socthi.ads<g-socthi-vxworks.ads \
410   g-socthi.adb<g-socthi-vxworks.adb \
411   system.ads<system-vxworks-m68k.ads
412
413   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
414
415   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
416   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
417
418   ifeq ($(strip $(filter-out yes,$(TRACE))),)
419     LIBGNAT_TARGET_PAIRS += \
420     s-traces.adb<s-traces-default.adb \
421     s-tratas.adb<s-tratas-default.adb \
422     s-trafor.adb<s-trafor-default.adb \
423     s-trafor.ads<s-trafor-default.ads \
424     s-tfsetr.adb<s-tfsetr-vxworks.adb 
425   endif
426 endif
427
428 ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
429   LIBGNAT_TARGET_PAIRS = \
430   a-intnam.ads<a-intnam-vxworks.ads \
431   a-numaux.ads<a-numaux-vxworks.ads \
432   s-inmaop.adb<s-inmaop-posix.adb \
433   s-interr.adb<s-interr-vxworks.adb \
434   s-intman.ads<s-intman-vxworks.ads \
435   s-intman.adb<s-intman-vxworks.adb \
436   s-osinte.ads<s-osinte-vxworks.ads \
437   s-osprim.adb<s-osprim-vxworks.adb \
438   s-parame.ads<s-parame-vxworks.ads \
439   s-parame.adb<s-parame-vxworks.adb \
440   s-stchop.adb<s-stchop-vxworks.adb \
441   s-taprop.adb<s-taprop-vxworks.adb \
442   s-taspri.ads<s-taspri-vxworks.ads \
443   s-vxwork.ads<s-vxwork-ppc.ads \
444   g-soccon.ads<g-soccon-vxworks.ads \
445   g-socthi.ads<g-socthi-vxworks.ads \
446   g-socthi.adb<g-socthi-vxworks.adb
447
448   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
449
450   ifeq ($(strip $(filter-out yes,$(TRACE))),)
451     LIBGNAT_TARGET_PAIRS += \
452     s-traces.adb<s-traces-default.adb \
453     s-trafor.adb<s-trafor-default.adb \
454     s-trafor.ads<s-trafor-default.ads \
455     s-tratas.adb<s-tratas-default.adb \
456     s-tfsetr.adb<s-tfsetr-vxworks.adb 
457   endif
458
459   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
460     LIBGNAT_TARGET_PAIRS += \
461     s-osinte.adb<s-osinte-vxworks-rtp.adb \
462     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
463     system.ads<system-vxworks-ppc-rtp.ads
464
465     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
466   else
467     LIBGNAT_TARGET_PAIRS += \
468     s-osinte.adb<s-osinte-vxworks.adb \
469     s-tpopsp.adb<s-tpopsp-vxworks.adb \
470     system.ads<system-vxworks-ppc.ads
471
472     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
473   endif
474
475   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
476 endif
477
478 # vxworksae / vxworks 653
479 ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
480   # target pairs for kernel + vthreads runtime
481   LIBGNAT_TARGET_PAIRS = \
482   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
483   a-intnam.ads<a-intnam-vxworks.ads \
484   a-numaux.ads<a-numaux-vxworks.ads \
485   g-io.adb<g-io-vxworks-ppc-cert.adb \
486   g-io.ads<g-io-vxworks-ppc-cert.ads \
487   s-inmaop.adb<s-inmaop-posix.adb \
488   s-interr.adb<s-interr-vxworks.adb \
489   s-intman.ads<s-intman-vxworks.ads \
490   s-intman.adb<s-intman-vxworks.adb \
491   s-osinte.adb<s-osinte-vxworks.adb \
492   s-osinte.ads<s-osinte-vxworks.ads \
493   s-osprim.adb<s-osprim-vxworks.adb \
494   s-parame.ads<s-parame-ae653.ads \
495   s-parame.adb<s-parame-vxworks.adb \
496   s-taprop.adb<s-taprop-vxworks.adb \
497   s-taspri.ads<s-taspri-vxworks.ads \
498   s-tpopsp.adb<s-tpopsp-vxworks.adb \
499   s-vxwork.ads<s-vxwork-ppc.ads \
500   g-soccon.ads<g-soccon-vxworks.ads \
501   g-socthi.ads<g-socthi-vxworks.ads \
502   g-socthi.adb<g-socthi-vxworks.adb \
503   system.ads<system-vxworks-ppc-vthread.ads
504
505   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
506
507   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
508   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
509
510   # Extra pairs for the vthreads runtime
511   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
512     LIBGNAT_TARGET_PAIRS += \
513     s-thread.adb<s-thread-ae653.adb
514     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
515   endif
516
517   ifeq ($(strip $(filter-out yes,$(TRACE))),)
518     LIBGNAT_TARGET_PAIRS += \
519     s-traces.adb<s-traces-default.adb \
520     s-trafor.adb<s-trafor-default.adb \
521     s-trafor.ads<s-trafor-default.ads \
522     s-tratas.adb<s-tratas-default.adb \
523     s-tfsetr.adb<s-tfsetr-vxworks.adb
524   endif
525 endif
526
527 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
528   LIBGNAT_TARGET_PAIRS = \
529   a-intnam.ads<a-intnam-vxworks.ads \
530   a-numaux.ads<a-numaux-vxworks.ads \
531   s-inmaop.adb<s-inmaop-posix.adb \
532   s-interr.adb<s-interr-vxworks.adb \
533   s-intman.ads<s-intman-vxworks.ads \
534   s-intman.adb<s-intman-vxworks.adb \
535   s-osinte.adb<s-osinte-vxworks.adb \
536   s-osinte.ads<s-osinte-vxworks.ads \
537   s-osprim.adb<s-osprim-vxworks.adb \
538   s-parame.ads<s-parame-vxworks.ads \
539   s-parame.adb<s-parame-vxworks.adb \
540   s-stchop.adb<s-stchop-vxworks.adb \
541   s-taprop.adb<s-taprop-vxworks.adb \
542   s-taspri.ads<s-taspri-vxworks.ads \
543   s-tpopsp.adb<s-tpopsp-vxworks.adb \
544   s-vxwork.ads<s-vxwork-sparcv9.ads \
545   g-soccon.ads<g-soccon-vxworks.ads \
546   g-socthi.ads<g-socthi-vxworks.ads \
547   g-socthi.adb<g-socthi-vxworks.adb \
548   system.ads<system-vxworks-sparcv9.ads   \
549
550   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
551
552   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
553   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
554 endif
555
556 ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
557   LIBGNAT_TARGET_PAIRS = \
558   a-intnam.ads<a-intnam-vxworks.ads \
559   i-vxwork.ads<i-vxwork-x86.ads \
560   s-inmaop.adb<s-inmaop-posix.adb \
561   s-interr.adb<s-interr-vxworks.adb \
562   s-intman.ads<s-intman-vxworks.ads \
563   s-intman.adb<s-intman-vxworks.adb \
564   a-numaux.adb<a-numaux-x86.adb \
565   a-numaux.ads<a-numaux-x86.ads \
566   s-osinte.ads<s-osinte-vxworks.ads \
567   s-osprim.adb<s-osprim-vxworks.adb \
568   s-parame.ads<s-parame-vxworks.ads \
569   s-parame.adb<s-parame-vxworks.adb \
570   s-stchop.adb<s-stchop-vxworks.adb \
571   s-taprop.adb<s-taprop-vxworks.adb \
572   s-taspri.ads<s-taspri-vxworks.ads \
573   s-vxwork.ads<s-vxwork-x86.ads \
574   g-soccon.ads<g-soccon-vxworks.ads \
575   g-socthi.ads<g-socthi-vxworks.ads \
576   g-socthi.adb<g-socthi-vxworks.adb
577
578   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
579
580   ifeq ($(strip $(filter-out yes,$(TRACE))),)
581     LIBGNAT_TARGET_PAIRS += \
582     s-traces.adb<s-traces-default.adb \
583     s-trafor.adb<s-trafor-default.adb \
584     s-trafor.ads<s-trafor-default.ads \
585     s-tratas.adb<s-tratas-default.adb \
586     s-tfsetr.adb<s-tfsetr-vxworks.adb
587   endif
588
589   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
590     LIBGNAT_TARGET_PAIRS += \
591     s-osinte.adb<s-osinte-vxworks-rtp.adb \
592     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
593     system.ads<system-vxworks-x86-rtp.ads
594
595     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
596   else
597     LIBGNAT_TARGET_PAIRS += \
598     s-osinte.adb<s-osinte-vxworks.adb \
599     s-tpopsp.adb<s-tpopsp-vxworks.adb \
600     system.ads<system-vxworks-x86.ads
601
602     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
603   endif
604
605   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
606 endif
607
608 ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
609   LIBGNAT_TARGET_PAIRS = \
610   a-intnam.ads<a-intnam-vxworks.ads \
611   a-numaux.ads<a-numaux-vxworks.ads \
612   s-inmaop.adb<s-inmaop-posix.adb \
613   s-interr.adb<s-interr-vxworks.adb \
614   s-intman.ads<s-intman-vxworks.ads \
615   s-intman.adb<s-intman-vxworks.adb \
616   s-osinte.adb<s-osinte-vxworks.adb \
617   s-osinte.ads<s-osinte-vxworks.ads \
618   s-osprim.adb<s-osprim-vxworks.adb \
619   s-parame.ads<s-parame-vxworks.ads \
620   s-parame.adb<s-parame-vxworks.adb \
621   s-stchop.adb<s-stchop-vxworks.adb \
622   s-taprop.adb<s-taprop-vxworks.adb \
623   s-taspri.ads<s-taspri-vxworks.ads \
624   s-tpopsp.adb<s-tpopsp-vxworks.adb \
625   s-vxwork.ads<s-vxwork-arm.ads \
626   g-soccon.ads<g-soccon-vxworks.ads \
627   g-socthi.ads<g-socthi-vxworks.ads \
628   g-socthi.adb<g-socthi-vxworks.adb \
629   system.ads<system-vxworks-arm.ads
630
631   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
632
633   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
634   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
635 endif
636
637 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
638   LIBGNAT_TARGET_PAIRS = \
639   a-intnam.ads<a-intnam-vxworks.ads \
640   a-numaux.ads<a-numaux-vxworks.ads \
641   s-inmaop.adb<s-inmaop-posix.adb \
642   s-interr.adb<s-interr-vxworks.adb \
643   s-intman.ads<s-intman-vxworks.ads \
644   s-intman.adb<s-intman-vxworks.adb \
645   s-osinte.adb<s-osinte-vxworks.adb \
646   s-osinte.ads<s-osinte-vxworks.ads \
647   s-osprim.adb<s-osprim-vxworks.adb \
648   s-parame.ads<s-parame-vxworks.ads \
649   s-parame.adb<s-parame-vxworks.adb \
650   s-stchop.adb<s-stchop-vxworks.adb \
651   s-taprop.adb<s-taprop-vxworks.adb \
652   s-taspri.ads<s-taspri-vxworks.ads \
653   s-tpopsp.adb<s-tpopsp-vxworks.adb \
654   s-vxwork.ads<s-vxwork-mips.ads \
655   g-soccon.ads<g-soccon-vxworks.ads \
656   g-socthi.ads<g-socthi-vxworks.ads \
657   g-socthi.adb<g-socthi-vxworks.adb \
658   system.ads<system-vxworks-mips.ads
659
660   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
661
662   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
663   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
664 endif
665
666 ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
667   LIBGNAT_TARGET_PAIRS_32 = \
668   a-intnam.ads<a-intnam-solaris.ads \
669   s-inmaop.adb<s-inmaop-posix.adb \
670   s-intman.adb<s-intman-solaris.adb \
671   s-osinte.adb<s-osinte-solaris.adb \
672   s-osinte.ads<s-osinte-solaris.ads \
673   s-osprim.adb<s-osprim-solaris.adb \
674   s-taprop.adb<s-taprop-solaris.adb \
675   s-tasinf.adb<s-tasinf-solaris.adb \
676   s-tasinf.ads<s-tasinf-solaris.ads \
677   s-taspri.ads<s-taspri-solaris.ads \
678   s-tpopsp.adb<s-tpopsp-solaris.adb \
679   g-soccon.ads<g-soccon-solaris.ads \
680   g-soliop.ads<g-soliop-solaris.ads \
681   system.ads<system-solaris-sparc.ads
682
683   LIBGNAT_TARGET_PAIRS_64 = \
684   a-intnam.ads<a-intnam-solaris.ads \
685   s-inmaop.adb<s-inmaop-posix.adb \
686   s-intman.adb<s-intman-solaris.adb \
687   s-osinte.adb<s-osinte-solaris.adb \
688   s-osinte.ads<s-osinte-solaris.ads \
689   s-osprim.adb<s-osprim-solaris.adb \
690   s-taprop.adb<s-taprop-solaris.adb \
691   s-tasinf.adb<s-tasinf-solaris.adb \
692   s-tasinf.ads<s-tasinf-solaris.ads \
693   s-taspri.ads<s-taspri-solaris.ads \
694   s-tpopsp.adb<s-tpopsp-solaris.adb \
695   g-soccon.ads<g-soccon-solaris-64.ads \
696   g-soliop.ads<g-soliop-solaris.ads \
697   system.ads<system-solaris-sparcv9.ads
698
699   ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
700     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
701   else
702     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
703   endif
704   
705   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
706
707   EH_MECHANISM=-gcc
708   THREADSLIB = -lposix4 -lthread
709   MISCLIB = -lposix4 -lnsl -lsocket
710   SO_OPTS = -Wl,-h,
711   GNATLIB_SHARED = gnatlib-shared-dual
712   GMEM_LIB = gmemlib
713   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
714   LIBRARY_VERSION := $(LIB_VERSION)
715
716   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
717     LIBGNAT_TARGET_PAIRS = \
718     a-intnam.ads<a-intnam-solaris.ads \
719     s-inmaop.adb<s-inmaop-posix.adb \
720     s-intman.adb<s-intman-posix.adb \
721     s-osinte.adb<s-osinte-posix.adb \
722     s-osinte.ads<s-osinte-solaris-posix.ads \
723     s-osprim.adb<s-osprim-solaris.adb \
724     s-taprop.adb<s-taprop-posix.adb \
725     s-taspri.ads<s-taspri-posix.ads \
726     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
727     g-soccon.ads<g-soccon-solaris.ads \
728     g-soliop.ads<g-soliop-solaris.ads \
729     system.ads<system-solaris-sparc.ads
730
731     THREADSLIB = -lposix4 -lpthread
732   endif
733
734   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
735     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
736   endif
737 endif
738
739 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
740   LIBGNAT_TARGET_PAIRS = \
741   a-numaux.adb<a-numaux-x86.adb \
742   a-numaux.ads<a-numaux-x86.ads \
743   a-intnam.ads<a-intnam-solaris.ads \
744   s-inmaop.adb<s-inmaop-posix.adb \
745   s-intman.adb<s-intman-solaris.adb \
746   s-osinte.adb<s-osinte-solaris.adb \
747   s-osinte.ads<s-osinte-solaris.ads \
748   s-osprim.adb<s-osprim-solaris.adb \
749   s-taprop.adb<s-taprop-solaris.adb \
750   s-tasinf.adb<s-tasinf-solaris.adb \
751   s-tasinf.ads<s-tasinf-solaris.ads \
752   s-taspri.ads<s-taspri-solaris.ads \
753   s-tpopsp.adb<s-tpopsp-solaris.adb \
754   g-soccon.ads<g-soccon-solaris.ads \
755   g-soliop.ads<g-soliop-solaris.ads \
756   system.ads<system-solaris-x86.ads
757
758   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
759
760   THREADSLIB = -lposix4 -lthread
761   MISCLIB = -lposix4 -lnsl -lsocket
762   SO_OPTS = -Wl,-h,
763   GNATLIB_SHARED = gnatlib-shared-dual
764   GMEM_LIB = gmemlib
765   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
766   LIBRARY_VERSION := $(LIB_VERSION)
767 endif
768
769 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
770   LIBGNAT_TARGET_PAIRS = \
771   a-intnam.ads<a-intnam-linux.ads \
772   a-numaux.adb<a-numaux-x86.adb \
773   a-numaux.ads<a-numaux-x86.ads \
774   g-soccon.ads<g-soccon-linux-x86.ads \
775   s-inmaop.adb<s-inmaop-posix.adb \
776   s-intman.adb<s-intman-posix.adb \
777   s-osinte.adb<s-osinte-posix.adb \
778   s-osinte.ads<s-osinte-linux.ads \
779   s-osprim.adb<s-osprim-posix.adb \
780   s-taprop.adb<s-taprop-linux.adb \
781   s-taspri.ads<s-taspri-posix.ads \
782   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
783   system.ads<system-linux-x86.ads
784
785   TOOLS_TARGET_PAIRS =  \
786     mlib-tgt.adb<mlib-tgt-linux.adb \
787     indepsw.adb<indepsw-gnu.adb
788
789   EH_MECHANISM=-gcc
790   THREADSLIB = -lpthread
791   GNATLIB_SHARED = gnatlib-shared-dual
792   GMEM_LIB = gmemlib
793   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
794   LIBRARY_VERSION := $(LIB_VERSION)
795 endif
796
797 ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
798   LIBGNAT_TARGET_PAIRS = \
799   a-intnam.ads<a-intnam-freebsd.ads \
800   a-numaux.adb<a-numaux-x86.adb \
801   a-numaux.ads<a-numaux-x86.ads \
802   s-inmaop.adb<s-inmaop-posix.adb \
803   s-intman.adb<s-intman-posix.adb \
804   g-soccon.ads<g-soccon-freebsd.ads \
805   s-osinte.adb<s-osinte-posix.adb \
806   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
807   s-osprim.adb<s-osprim-posix.adb \
808   s-taprop.adb<s-taprop-linux.adb \
809   s-taspri.ads<s-taspri-posix.ads \
810   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
811   system.ads<system-freebsd-x86.ads
812
813   TOOLS_TARGET_PAIRS =  \
814     mlib-tgt.adb<mlib-tgt-linux.adb \
815     indepsw.adb<indepsw-gnu.adb
816
817   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
818   THREADSLIB = -lpthread
819   GNATLIB_SHARED = gnatlib-shared-dual
820   GMEM_LIB = gmemlib
821   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
822   LIBRARY_VERSION := $(LIB_VERSION)
823 endif
824
825 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
826   LIBGNAT_TARGET_PAIRS = \
827   a-intnam.ads<a-intnam-freebsd.ads \
828   a-numaux.adb<a-numaux-x86.adb \
829   a-numaux.ads<a-numaux-x86.ads \
830   g-soccon.ads<g-soccon-freebsd.ads \
831   s-inmaop.adb<s-inmaop-posix.adb \
832   s-intman.adb<s-intman-posix.adb \
833   s-osinte.adb<s-osinte-freebsd.adb \
834   s-osinte.ads<s-osinte-freebsd.ads \
835   s-osprim.adb<s-osprim-posix.adb \
836   s-taprop.adb<s-taprop-posix.adb \
837   s-taspri.ads<s-taspri-posix.ads \
838   s-tpopsp.adb<s-tpopsp-posix.adb \
839   system.ads<system-freebsd-x86.ads
840
841   TOOLS_TARGET_PAIRS = \
842   mlib-tgt.adb<mlib-tgt-linux.adb
843   GNATLIB_SHARED = gnatlib-shared-dual
844
845   THREADSLIB= -lc_r
846   GMEM_LIB = gmemlib
847   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
848   LIBRARY_VERSION := $(LIB_VERSION)
849 endif
850
851 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
852   ifeq ($(strip $(filter-out s390x,$(arch))),)
853     LIBGNAT_TARGET_PAIRS = \
854     a-intnam.ads<a-intnam-linux.ads \
855     s-inmaop.adb<s-inmaop-posix.adb \
856     s-intman.adb<s-intman-posix.adb \
857     s-osinte.adb<s-osinte-posix.adb \
858     s-osinte.ads<s-osinte-linux.ads \
859     s-osprim.adb<s-osprim-posix.adb \
860     s-taprop.adb<s-taprop-linux.adb \
861     s-taspri.ads<s-taspri-posix.ads \
862     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
863     system.ads<system-linux-s390x.ads
864   else
865     LIBGNAT_TARGET_PAIRS = \
866     a-intnam.ads<a-intnam-linux.ads \
867     s-inmaop.adb<s-inmaop-posix.adb \
868     s-intman.adb<s-intman-posix.adb \
869     s-osinte.adb<s-osinte-posix.adb \
870     s-osinte.ads<s-osinte-linux.ads \
871     s-osprim.adb<s-osprim-posix.adb \
872     s-taprop.adb<s-taprop-linux.adb \
873     s-taspri.ads<s-taspri-posix.ads \
874     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
875     system.ads<system-linux-s390.ads
876   endif
877
878   TOOLS_TARGET_PAIRS =  \
879     mlib-tgt.adb<mlib-tgt-linux.adb
880
881   EH_MECHANISM=-gcc
882   THREADSLIB = -lpthread
883   GNATLIB_SHARED = gnatlib-shared-dual
884   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
885   LIBRARY_VERSION := $(LIB_VERSION)
886 endif
887
888 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
889   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
890     LIBGNAT_TARGET_PAIRS = \
891     a-intnam.ads<a-intnam-irix.ads \
892     s-inmaop.adb<s-inmaop-posix.adb \
893     s-intman.adb<s-intman-irix.adb \
894     s-mastop.adb<s-mastop-irix.adb \
895     s-osinte.adb<s-osinte-irix.adb \
896     s-osinte.ads<s-osinte-irix.ads \
897     s-osprim.adb<s-osprim-posix.adb \
898     s-proinf.adb<s-proinf-irix-athread.adb \
899     s-proinf.ads<s-proinf-irix-athread.ads \
900     s-taprop.adb<s-taprop-irix.adb \
901     s-tasinf.ads<s-tasinf-irix.ads \
902     s-taspri.ads<s-taspri-posix.ads \
903     s-tpopsp.adb<s-tpopsp-posix.adb \
904     s-traceb.adb<s-traceb-mastop.adb \
905     g-soccon.ads<g-soccon-irix.ads \
906     system.ads<system-irix-n32.ads
907
908     THREADSLIB = -lpthread
909     GNATLIB_SHARED = gnatlib-shared-default
910
911   else
912     LIBGNAT_TARGET_PAIRS += \
913     s-mastop.adb<s-mastop-irix.adb \
914     s-osprim.adb<s-osprim-posix.adb \
915     s-traceb.adb<s-traceb-mastop.adb \
916     g-soccon.ads<g-soccon-irix.ads \
917     system.ads<system-irix-o32.ads
918   endif
919
920   EH_MECHANISM=-gcc
921   TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-irix.adb
922   TGT_LIB = -lexc
923   MISCLIB = -lexc
924   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
925   LIBRARY_VERSION := $(LIB_VERSION)
926 endif
927
928 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
929   LIBGNAT_TARGET_PAIRS = \
930   a-excpol.adb<a-excpol-abort.adb \
931   a-intnam.ads<a-intnam-hpux.ads \
932   s-inmaop.adb<s-inmaop-posix.adb \
933   s-interr.adb<s-interr-sigaction.adb \
934   s-intman.adb<s-intman-posix.adb \
935   s-osinte.adb<s-osinte-hpux-dce.adb \
936   s-osinte.ads<s-osinte-hpux-dce.ads \
937   s-parame.ads<s-parame-hpux.ads \
938   s-osprim.adb<s-osprim-posix.adb \
939   s-taprop.adb<s-taprop-hpux-dce.adb \
940   s-taspri.ads<s-taspri-hpux-dce.ads \
941   s-tpopsp.adb<s-tpopsp-posix.adb \
942   g-soccon.ads<g-soccon-hpux.ads \
943   system.ads<system-hpux.ads
944
945   EH_MECHANISM=-gcc
946   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
947 endif
948
949 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
950   LIBGNAT_TARGET_PAIRS = \
951   a-intnam.ads<a-intnam-hpux.ads \
952   s-inmaop.adb<s-inmaop-posix.adb \
953   s-intman.adb<s-intman-posix.adb \
954   s-osinte.adb<s-osinte-posix.adb \
955   s-osinte.ads<s-osinte-hpux.ads \
956   s-parame.ads<s-parame-hpux.ads \
957   s-osprim.adb<s-osprim-posix.adb \
958   s-traceb.adb<s-traceb-hpux.adb \
959   s-taprop.adb<s-taprop-posix.adb \
960   s-taspri.ads<s-taspri-posix.ads \
961   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
962   g-soccon.ads<g-soccon-hpux.ads \
963   system.ads<system-hpux.ads
964
965   TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-hpux.adb
966   EH_MECHANISM=-gcc
967   TGT_LIB = /usr/lib/libcl.a
968   THREADSLIB = -lpthread
969   GMEM_LIB = gmemlib
970   soext = .sl
971   SO_OPTS = -Wl,+h,
972   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
973   GNATLIB_SHARED = gnatlib-shared-dual
974   LIBRARY_VERSION := $(LIB_VERSION)
975 endif
976
977 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
978   LIBGNAT_TARGET_PAIRS = \
979   a-intnam.ads<a-intnam-aix.ads \
980   s-inmaop.adb<s-inmaop-posix.adb \
981   s-intman.adb<s-intman-posix.adb \
982   s-osinte.adb<s-osinte-aix.adb \
983   s-osinte.ads<s-osinte-aix.ads \
984   s-osprim.adb<s-osprim-posix.adb \
985   s-taprop.adb<s-taprop-posix.adb \
986   s-taspri.ads<s-taspri-posix.ads \
987   s-tpopsp.adb<s-tpopsp-posix.adb \
988   g-soccon.ads<g-soccon-aix.ads \
989   system.ads<system-aix.ads
990
991   THREADSLIB = -lpthreads
992   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
993
994   TOOLS_TARGET_PAIRS = \
995   mlib-tgt.adb<mlib-tgt-aix.adb \
996   indepsw.adb<indepsw-aix.adb
997
998   GMEM_LIB = gmemlib
999 endif
1000
1001 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1002   TOOLS_TARGET_PAIRS = \
1003   mlib-tgt.adb<mlib-tgt-lynxos.adb \
1004   indepsw.adb<indepsw-gnu.adb
1005
1006   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1007     LIBGNAT_TARGET_PAIRS = \
1008     a-numaux.adb<a-numaux-x86.adb \
1009     a-numaux.ads<a-numaux-x86.ads \
1010     a-intnam.ads<a-intnam-lynxos.ads \
1011     s-inmaop.adb<s-inmaop-posix.adb \
1012     s-intman.adb<s-intman-posix.adb \
1013     s-osinte.adb<s-osinte-lynxos.adb \
1014     s-osinte.ads<s-osinte-lynxos.ads \
1015     s-osprim.adb<s-osprim-posix.adb \
1016     s-taprop.adb<s-taprop-lynxos.adb \
1017     s-taspri.ads<s-taspri-lynxos.ads \
1018     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1019     system.ads<system-lynxos-x86.ads
1020
1021     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1022
1023   else
1024     LIBGNAT_TARGET_PAIRS = \
1025     a-intnam.ads<a-intnam-lynxos.ads \
1026     s-inmaop.adb<s-inmaop-posix.adb \
1027     s-intman.adb<s-intman-posix.adb \
1028     s-osinte.adb<s-osinte-lynxos.adb \
1029     s-osinte.ads<s-osinte-lynxos.ads \
1030     s-osprim.adb<s-osprim-posix.adb \
1031     s-taprop.adb<s-taprop-lynxos.adb \
1032     s-taspri.ads<s-taspri-lynxos.ads \
1033     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1034     system.ads<system-lynxos-ppc.ads
1035   endif
1036 endif
1037
1038 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1039   LIBGNAT_TARGET_PAIRS = \
1040   a-intnam.ads<a-intnam-rtems.ads \
1041   s-inmaop.adb<s-inmaop-posix.adb \
1042   s-intman.adb<s-intman-posix.adb \
1043   s-osinte.adb<s-osinte-rtems.adb \
1044   s-osinte.ads<s-osinte-rtems.ads \
1045   s-osprim.adb<s-osprim-posix.adb \
1046   s-parame.adb<s-parame-rtems.adb \
1047   s-taprop.adb<s-taprop-posix.adb \
1048   s-taspri.ads<s-taspri-posix.ads \
1049   s-auxdec.ads<s-auxdec-empty.ads \
1050   s-auxdec.adb<s-auxdec-empty.adb \
1051   s-tpopsp.adb<s-tpopsp-rtems.adb
1052 endif
1053
1054 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1055   LIBGNAT_TARGET_PAIRS = \
1056   a-intnam.ads<a-intnam-tru64.ads \
1057   s-inmaop.adb<s-inmaop-posix.adb \
1058   s-intman.adb<s-intman-posix.adb \
1059   s-mastop.adb<s-mastop-tru64.adb \
1060   s-osinte.adb<s-osinte-tru64.adb \
1061   s-osinte.ads<s-osinte-tru64.ads \
1062   s-osprim.adb<s-osprim-unix.adb \
1063   s-taprop.adb<s-taprop-tru64.adb \
1064   s-tasinf.ads<s-tasinf-tru64.ads \
1065   s-taspri.ads<s-taspri-tru64.ads \
1066   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1067   s-traceb.adb<s-traceb-mastop.adb \
1068   g-soccon.ads<g-soccon-tru64.ads \
1069   system.ads<system-tru64.ads
1070
1071   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-tru64.adb
1072
1073   EH_MECHANISM=-gcc
1074   GMEM_LIB=gmemlib
1075   THREADSLIB = -lpthread -lmach -lexc -lrt
1076   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1077   GNATLIB_SHARED = gnatlib-shared-default
1078   LIBRARY_VERSION := $(LIB_VERSION)
1079 endif
1080
1081 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
1082
1083 soext  = .exe
1084 hyphen = _
1085 LN = cp -p
1086 LN_S = cp -p
1087
1088 .SUFFIXES: .sym
1089
1090 .o.sym: 
1091         @ gnu:[bin]vmssymvec $<
1092 endif
1093
1094 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1095 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1096   LIBGNAT_TARGET_PAIRS_AUX1 = \
1097   g-enblsp.adb<g-enblsp-vms-ia64.adb \
1098   g-trasym.adb<g-trasym-vms-ia64.adb \
1099   s-auxdec.ads<s-auxdec-vms_64.ads \
1100   s-crtl.ads<s-crtl-vms64.ads \
1101   s-osinte.adb<s-osinte-vms-ia64.adb \
1102   s-osinte.ads<s-osinte-vms-ia64.ads \
1103   s-vaflop.adb<s-vaflop-vms-ia64.adb \
1104   system.ads<system-vms_64.ads
1105
1106   LIBGNAT_TARGET_PAIRS_AUX2 = \
1107   s-parame.ads<s-parame-vms-ia64.ads
1108 else
1109 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1110   LIBGNAT_TARGET_PAIRS_AUX1 = \
1111   g-enblsp.adb<g-enblsp-vms-alpha.adb \
1112   g-trasym.adb<g-trasym-vms-alpha.adb \
1113   s-asthan.adb<s-asthan-vms-alpha.adb \
1114   s-auxdec.ads<s-auxdec-vms_64.ads \
1115   s-crtl.ads<s-crtl-vms64.ads \
1116   s-osinte.adb<s-osinte-vms.adb \
1117   s-osinte.ads<s-osinte-vms.ads \
1118   s-vaflop.adb<s-vaflop-vms-alpha.adb \
1119   system.ads<system-vms_64.ads
1120
1121 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1122   LIBGNAT_TARGET_PAIRS_AUX2 = \
1123   s-parame.ads<s-parame-vms-restrict.ads
1124 else
1125   LIBGNAT_TARGET_PAIRS_AUX2 = \
1126   s-parame.ads<s-parame-vms-alpha.ads
1127 endif
1128 endif
1129 endif
1130
1131   LIBGNAT_TARGET_PAIRS = \
1132   a-caldel.adb<a-caldel-vms.adb \
1133   a-calend.adb<a-calend-vms.adb \
1134   a-calend.ads<a-calend-vms.ads \
1135   a-dirval.adb<a-dirval-vms.adb \
1136   a-excpol.adb<a-excpol-abort.adb \
1137   a-intnam.ads<a-intnam-vms.ads \
1138   a-numaux.ads<a-numaux-vms.ads \
1139   g-expect.adb<g-expect-vms.adb \
1140   g-soccon.ads<g-soccon-vms.ads \
1141   g-socthi.ads<g-socthi-vms.ads \
1142   g-socthi.adb<g-socthi-vms.adb \
1143   i-c.ads<i-c-vms_64.ads \
1144   i-cstrin.ads<i-cstrin-vms_64.ads \
1145   i-cstrin.adb<i-cstrin-vms_64.adb \
1146   i-cpoint.ads<i-cpoint-vms_64.ads \
1147   i-cpoint.adb<i-cpoint-vms_64.adb \
1148   i-cstrea.adb<i-cstrea-vms.adb \
1149   s-inmaop.adb<s-inmaop-vms.adb \
1150   s-interr.adb<s-interr-vms.adb \
1151   s-intman.adb<s-intman-vms.adb \
1152   s-intman.ads<s-intman-vms.ads \
1153   s-osprim.adb<s-osprim-vms.adb \
1154   s-osprim.ads<s-osprim-vms.ads \
1155   s-taprop.adb<s-taprop-vms.adb \
1156   s-taspri.ads<s-taspri-vms.ads \
1157   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1158   s-tpopde.adb<s-tpopde-vms.adb \
1159   s-tpopde.ads<s-tpopde-vms.ads \
1160   s-traent.adb<s-traent-vms.adb \
1161   s-traent.ads<s-traent-vms.ads \
1162   $(LIBGNAT_TARGET_PAIRS_AUX1) \
1163   $(LIBGNAT_TARGET_PAIRS_AUX2)
1164
1165 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1166   TOOLS_TARGET_PAIRS= \
1167   mlib-tgt.adb<mlib-tgt-vms-ia64.adb \
1168   symbols.adb<symbols-vms.adb \
1169   symbols-processing.adb<symbols-processing-vms-ia64.adb
1170 else
1171   TOOLS_TARGET_PAIRS= \
1172   mlib-tgt.adb<mlib-tgt-vms-alpha.adb \
1173   symbols.adb<symbols-vms.adb \
1174   symbols-processing.adb<symbols-processing-vms-alpha.adb
1175 endif
1176
1177
1178   GMEM_LIB = gmemlib
1179   EH_MECHANISM=-gcc
1180   GNATLIB_SHARED=gnatlib-shared-vms
1181 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1182   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1183   EXTRA_LIBGNAT_OBJS=vmshandler.o
1184 endif
1185   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1186   EXTRA_GNATTOOLS = \
1187      ../../gnatlbr$(exeext)  \
1188      ../../gnatsym$(exeext)  \
1189      ../../vms_help$(exeext) \
1190      ../../gnat.hlp
1191   # This command transforms (YYYYMMDD) into YY,MMDD
1192   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
1193   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1194   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1195 endif
1196
1197 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1198   LIBGNAT_TARGET_PAIRS = \
1199   a-calend.adb<a-calend-mingw.adb \
1200   a-dirval.adb<a-dirval-mingw.adb \
1201   a-excpol.adb<a-excpol-abort.adb \
1202   a-intnam.ads<a-intnam-mingw.ads \
1203   a-numaux.adb<a-numaux-x86.adb \
1204   a-numaux.ads<a-numaux-x86.ads \
1205   s-gloloc.adb<s-gloloc-mingw.adb \
1206   s-inmaop.adb<s-inmaop-dummy.adb \
1207   s-interr.adb<s-interr-sigaction.adb \
1208   s-intman.adb<s-intman-mingw.adb \
1209   s-memory.adb<s-memory-mingw.adb \
1210   s-osinte.ads<s-osinte-mingw.ads \
1211   s-osprim.adb<s-osprim-mingw.adb \
1212   s-taprop.adb<s-taprop-mingw.adb \
1213   s-taspri.ads<s-taspri-mingw.ads \
1214   g-socthi.ads<g-socthi-mingw.ads \
1215   g-socthi.adb<g-socthi-mingw.adb \
1216   g-soccon.ads<g-soccon-mingw.ads \
1217   g-soliop.ads<g-soliop-mingw.ads \
1218   system.ads<system-mingw.ads
1219
1220   TOOLS_TARGET_PAIRS= \
1221   mlib-tgt.adb<mlib-tgt-mingw.adb \
1222   indepsw.adb<indepsw-mingw.adb
1223
1224   MISCLIB = -lwsock32
1225   GMEM_LIB = gmemlib
1226   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1227   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1228   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1229   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1230   soext = .dll
1231 # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT auto-import
1232 # support for array/record will be done.
1233   GNATLIB_SHARED = gnatlib-shared-win32
1234   LIBRARY_VERSION := $(LIB_VERSION)
1235 endif
1236
1237 ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
1238   LIBGNAT_TARGET_PAIRS = \
1239   a-intnam.ads<a-intnam-linux.ads \
1240   g-soccon.ads<g-soccon-linux-ppc.ads \
1241   s-inmaop.adb<s-inmaop-posix.adb \
1242   s-intman.adb<s-intman-posix.adb \
1243   s-osinte.adb<s-osinte-posix.adb \
1244   s-osinte.ads<s-osinte-linux.ads \
1245   s-osprim.adb<s-osprim-posix.adb \
1246   s-taprop.adb<s-taprop-linux.adb \
1247   s-taspri.ads<s-taspri-posix.ads \
1248   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1249   system.ads<system-linux-ppc.ads
1250
1251   TOOLS_TARGET_PAIRS =  \
1252     mlib-tgt.adb<mlib-tgt-linux.adb \
1253     indepsw.adb<indepsw-gnu.adb
1254
1255   EH_MECHANISM=-gcc
1256   THREADSLIB = -lpthread
1257   GNATLIB_SHARED = gnatlib-shared-dual
1258   GMEM_LIB = gmemlib
1259   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1260   LIBRARY_VERSION := $(LIB_VERSION)
1261 endif
1262
1263 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
1264   LIBGNAT_TARGET_PAIRS = \
1265   a-intnam.ads<a-intnam-linux.ads \
1266   s-inmaop.adb<s-inmaop-posix.adb \
1267   s-intman.adb<s-intman-posix.adb \
1268   s-osinte.adb<s-osinte-posix.adb \
1269   s-osinte.ads<s-osinte-linux.ads \
1270   s-osprim.adb<s-osprim-posix.adb \
1271   s-taprop.adb<s-taprop-linux.adb \
1272   s-taspri.ads<s-taspri-posix.ads \
1273   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1274   system.ads<system-linux-sparc.ads
1275
1276   TOOLS_TARGET_PAIRS =  \
1277     mlib-tgt.adb<mlib-tgt-linux.adb \
1278     indepsw.adb<indepsw-gnu.adb
1279
1280   EH_MECHANISM=-gcc
1281   THREADSLIB = -lpthread
1282   GNATLIB_SHARED = gnatlib-shared-dual
1283   GMEM_LIB = gmemlib
1284   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1285   LIBRARY_VERSION := $(LIB_VERSION)
1286 endif
1287
1288 ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
1289   LIBGNAT_TARGET_PAIRS = \
1290   a-intnam.ads<a-intnam-linux.ads \
1291   s-inmaop.adb<s-inmaop-posix.adb \
1292   s-intman.adb<s-intman-posix.adb \
1293   s-osinte.adb<s-osinte-posix.adb \
1294   s-osinte.ads<s-osinte-linux-hppa.ads \
1295   s-osprim.adb<s-osprim-posix.adb \
1296   s-taprop.adb<s-taprop-linux.adb \
1297   s-taspri.ads<s-taspri-posix.ads \
1298   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1299   system.ads<system-linux-hppa.ads
1300
1301   TOOLS_TARGET_PAIRS =  \
1302     mlib-tgt.adb<mlib-tgt-linux.adb \
1303     indepsw.adb<indepsw-gnu.adb
1304
1305   EH_MECHANISM=-gcc
1306   THREADSLIB = -lpthread
1307   GNATLIB_SHARED = gnatlib-shared-dual
1308   GMEM_LIB = gmemlib
1309   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1310   LIBRARY_VERSION := $(LIB_VERSION)
1311 endif
1312
1313 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1314   LIBGNAT_TARGET_PAIRS = \
1315   a-intnam.ads<a-intnam-linux.ads \
1316   a-numaux.ads<a-numaux-libc-x86.ads \
1317   g-soccon.ads<g-soccon-linux-64.ads \
1318   s-inmaop.adb<s-inmaop-posix.adb \
1319   s-intman.adb<s-intman-posix.adb \
1320   s-osinte.ads<s-osinte-linux.ads \
1321   s-osinte.adb<s-osinte-posix.adb \
1322   s-osprim.adb<s-osprim-posix.adb \
1323   s-taprop.adb<s-taprop-linux.adb \
1324   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1325   s-taspri.ads<s-taspri-posix.ads \
1326   system.ads<system-linux-ia64.ads
1327
1328   TOOLS_TARGET_PAIRS =  \
1329     mlib-tgt.adb<mlib-tgt-linux.adb \
1330     indepsw.adb<indepsw-gnu.adb
1331
1332   EH_MECHANISM=-gcc
1333   MISCLIB=
1334   THREADSLIB=-lpthread
1335   GNATLIB_SHARED=gnatlib-shared-dual
1336   GMEM_LIB = gmemlib
1337   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1338   LIBRARY_VERSION := $(LIB_VERSION)
1339 endif
1340
1341 ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
1342   LIBGNAT_TARGET_PAIRS = \
1343   a-intnam.ads<a-intnam-linux.ads \
1344   s-inmaop.adb<s-inmaop-posix.adb \
1345   s-intman.adb<s-intman-posix.adb \
1346   s-osinte.ads<s-osinte-linux-alpha.ads \
1347   s-osinte.adb<s-osinte-posix.adb \
1348   s-osprim.adb<s-osprim-posix.adb \
1349   s-taprop.adb<s-taprop-linux.adb \
1350   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1351   s-taspri.ads<s-taspri-posix.ads \
1352   system.ads<system-linux-alpha.ads
1353
1354   TOOLS_TARGET_PAIRS =  \
1355     mlib-tgt.adb<mlib-tgt-linux.adb \
1356     indepsw.adb<indepsw-gnu.adb
1357
1358   EH_MECHANISM=-gcc
1359   MISCLIB=
1360   THREADSLIB=-lpthread
1361   GNATLIB_SHARED=gnatlib-shared-dual
1362   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1363   LIBRARY_VERSION := $(LIB_VERSION)
1364 endif
1365
1366 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1367   LIBGNAT_TARGET_PAIRS = \
1368   a-intnam.ads<a-intnam-linux.ads \
1369   a-numaux.adb<a-numaux-x86.adb \
1370   a-numaux.ads<a-numaux-x86.ads \
1371   g-soccon.ads<g-soccon-linux-64.ads \
1372   s-inmaop.adb<s-inmaop-posix.adb \
1373   s-intman.adb<s-intman-posix.adb \
1374   s-osinte.ads<s-osinte-linux.ads \
1375   s-osinte.adb<s-osinte-posix.adb \
1376   s-osprim.adb<s-osprim-posix.adb \
1377   s-taprop.adb<s-taprop-linux.adb \
1378   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1379   s-taspri.ads<s-taspri-posix.ads \
1380   system.ads<system-linux-x86_64.ads
1381
1382   TOOLS_TARGET_PAIRS =  \
1383     mlib-tgt.adb<mlib-tgt-linux.adb \
1384     indepsw.adb<indepsw-gnu.adb
1385
1386   EH_MECHANISM=-gcc
1387   THREADSLIB=-lpthread
1388   GNATLIB_SHARED=gnatlib-shared-dual
1389   GMEM_LIB = gmemlib
1390   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1391   LIBRARY_VERSION := $(LIB_VERSION)
1392 endif
1393
1394 ifeq ($(strip $(filter-out powerpc darwin%,$(arch) $(osys))),)
1395   LIBGNAT_TARGET_PAIRS = \
1396   a-intnam.ads<a-intnam-darwin.ads \
1397   s-inmaop.adb<s-inmaop-posix.adb \
1398   s-intman.adb<s-intman-posix.adb \
1399   s-osinte.adb<s-osinte-darwin.adb \
1400   s-osinte.ads<s-osinte-darwin.ads \
1401   s-osprim.adb<s-osprim-posix.adb \
1402   s-taprop.adb<s-taprop-posix.adb \
1403   s-taspri.ads<s-taspri-posix.ads \
1404   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1405   g-soccon.ads<g-soccon-darwin.ads \
1406   a-numaux.ads<a-numaux-darwin.ads \
1407   a-numaux.adb<a-numaux-darwin.adb \
1408   system.ads<system-darwin-ppc.ads
1409
1410   TOOLS_TARGET_PAIRS =  \
1411     mlib-tgt.adb<mlib-tgt-darwin.adb
1412
1413   EH_MECHANISM=-gcc
1414   GNATLIB_SHARED = gnatlib-shared-darwin
1415   SO_OPTS = -Wl,-flat_namespace -shared-libgcc
1416   RANLIB = ranlib -c
1417   GMEM_LIB = gmemlib
1418   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1419   LIBRARY_VERSION := $(LIB_VERSION)
1420   soext = .dylib
1421 endif
1422
1423 ifneq ($(EH_MECHANISM),)
1424   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
1425   EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
1426   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
1427 endif
1428
1429 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
1430 # explicitely already. The base files (a-except.ad?) are used only for building
1431 # the compiler and other basic tools.
1432 # These base versions lack Ada 2005 additions which would cause bootstrap
1433 # problems if included in the compiler and other basic tools.
1434
1435 ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
1436   LIBGNAT_TARGET_PAIRS += \
1437     a-except.ads<a-except-2005.ads \
1438     a-except.adb<a-except-2005.adb
1439 endif
1440
1441 # The runtime library for gnat comprises two directories.  One contains the
1442 # Ada source files that the compiler (gnat1) needs -- these files are listed
1443 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1444 # corresponding .ali files for the parts written in Ada, libgnat.a for
1445 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1446 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1447 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1448 # go into the directory.  The pthreads emulation is built in the threads
1449 # subdirectory and copied.
1450 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1451   errno.c exit.c cal.c ctrl_c.c env.c env.h \
1452   raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
1453   final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
1454   socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
1455
1456 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
1457   raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o \
1458   final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
1459
1460 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1461 #  the library installation will change and there will be a
1462 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1463 #  from ADA_INCLUDE_SRCS.
1464
1465 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1466 # the following include file:
1467
1468 include $(fsrcdir)/Makefile.rtl
1469
1470 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1471   g-trasym.o memtrack.o
1472
1473 # Default run time files
1474
1475 ADA_INCLUDE_SRCS =\
1476  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1477  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1478  sequenio.ads system.ads memtrack.adb \
1479  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
1480  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads  
1481
1482 LIBGNAT=../rts/libgnat.a 
1483 GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
1484
1485 # when compiling the tools, the runtime has to be first on the path so that
1486 # it hides the runtime files lying with the rest of the sources
1487 ifeq ($(TOOLSCASE),native)
1488   vpath %.ads ../rts ../
1489   vpath %.adb ../rts ../
1490   vpath %.c   ../rts ../
1491   vpath %.h   ../rts ../
1492 endif
1493
1494 # in the cross tools case, everything is compiled with the native 
1495 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1496 ifeq ($(TOOLSCASE),cross)
1497   vpath %.ads ../
1498   vpath %.adb ../
1499   vpath %.c   ../
1500   vpath %.h   ../
1501 endif
1502
1503
1504 ../../gnatchop$(exeext): 
1505         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1506         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1507         $(GNATLINK) -v gnatchop -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1508
1509 ../../gnat$(exeext): 
1510         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1511         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1512         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1513
1514 ../../gnatkr$(exeext): 
1515         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1516         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1517         $(GNATLINK) -v gnatkr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1518
1519 ../../gnatls$(exeext): 
1520         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1521         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1522         $(GNATLINK) -v gnatls -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1523
1524 ../../gnatname$(exeext): 
1525         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1526         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1527         $(GNATLINK) -v gnatname -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1528
1529 ../../gprmake$(exeext): 
1530         $(GNATMAKE) -c $(ADA_INCLUDES) gprmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1531         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprmake
1532         $(GNATLINK) -v gprmake -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1533
1534 ../../gnatprep$(exeext): 
1535         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1536         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1537         $(GNATLINK) -v gnatprep -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1538
1539 ../../gnatxref$(exeext): 
1540         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1541         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1542         $(GNATLINK) -v gnatxref -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1543
1544 ../../gnatfind$(exeext): 
1545         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1546         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1547         $(GNATLINK) -v gnatfind -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1548
1549 ../../gnatclean$(exeext): 
1550         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1551         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1552         $(GNATLINK) -v gnatclean -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1553
1554 ../../gnatsym$(exeext): 
1555         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1556         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1557         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1558
1559 ../../gnatdll$(exeext): 
1560         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1561         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1562         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1563
1564 ../../vxaddr2line$(exeext): targext.o
1565         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1566         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1567         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
1568
1569 gnatmake-re:  link.o targext.o
1570         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1571         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1572         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1573         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1574                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1575
1576 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1577 # with the former version of gnatlink itself which cannot override itself.
1578 gnatlink-re:  link.o targext.o
1579         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1580         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1581         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1582                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1583         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1584   
1585 # Needs to be built with CC=gcc
1586 # Since the RTL should be built with the latest compiler, remove the
1587 #  stamp target in the parent directory whenever gnat1 is rebuilt
1588
1589 # Likewise for the tools
1590 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
1591         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1592                     $(TOOLS_LIBS)
1593
1594 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
1595         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1596                     $(TOOLS_LIBS)
1597
1598 ../../gnatbl$(exeext): gnatbl.o
1599         $(GCC_LINK) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1600
1601 gnatbl.o: gnatbl.c adaint.h
1602         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
1603
1604 ../stamp-gnatlib:
1605         @if [ ! -f stamp-gnatlib ] ; \
1606         then \
1607           $(ECHO) You must first build the GNAT library: make gnatlib; \
1608           false; \
1609         else \
1610           true; \
1611         fi
1612
1613 install-gnatlib: ../stamp-gnatlib
1614 #       Create the directory before deleting it, in case the directory is
1615 #       a list of directories (as it may be on VMS). This ensures we are
1616 #       deleting the right one.
1617         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1618         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1619         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1620         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1621         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1622         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1623         for file in rts/*.ali; do \
1624             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1625         done
1626         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1627         -cd rts; for file in *$(arext);do \
1628             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1629             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
1630         done
1631         -$(foreach file, $(EXTRA_ADALIB_FILES), \
1632             $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1633         ) true
1634 #     Install the shared libraries, if any, using $(INSTALL) instead
1635 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1636 #     for shared libraries on some targets, e.g. on HP-UX where the x
1637 #     permission is required.
1638         for file in gnat gnarl; do \
1639            if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
1640               $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1641                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1642            fi; \
1643            if [ -f rts/lib$${file}$(soext) ]; then \
1644               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1645               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
1646            fi; \
1647         done
1648 # This copy must be done preserving the date on the original file.
1649         for file in rts/*.adb rts/*.ads; do \
1650             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1651         done
1652         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1653         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1654
1655 ../stamp-gnatlib2:
1656         $(RM) rts/s-*.ali
1657         $(RM) rts/s-*$(objext)
1658         $(RM) rts/a-*.ali
1659         $(RM) rts/a-*$(objext)
1660         $(RM) rts/*.ali
1661         $(RM) rts/*$(objext)
1662         $(RM) rts/*$(arext)
1663         $(RM) rts/*$(soext)
1664         touch ../stamp-gnatlib2
1665         $(RM) ../stamp-gnatlib
1666
1667 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1668 #       successive target commands. Although the Gnu make documentation
1669 #       implies this is true on all systems, I suspect it may not be, So care
1670 #       has been taken to allow a sed script to look for ";)" and substitue
1671 #       for ";" the appropriate character in the range of lines below
1672 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1673
1674 # GNULLI Begin ###########################################################
1675
1676 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1677         $(RMDIR) rts
1678         $(MKDIR) rts
1679         $(CHMOD) u+w rts
1680 # Copy target independent sources
1681         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1682           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1683 # Remove files to be replaced by target dependent sources
1684         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1685                         rts/$(word 1,$(subst <, ,$(PAIR))))
1686         $(RM) rts/*-*-*.ads rts/*-*-*.adb
1687 # Copy new target dependent sources
1688         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1689                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1690                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1691         $(RM) ../stamp-gnatlib
1692         touch ../stamp-gnatlib1
1693
1694 # GNULLI End #############################################################
1695
1696 # Don't use semicolon separated shell commands that involve list expansions.
1697 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1698 # line lengths in excess of 256 characters.
1699 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1700 # is guaranteed to overflow the buffer.
1701
1702 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1703         $(MAKE) -C rts \
1704                 CC="`echo \"$(GCC_FOR_TARGET)\" \
1705                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
1706                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1707                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1708                 srcdir=$(fsrcdir) \
1709                 -f ../Makefile $(LIBGNAT_OBJS)
1710         $(MAKE) -C rts \
1711                 CC="`echo \"$(GCC_FOR_TARGET)\" \
1712                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
1713                 ADA_INCLUDES="" \
1714                 CFLAGS="$(GNATLIBCFLAGS)" \
1715                 ADAFLAGS="$(GNATLIBFLAGS)" \
1716                 srcdir=$(fsrcdir) \
1717                 -f ../Makefile \
1718                 $(GNATRTL_OBJS)
1719         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1720         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
1721            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1722         ifneq ($(PREFIX_OBJS),)
1723                 $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
1724                   $(PREFIX_OBJS);
1725                 $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
1726         endif
1727         $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
1728         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
1729            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1730         $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
1731         ifeq ($(GMEM_LIB),gmemlib)
1732                 $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
1733                   rts/memtrack.o
1734                 $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
1735         endif
1736         $(CHMOD) a-wx rts/*.ali
1737         touch ../stamp-gnatlib
1738
1739 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
1740 gnatlib-shared-default:
1741         $(MAKE) $(FLAGS_TO_PASS) \
1742              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1743              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1744              THREAD_KIND="$(THREAD_KIND)" \
1745              gnatlib
1746         $(RM) rts/libgna*$(soext)
1747         cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
1748                 $(TARGET_LIBGCC2_CFLAGS) \
1749                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1750                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1751                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1752                 $(MISCLIB) -lm
1753         cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
1754                 $(TARGET_LIBGCC2_CFLAGS) \
1755                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1756                 $(GNATRTL_TASKING_OBJS) \
1757                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1758                 $(THREADSLIB)
1759         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1760                 libgnat$(soext)
1761         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1762                 libgnarl$(soext)
1763
1764 gnatlib-shared-dual:
1765         $(MAKE) $(FLAGS_TO_PASS) \
1766              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1767              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1768              THREAD_KIND="$(THREAD_KIND)" \
1769              gnatlib-shared-default
1770         $(MV) rts/libgna*$(soext) .
1771         $(RM) ../stamp-gnatlib2
1772         $(MAKE) $(FLAGS_TO_PASS) \
1773              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1774              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1775              THREAD_KIND="$(THREAD_KIND)" \
1776              gnatlib
1777         $(MV) libgna*$(soext) rts
1778
1779 gnatlib-shared-dual-win32:
1780         $(MAKE) $(FLAGS_TO_PASS) \
1781              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1782              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1783              THREAD_KIND="$(THREAD_KIND)" \
1784              gnatlib-shared-win32
1785         $(MV) rts/libgna*$(soext) .
1786         $(RM) ../stamp-gnatlib2
1787         $(MAKE) $(FLAGS_TO_PASS) \
1788              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1789              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1790              THREAD_KIND="$(THREAD_KIND)" \
1791              gnatlib
1792         $(MV) libgna*$(soext) rts
1793
1794 # ??? we need to add the option to support auto-import of arrays/records to
1795 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
1796 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
1797 # Windows.
1798 gnatlib-shared-win32:
1799         $(MAKE) $(FLAGS_TO_PASS) \
1800              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1801              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1802              THREAD_KIND="$(THREAD_KIND)" \
1803              gnatlib
1804         $(RM) rts/libgna*$(soext)
1805         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1806                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1807                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1808                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
1809         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1810                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1811                 $(GNATRTL_TASKING_OBJS) \
1812                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1813                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
1814
1815 gnatlib-shared-darwin:
1816         $(MAKE) $(FLAGS_TO_PASS) \
1817              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1818              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
1819                             -fno-common" \
1820              THREAD_KIND="$(THREAD_KIND)" \
1821              gnatlib
1822         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
1823         cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
1824                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1825                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1826                 $(SO_OPTS) \
1827                 $(MISCLIB) -lm
1828         cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
1829                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1830                 $(GNATRTL_TASKING_OBJS) \
1831                 $(SO_OPTS) \
1832                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
1833         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1834                 libgnat$(soext)
1835         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1836                 libgnarl$(soext)
1837
1838 gnatlib-shared-vms:
1839         $(MAKE) $(FLAGS_TO_PASS) \
1840              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1841              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1842              THREAD_KIND="$(THREAD_KIND)" \
1843              gnatlib
1844         $(RM) rts/libgna*$(soext)
1845         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1846         objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
1847         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1848         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1849         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1850            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
1851            sys\$$library:trace.exe \
1852            --for-linker=/noinform \
1853            --for-linker=SYMVEC_$$$$.opt \
1854            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1855         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1856         objdump --syms $(GNATRTL_TASKING_OBJS) | \
1857         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1858         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1859         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1860            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1861            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1862            sys\$$library:trace.exe \
1863            --for-linker=/noinform \
1864            --for-linker=SYMVEC_$$$$.opt \
1865            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1866
1867 gnatlib-shared:
1868         $(MAKE) $(FLAGS_TO_PASS) \
1869              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1870              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1871              THREAD_KIND="$(THREAD_KIND)" \
1872              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
1873              $(GNATLIB_SHARED)
1874
1875 gnatlib-sjlj:
1876         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
1877         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
1878         $(MV) rts/s.ads rts/system.ads
1879         $(MAKE) $(FLAGS_TO_PASS) \
1880              EH_MECHANISM="" \
1881              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1882              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1883              THREAD_KIND="$(THREAD_KIND)" \
1884              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
1885
1886 gnatlib-zcx:
1887         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
1888         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' rts/system.ads > rts/s.ads
1889         $(MV) rts/s.ads rts/system.ads
1890         $(MAKE) $(FLAGS_TO_PASS) \
1891              EH_MECHANISM="-gcc" \
1892              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1893              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1894              THREAD_KIND="$(THREAD_KIND)" \
1895              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
1896
1897 # .s files for cross-building
1898 gnat-cross: force
1899         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
1900
1901 # Compiling object files from source files.
1902
1903 # Note that dependencies on obstack.h are not written
1904 # because that file is not part of GCC.
1905 # Dependencies on gvarargs.h are not written
1906 # because all that file does, when not compiling with GCC,
1907 # is include the system varargs.h.
1908
1909 b_gnatl.c : $(GNATLINK_OBJS)
1910         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
1911 b_gnatl.o : b_gnatl.c
1912
1913 b_gnatm.c : $(GNATMAKE_OBJS)
1914         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
1915 b_gnatm.o : b_gnatm.c
1916
1917 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
1918 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
1919
1920 # force no sibling call optimization on s-traceb.o so the number of stack
1921 # frames to be skipped when computing a call chain is not modified by
1922 # optimization. However we can do that only when building the runtime
1923 # (not the compiler) because the -fno-optimize-sibling-calls exists
1924 # only in GCC 3.
1925
1926 ifneq (,$(findstring xgcc,$(CC)))
1927 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
1928 else
1929 NO_SIBLING_ADAFLAGS=
1930 endif
1931
1932 s-traceb.o  : s-traceb.adb
1933         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
1934               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
1935       $< $(OUTPUT_OPTION)
1936
1937 # force debugging information on s-tasdeb.o so that it is always
1938 # possible to set conditional breakpoints on tasks.
1939
1940 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
1941         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
1942               $< $(OUTPUT_OPTION)
1943
1944 # force debugging information on a-except.o so that it is always
1945 # possible to set conditional breakpoints on exceptions.
1946 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
1947
1948 a-except.o  : a-except.adb a-except.ads
1949         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
1950               $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
1951
1952 # force debugging information on s-assert.o so that it is always
1953 # possible to set breakpoint on assert failures.
1954
1955 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
1956         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
1957               $< $(OUTPUT_OPTION)
1958
1959 adadecode.o : adadecode.c adadecode.h
1960 aux-io.o  : aux-io.c
1961 argv.o    : argv.c
1962 cal.o     : cal.c
1963 deftarg.o : deftarg.c
1964 errno.o   : errno.c
1965 exit.o    : adaint.h exit.c
1966 expect.o  : expect.c
1967 final.o   : final.c
1968 gmem.o    : gmem.c
1969 link.o    : link.c
1970 mkdir.o   : mkdir.c
1971 socket.o  : socket.c gsocket.h
1972 sysdep.o  : sysdep.c
1973 raise-gcc.o : raise-gcc.c raise.h
1974 raise.o   : raise.c raise.h
1975
1976 gen-soccon: gen-soccon.c gsocket.h
1977         $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1978                 -UIN_GCC -DTARGET=\"$(target_alias)\" \
1979                 $< $(OUTPUT_OPTION)
1980
1981 cio.o     : cio.c
1982         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1983                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1984
1985 init.o    : init.c adaint.h raise.h
1986         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1987                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1988
1989 initialize.o : initialize.c raise.h
1990         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1991                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1992
1993 targext.o : targext.c
1994         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1995                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
1996                 $< $(OUTPUT_OPTION)
1997
1998 # No optimization to compile this file as optimizations (-O1 or above) breaks
1999 # the SEH handling on Windows. The reasons are not clear.
2000 seh_init.o : seh_init.c raise.h
2001         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
2002                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2003
2004 # Need to keep the frame pointer in this file to pop the stack properly on
2005 # some targets.
2006 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
2007         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2008               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2009
2010 # In GNU Make, ignore whether `stage*' exists.
2011 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2012 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2013
2014 force:
2015
2016 # Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS
2017
2018 ../../gnatlbr$(exeext): ../../prefix.o
2019         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2020         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2021         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2022
2023 ../../vms_help$(exeext):
2024         $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)"
2025         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help
2026         $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2027
2028 ../../gnat.hlp: ../../vms_help$(exeext)
2029         ../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \
2030                                 $(fsrcdir)/vms_data.ads ../../gnat.hlp