OSDN Git Service

gcc/ada/:
[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 -I$(fsrcdir)/config \
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-kernel.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
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-osprim.adb<s-osprim-vxworks.adb \
450   s-parame.ads<s-parame-vxworks.ads \
451   s-parame.adb<s-parame-vxworks.adb \
452   s-stchop.ads<s-stchop-limit.ads \
453   s-stchop.adb<s-stchop-vxworks.adb \
454   s-taprop.adb<s-taprop-vxworks.adb \
455   s-taspri.ads<s-taspri-vxworks.ads \
456   s-vxwork.ads<s-vxwork-ppc.ads \
457   g-socthi.ads<g-socthi-vxworks.ads \
458   g-socthi.adb<g-socthi-vxworks.adb \
459   g-stsifd.adb<g-stsifd-sockets.adb \
460   g-sttsne.adb<g-sttsne-vxworks.adb \
461   g-sttsne.ads<g-sttsne-locking.ads
462
463   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
464
465   ifeq ($(strip $(filter-out yes,$(TRACE))),)
466     LIBGNAT_TARGET_PAIRS += \
467     s-traces.adb<s-traces-default.adb \
468     s-trafor.adb<s-trafor-default.adb \
469     s-trafor.ads<s-trafor-default.ads \
470     s-tratas.adb<s-tratas-default.adb \
471     s-tfsetr.adb<s-tfsetr-vxworks.adb
472   endif
473
474   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
475     LIBGNAT_TARGET_PAIRS += \
476     s-osinte.adb<s-osinte-vxworks-rtp.adb \
477     s-osinte.ads<s-osinte-vxworks6.ads \
478     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
479     system.ads<system-vxworks-ppc-rtp.ads
480
481     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
482   else
483     LIBGNAT_TARGET_PAIRS += \
484     s-interr.adb<s-interr-hwint.adb \
485     s-tpopsp.adb<s-tpopsp-vxworks.adb \
486     system.ads<system-vxworks-ppc.ads
487
488     ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
489       LIBGNAT_TARGET_PAIRS += \
490       s-osinte.ads<s-osinte-vxworks6.ads \
491       s-osinte.adb<s-osinte-vxworks-kernel.adb
492     else
493       LIBGNAT_TARGET_PAIRS += \
494       s-osinte.ads<s-osinte-vxworks.ads \
495       s-osinte.adb<s-osinte-vxworks.adb
496     endif
497
498     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
499   endif
500
501   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
502
503   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
504   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
505 endif
506
507 # vxworksae / vxworks 653
508 ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
509   # target pairs for kernel + vthreads runtime
510   LIBGNAT_TARGET_PAIRS = \
511   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
512   a-intnam.ads<a-intnam-vxworks.ads \
513   a-numaux.ads<a-numaux-vxworks.ads \
514   g-io.adb<g-io-vxworks-ppc-cert.adb \
515   g-io.ads<g-io-vxworks-ppc-cert.ads \
516   s-inmaop.adb<s-inmaop-posix.adb \
517   s-interr.adb<s-interr-hwint.adb \
518   s-intman.ads<s-intman-vxworks.ads \
519   s-intman.adb<s-intman-vxworks.adb \
520   s-osinte.adb<s-osinte-vxworks-kernel.adb \
521   s-osinte.ads<s-osinte-vxworks.ads \
522   s-osprim.adb<s-osprim-vxworks.adb \
523   s-parame.ads<s-parame-ae653.ads \
524   s-parame.adb<s-parame-vxworks.adb \
525   s-taprop.adb<s-taprop-vxworks.adb \
526   s-taspri.ads<s-taspri-vxworks.ads \
527   s-tpopsp.adb<s-tpopsp-vxworks.adb \
528   s-vxwork.ads<s-vxwork-ppc.ads \
529   g-socthi.ads<g-socthi-vxworks.ads \
530   g-socthi.adb<g-socthi-vxworks.adb \
531   g-stsifd.adb<g-stsifd-sockets.adb \
532   g-sttsne.adb<g-sttsne-vxworks.adb \
533   g-sttsne.ads<g-sttsne-locking.ads \
534   system.ads<system-vxworks-ppc-vthread.ads
535
536   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
537
538   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
539   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
540
541   # Extra pairs for the vthreads runtime
542   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
543     LIBGNAT_TARGET_PAIRS += \
544     s-thread.adb<s-thread-ae653.adb
545     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
546   endif
547
548   ifeq ($(strip $(filter-out yes,$(TRACE))),)
549     LIBGNAT_TARGET_PAIRS += \
550     s-traces.adb<s-traces-default.adb \
551     s-trafor.adb<s-trafor-default.adb \
552     s-trafor.ads<s-trafor-default.ads \
553     s-tratas.adb<s-tratas-default.adb \
554     s-tfsetr.adb<s-tfsetr-vxworks.adb
555   endif
556 endif
557
558 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
559   LIBGNAT_TARGET_PAIRS = \
560   a-intnam.ads<a-intnam-vxworks.ads \
561   a-numaux.ads<a-numaux-vxworks.ads \
562   s-inmaop.adb<s-inmaop-posix.adb \
563   s-interr.adb<s-interr-hwint.adb \
564   s-intman.ads<s-intman-vxworks.ads \
565   s-intman.adb<s-intman-vxworks.adb \
566   s-osinte.adb<s-osinte-vxworks-kernel.adb \
567   s-osinte.ads<s-osinte-vxworks.ads \
568   s-osprim.adb<s-osprim-vxworks.adb \
569   s-parame.ads<s-parame-vxworks.ads \
570   s-parame.adb<s-parame-vxworks.adb \
571   s-stchop.ads<s-stchop-limit.ads \
572   s-stchop.adb<s-stchop-vxworks.adb \
573   s-taprop.adb<s-taprop-vxworks.adb \
574   s-taspri.ads<s-taspri-vxworks.ads \
575   s-tpopsp.adb<s-tpopsp-vxworks.adb \
576   s-vxwork.ads<s-vxwork-sparcv9.ads \
577   g-socthi.ads<g-socthi-vxworks.ads \
578   g-socthi.adb<g-socthi-vxworks.adb \
579   g-stsifd.adb<g-stsifd-sockets.adb \
580   g-sttsne.adb<g-sttsne-vxworks.adb \
581   g-sttsne.ads<g-sttsne-locking.ads \
582   system.ads<system-vxworks-sparcv9.ads   \
583
584   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
585
586   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
587   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
588
589   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
590   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
591 endif
592
593 ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
594   LIBGNAT_TARGET_PAIRS = \
595   a-intnam.ads<a-intnam-vxworks.ads \
596   i-vxwork.ads<i-vxwork-x86.ads \
597   s-inmaop.adb<s-inmaop-posix.adb \
598   s-intman.ads<s-intman-vxworks.ads \
599   s-intman.adb<s-intman-vxworks.adb \
600   a-numaux.adb<a-numaux-x86.adb \
601   a-numaux.ads<a-numaux-x86.ads \
602   s-osprim.adb<s-osprim-vxworks.adb \
603   s-parame.ads<s-parame-vxworks.ads \
604   s-parame.adb<s-parame-vxworks.adb \
605   s-stchop.ads<s-stchop-limit.ads \
606   s-stchop.adb<s-stchop-vxworks.adb \
607   s-taprop.adb<s-taprop-vxworks.adb \
608   s-taspri.ads<s-taspri-vxworks.ads \
609   s-vxwork.ads<s-vxwork-x86.ads \
610   g-bytswa.adb<g-bytswa-x86.adb \
611   g-socthi.ads<g-socthi-vxworks.ads \
612   g-socthi.adb<g-socthi-vxworks.adb \
613   g-stsifd.adb<g-stsifd-sockets.adb \
614   g-sttsne.adb<g-sttsne-vxworks.adb \
615   g-sttsne.ads<g-sttsne-locking.ads
616
617   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
618
619   ifeq ($(strip $(filter-out yes,$(TRACE))),)
620     LIBGNAT_TARGET_PAIRS += \
621     s-traces.adb<s-traces-default.adb \
622     s-trafor.adb<s-trafor-default.adb \
623     s-trafor.ads<s-trafor-default.ads \
624     s-tratas.adb<s-tratas-default.adb \
625     s-tfsetr.adb<s-tfsetr-vxworks.adb
626   endif
627
628   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
629     LIBGNAT_TARGET_PAIRS += \
630     s-osinte.adb<s-osinte-vxworks-rtp.adb \
631     s-osinte.ads<s-osinte-vxworks6.ads \
632     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
633     system.ads<system-vxworks-x86-rtp.ads
634
635     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
636   else
637     LIBGNAT_TARGET_PAIRS += \
638     s-interr.adb<s-interr-hwint.adb \
639     s-tpopsp.adb<s-tpopsp-vxworks.adb \
640     system.ads<system-vxworks-x86.ads
641
642     ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
643       LIBGNAT_TARGET_PAIRS += \
644       s-osinte.ads<s-osinte-vxworks6.ads \
645       s-osinte.adb<s-osinte-vxworks-kernel.adb
646     else
647       LIBGNAT_TARGET_PAIRS += \
648       s-osinte.ads<s-osinte-vxworks.ads \
649       s-osinte.adb<s-osinte-vxworks.adb
650     endif
651
652     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
653   endif
654
655   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.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 arm% coff wrs vx%,$(targ))),)
662   LIBGNAT_TARGET_PAIRS = \
663   a-intnam.ads<a-intnam-vxworks.ads \
664   a-numaux.ads<a-numaux-vxworks.ads \
665   s-inmaop.adb<s-inmaop-posix.adb \
666   s-interr.adb<s-interr-hwint.adb \
667   s-intman.ads<s-intman-vxworks.ads \
668   s-intman.adb<s-intman-vxworks.adb \
669   s-osinte.adb<s-osinte-vxworks-kernel.adb \
670   s-osinte.ads<s-osinte-vxworks.ads \
671   s-osprim.adb<s-osprim-vxworks.adb \
672   s-parame.ads<s-parame-vxworks.ads \
673   s-parame.adb<s-parame-vxworks.adb \
674   s-stchop.ads<s-stchop-limit.ads \
675   s-stchop.adb<s-stchop-vxworks.adb \
676   s-taprop.adb<s-taprop-vxworks.adb \
677   s-taspri.ads<s-taspri-vxworks.ads \
678   s-tpopsp.adb<s-tpopsp-vxworks.adb \
679   s-vxwork.ads<s-vxwork-arm.ads \
680   g-socthi.ads<g-socthi-vxworks.ads \
681   g-socthi.adb<g-socthi-vxworks.adb \
682   g-stsifd.adb<g-stsifd-sockets.adb \
683   g-sttsne.adb<g-sttsne-vxworks.adb \
684   g-sttsne.ads<g-sttsne-locking.ads \
685   system.ads<system-vxworks-arm.ads
686
687   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
688
689   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
690   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
691
692   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
693   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
694 endif
695
696 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
697   LIBGNAT_TARGET_PAIRS = \
698   a-intnam.ads<a-intnam-vxworks.ads \
699   a-numaux.ads<a-numaux-vxworks.ads \
700   s-inmaop.adb<s-inmaop-posix.adb \
701   s-interr.adb<s-interr-hwint.adb \
702   s-intman.ads<s-intman-vxworks.ads \
703   s-intman.adb<s-intman-vxworks.adb \
704   s-osinte.adb<s-osinte-vxworks-kernel.adb \
705   s-osinte.ads<s-osinte-vxworks.ads \
706   s-osprim.adb<s-osprim-vxworks.adb \
707   s-parame.ads<s-parame-vxworks.ads \
708   s-parame.adb<s-parame-vxworks.adb \
709   s-stchop.ads<s-stchop-limit.ads \
710   s-stchop.adb<s-stchop-vxworks.adb \
711   s-taprop.adb<s-taprop-vxworks.adb \
712   s-taspri.ads<s-taspri-vxworks.ads \
713   s-tpopsp.adb<s-tpopsp-vxworks.adb \
714   s-vxwork.ads<s-vxwork-mips.ads \
715   g-socthi.ads<g-socthi-vxworks.ads \
716   g-socthi.adb<g-socthi-vxworks.adb \
717   g-stsifd.adb<g-stsifd-sockets.adb \
718   g-sttsne.adb<g-sttsne-vxworks.adb \
719   g-sttsne.ads<g-sttsne-locking.ads \
720   system.ads<system-vxworks-mips.ads
721
722   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
723
724   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
725   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
726
727   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
728   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
729 endif
730
731 ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
732   LIBGNAT_TARGET_PAIRS_COMMON = \
733   a-intnam.ads<a-intnam-solaris.ads \
734   s-inmaop.adb<s-inmaop-posix.adb \
735   s-intman.adb<s-intman-solaris.adb \
736   s-osinte.adb<s-osinte-solaris.adb \
737   s-osinte.ads<s-osinte-solaris.ads \
738   s-osprim.adb<s-osprim-solaris.adb \
739   s-taprop.adb<s-taprop-solaris.adb \
740   s-tasinf.adb<s-tasinf-solaris.adb \
741   s-tasinf.ads<s-tasinf-solaris.ads \
742   s-taspri.ads<s-taspri-solaris.ads \
743   s-tpopsp.adb<s-tpopsp-solaris.adb \
744   g-soliop.ads<g-soliop-solaris.ads
745
746   LIBGNAT_TARGET_PAIRS_32 = \
747   system.ads<system-solaris-sparc.ads
748
749   LIBGNAT_TARGET_PAIRS_64 = \
750   system.ads<system-solaris-sparcv9.ads
751
752   ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
753     ifeq ($(strip $(MULTISUBDIR)),/sparcv9)
754       LIBGNAT_TARGET_PAIRS = \
755       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
756     else
757       LIBGNAT_TARGET_PAIRS = \
758       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
759     endif
760   else
761     ifeq ($(strip $(MULTISUBDIR)),/sparcv7)
762       LIBGNAT_TARGET_PAIRS = \
763       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
764     else
765       LIBGNAT_TARGET_PAIRS = \
766       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
767     endif
768   endif
769
770   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
771
772   EH_MECHANISM=-gcc
773   THREADSLIB = -lposix4 -lthread
774   MISCLIB = -lposix4 -lnsl -lsocket
775   SO_OPTS = -Wl,-h,
776   GNATLIB_SHARED = gnatlib-shared-dual
777   GMEM_LIB = gmemlib
778   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
779   LIBRARY_VERSION := $(LIB_VERSION)
780
781   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
782     LIBGNAT_TARGET_PAIRS = \
783     a-intnam.ads<a-intnam-solaris.ads \
784     s-inmaop.adb<s-inmaop-posix.adb \
785     s-intman.adb<s-intman-posix.adb \
786     s-osinte.adb<s-osinte-posix.adb \
787     s-osinte.ads<s-osinte-solaris-posix.ads \
788     s-osprim.adb<s-osprim-solaris.adb \
789     s-taprop.adb<s-taprop-posix.adb \
790     s-taspri.ads<s-taspri-posix.ads \
791     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
792     g-soliop.ads<g-soliop-solaris.ads \
793     system.ads<system-solaris-sparc.ads
794
795     THREADSLIB = -lposix4 -lpthread
796   endif
797
798   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
799     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
800   endif
801 endif
802
803 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
804   LIBGNAT_TARGET_PAIRS = \
805   a-numaux.adb<a-numaux-x86.adb \
806   a-numaux.ads<a-numaux-x86.ads \
807   a-intnam.ads<a-intnam-solaris.ads \
808   s-inmaop.adb<s-inmaop-posix.adb \
809   s-intman.adb<s-intman-solaris.adb \
810   s-osinte.adb<s-osinte-solaris.adb \
811   s-osinte.ads<s-osinte-solaris.ads \
812   s-osprim.adb<s-osprim-solaris.adb \
813   s-taprop.adb<s-taprop-solaris.adb \
814   s-tasinf.adb<s-tasinf-solaris.adb \
815   s-tasinf.ads<s-tasinf-solaris.ads \
816   s-taspri.ads<s-taspri-solaris.ads \
817   s-tpopsp.adb<s-tpopsp-solaris.adb \
818   g-soliop.ads<g-soliop-solaris.ads
819
820   ifeq ($(strip $(MULTISUBDIR)),/amd64)
821     LIBGNAT_TARGET_PAIRS += \
822     system.ads<system-solaris-x86_64.ads
823   else
824     LIBGNAT_TARGET_PAIRS += \
825     g-bytswa.adb<g-bytswa-x86.adb \
826     system.ads<system-solaris-x86.ads
827   endif
828
829   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
830
831   EH_MECHANISM=-gcc
832   THREADSLIB = -lposix4 -lthread
833   MISCLIB = -lposix4 -lnsl -lsocket
834   SO_OPTS = -Wl,-h,
835   GNATLIB_SHARED = gnatlib-shared-dual
836   GMEM_LIB = gmemlib
837   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
838   LIBRARY_VERSION := $(LIB_VERSION)
839 endif
840
841 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
842   LIBGNAT_TARGET_PAIRS = \
843   a-intnam.ads<a-intnam-linux.ads \
844   a-numaux.adb<a-numaux-x86.adb \
845   a-numaux.ads<a-numaux-x86.ads \
846   g-bytswa.adb<g-bytswa-x86.adb \
847   s-inmaop.adb<s-inmaop-posix.adb \
848   s-intman.adb<s-intman-posix.adb \
849   s-osprim.adb<s-osprim-posix.adb \
850   s-taspri.ads<s-taspri-posix.ads \
851   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
852   g-sercom.adb<g-sercom-linux.adb \
853   system.ads<system-linux-x86.ads
854
855   ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
856     LIBGNAT_TARGET_PAIRS += \
857     a-exetim.adb<a-exetim-linux-marte.adb \
858     a-exetim.ads<a-exetim-linux-marte.ads \
859     a-extiti.adb<a-extiti-linux-marte.adb \
860     a-extiti.ads<a-extiti-linux-marte.ads \
861     a-rttiev.adb<a-rttiev-linux-marte.adb \
862     a-rttiev.ads<a-rttiev-linux-marte.ads \
863     s-osinte.adb<s-osinte-linux-marte.adb \
864     s-osinte.ads<s-osinte-linux-marte.ads \
865     s-taprop.adb<s-taprop-linux-marte.adb
866
867     EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
868
869     EH_MECHANISM=
870     THREADSLIB = -lmarte
871   else
872     LIBGNAT_TARGET_PAIRS += \
873     s-linux.ads<s-linux.ads \
874     s-osinte.adb<s-osinte-posix.adb
875
876     ifeq ($(strip $(filter-out xenomai,$(THREAD_KIND))),)
877       LIBGNAT_TARGET_PAIRS += \
878       s-osinte.ads<s-osinte-linux-xenomai.ads \
879       s-taprop.adb<s-taprop-linux-xenomai.adb
880
881       EH_MECHANISM=
882     else
883       LIBGNAT_TARGET_PAIRS += \
884       s-osinte.ads<s-osinte-linux.ads \
885       s-taprop.adb<s-taprop-linux.adb \
886       s-tasinf.ads<s-tasinf-linux.ads \
887       s-tasinf.adb<s-tasinf-linux.adb
888
889       EH_MECHANISM=-gcc
890     endif
891
892     THREADSLIB = -lpthread
893     EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
894   endif
895
896   TOOLS_TARGET_PAIRS =  \
897     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
898     indepsw.adb<indepsw-gnu.adb
899
900   GNATLIB_SHARED = gnatlib-shared-dual
901   GMEM_LIB = gmemlib
902   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
903   LIBRARY_VERSION := $(LIB_VERSION)
904 endif
905
906 ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
907   LIBGNAT_TARGET_PAIRS = \
908   a-intnam.ads<a-intnam-freebsd.ads \
909   a-numaux.adb<a-numaux-x86.adb \
910   a-numaux.ads<a-numaux-x86.ads \
911   s-inmaop.adb<s-inmaop-posix.adb \
912   s-intman.adb<s-intman-posix.adb \
913   s-osinte.adb<s-osinte-posix.adb \
914   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
915   s-osprim.adb<s-osprim-posix.adb \
916   s-taprop.adb<s-taprop-linux.adb \
917   s-tasinf.ads<s-tasinf-linux.ads \
918   s-tasinf.adb<s-tasinf-linux.adb \
919   s-taspri.ads<s-taspri-posix.ads \
920   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
921   system.ads<system-freebsd-x86.ads
922
923   TOOLS_TARGET_PAIRS =  \
924     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
925     indepsw.adb<indepsw-gnu.adb
926
927   EH_MECHANISM=-gcc
928   THREADSLIB = -lpthread
929   GNATLIB_SHARED = gnatlib-shared-dual
930   GMEM_LIB = gmemlib
931   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
932   LIBRARY_VERSION := $(LIB_VERSION)
933 endif
934
935 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
936   LIBGNAT_TARGET_PAIRS = \
937   a-intnam.ads<a-intnam-freebsd.ads \
938   a-numaux.adb<a-numaux-x86.adb \
939   a-numaux.ads<a-numaux-x86.ads \
940   g-bytswa.adb<g-bytswa-x86.adb \
941   s-inmaop.adb<s-inmaop-posix.adb \
942   s-intman.adb<s-intman-posix.adb \
943   s-osinte.adb<s-osinte-freebsd.adb \
944   s-osinte.ads<s-osinte-freebsd.ads \
945   s-osprim.adb<s-osprim-posix.adb \
946   s-taprop.adb<s-taprop-posix.adb \
947   s-taspri.ads<s-taspri-posix.ads \
948   s-tpopsp.adb<s-tpopsp-posix.adb \
949   system.ads<system-freebsd-x86.ads
950
951   TOOLS_TARGET_PAIRS = \
952   mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
953   GNATLIB_SHARED = gnatlib-shared-dual
954
955   EH_MECHANISM=-gcc
956   THREADSLIB= -lpthread
957   GMEM_LIB = gmemlib
958   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
959   LIBRARY_VERSION := $(LIB_VERSION)
960 endif
961
962 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
963   LIBGNAT_TARGET_PAIRS_COMMON = \
964   a-intnam.ads<a-intnam-linux.ads \
965   s-inmaop.adb<s-inmaop-posix.adb \
966   s-intman.adb<s-intman-posix.adb \
967   s-linux.ads<s-linux.ads \
968   s-osinte.adb<s-osinte-posix.adb \
969   s-osinte.ads<s-osinte-linux.ads \
970   s-osprim.adb<s-osprim-posix.adb \
971   s-taprop.adb<s-taprop-linux.adb \
972   s-tasinf.ads<s-tasinf-linux.ads \
973   s-tasinf.adb<s-tasinf-linux.adb \
974   s-taspri.ads<s-taspri-posix-noaltstack.ads \
975   s-tpopsp.adb<s-tpopsp-posix-foreign.adb
976
977   LIBGNAT_TARGET_PAIRS_32 = \
978   system.ads<system-linux-s390.ads
979
980   LIBGNAT_TARGET_PAIRS_64 = \
981   system.ads<system-linux-s390x.ads
982
983   ifeq ($(strip $(filter-out s390x,$(arch))),)
984     ifeq ($(strip $(MULTISUBDIR)),/32)
985       LIBGNAT_TARGET_PAIRS = \
986       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
987     else
988       LIBGNAT_TARGET_PAIRS = \
989       $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
990     endif
991   else
992     LIBGNAT_TARGET_PAIRS = \
993     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
994   endif
995
996   TOOLS_TARGET_PAIRS =  \
997     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
998
999   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1000   EH_MECHANISM=-gcc
1001   THREADSLIB = -lpthread
1002   GNATLIB_SHARED = gnatlib-shared-dual
1003   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1004   LIBRARY_VERSION := $(LIB_VERSION)
1005 endif
1006
1007 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
1008   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
1009     LIBGNAT_TARGET_PAIRS = \
1010     a-intnam.ads<a-intnam-irix.ads \
1011     s-inmaop.adb<s-inmaop-posix.adb \
1012     s-intman.adb<s-intman-irix.adb \
1013     s-mastop.adb<s-mastop-irix.adb \
1014     s-osinte.adb<s-osinte-irix.adb \
1015     s-osinte.ads<s-osinte-irix.ads \
1016     s-osprim.adb<s-osprim-posix.adb \
1017     s-proinf.adb<s-proinf-irix-athread.adb \
1018     s-proinf.ads<s-proinf-irix-athread.ads \
1019     s-taprop.adb<s-taprop-irix.adb \
1020     s-tasinf.ads<s-tasinf-irix.ads \
1021     s-taspri.ads<s-taspri-posix.ads \
1022     s-tpopsp.adb<s-tpopsp-posix.adb \
1023     s-traceb.adb<s-traceb-mastop.adb
1024
1025     ifeq ($(strip $(MULTISUBDIR)),/64)
1026       LIBGNAT_TARGET_PAIRS += \
1027       system.ads<system-irix-n64.ads
1028     else
1029       ifeq ($(strip $(MULTISUBDIR)),/32)
1030         LIBGNAT_TARGET_PAIRS += \
1031         system.ads<system-irix-o32.ads
1032       else
1033         LIBGNAT_TARGET_PAIRS += \
1034         system.ads<system-irix-n32.ads
1035       endif
1036     endif
1037
1038     THREADSLIB = -lpthread
1039     GNATLIB_SHARED = gnatlib-shared-default
1040
1041   else
1042     LIBGNAT_TARGET_PAIRS += \
1043     s-mastop.adb<s-mastop-irix.adb \
1044     s-osprim.adb<s-osprim-posix.adb \
1045     s-traceb.adb<s-traceb-mastop.adb \
1046     system.ads<system-irix-o32.ads
1047   endif
1048
1049   EH_MECHANISM=-gcc
1050   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb
1051   TGT_LIB = -lexc
1052   MISCLIB = -lexc
1053   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1054   LIBRARY_VERSION := $(LIB_VERSION)
1055   GMEM_LIB = gmemlib
1056 endif
1057
1058 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
1059   LIBGNAT_TARGET_PAIRS = \
1060   a-excpol.adb<a-excpol-abort.adb \
1061   a-intnam.ads<a-intnam-hpux.ads \
1062   s-inmaop.adb<s-inmaop-posix.adb \
1063   s-interr.adb<s-interr-sigaction.adb \
1064   s-intman.adb<s-intman-posix.adb \
1065   s-osinte.adb<s-osinte-hpux-dce.adb \
1066   s-osinte.ads<s-osinte-hpux-dce.ads \
1067   s-parame.ads<s-parame-hpux.ads \
1068   s-osprim.adb<s-osprim-posix.adb \
1069   s-taprop.adb<s-taprop-hpux-dce.adb \
1070   s-taspri.ads<s-taspri-hpux-dce.ads \
1071   s-tpopsp.adb<s-tpopsp-posix.adb \
1072   system.ads<system-hpux.ads
1073
1074   EH_MECHANISM=-gcc
1075   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1076 endif
1077
1078 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
1079   LIBGNAT_TARGET_PAIRS = \
1080   a-intnam.ads<a-intnam-hpux.ads \
1081   s-inmaop.adb<s-inmaop-posix.adb \
1082   s-intman.adb<s-intman-posix.adb \
1083   s-osinte.adb<s-osinte-posix.adb \
1084   s-osinte.ads<s-osinte-hpux.ads \
1085   s-parame.ads<s-parame-hpux.ads \
1086   s-osprim.adb<s-osprim-posix.adb \
1087   s-traceb.adb<s-traceb-hpux.adb \
1088   s-taprop.adb<s-taprop-posix.adb \
1089   s-taspri.ads<s-taspri-posix.ads \
1090   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1091   system.ads<system-hpux.ads
1092
1093   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
1094   EH_MECHANISM=-gcc
1095   TGT_LIB = /usr/lib/libcl.a
1096   THREADSLIB = -lpthread
1097   GMEM_LIB = gmemlib
1098   soext = .sl
1099   SO_OPTS = -Wl,+h,
1100   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1101   GNATLIB_SHARED = gnatlib-shared-dual
1102   LIBRARY_VERSION := $(LIB_VERSION)
1103 endif
1104
1105 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1106   LIBGNAT_TARGET_PAIRS = \
1107   a-intnam.ads<a-intnam-aix.ads \
1108   s-inmaop.adb<s-inmaop-posix.adb \
1109   s-intman.adb<s-intman-posix.adb \
1110   s-osinte.adb<s-osinte-aix.adb \
1111   s-osinte.ads<s-osinte-aix.ads \
1112   s-osprim.adb<s-osprim-posix.adb \
1113   s-taprop.adb<s-taprop-posix.adb \
1114   s-taspri.ads<s-taspri-posix.ads \
1115   s-tpopsp.adb<s-tpopsp-posix.adb \
1116   system.ads<system-aix.ads
1117
1118   THREADSLIB = -lpthreads
1119   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1120
1121   TOOLS_TARGET_PAIRS = \
1122   mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
1123   indepsw.adb<indepsw-aix.adb
1124
1125   GMEM_LIB = gmemlib
1126 endif
1127
1128 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1129   TOOLS_TARGET_PAIRS = \
1130   mlib-tgt-specific.adb<mlib-tgt-specific-lynxos.adb \
1131   indepsw.adb<indepsw-gnu.adb
1132
1133   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1134     LIBGNAT_TARGET_PAIRS = \
1135     a-numaux.adb<a-numaux-x86.adb \
1136     a-numaux.ads<a-numaux-x86.ads \
1137     a-intnam.ads<a-intnam-lynxos.ads \
1138     g-bytswa.adb<g-bytswa-x86.adb \
1139     g-sttsne.adb<g-sttsne-locking.adb \
1140     g-sttsne.ads<g-sttsne-locking.ads \
1141     s-inmaop.adb<s-inmaop-posix.adb \
1142     s-intman.adb<s-intman-posix.adb \
1143     s-osinte.adb<s-osinte-lynxos.adb \
1144     s-osinte.ads<s-osinte-lynxos.ads \
1145     s-osprim.adb<s-osprim-posix.adb \
1146     s-taprop.adb<s-taprop-lynxos.adb \
1147     s-taspri.ads<s-taspri-lynxos.ads \
1148     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1149     system.ads<system-lynxos-x86.ads
1150
1151     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1152
1153   else
1154     LIBGNAT_TARGET_PAIRS = \
1155     a-intnam.ads<a-intnam-lynxos.ads \
1156     g-sttsne.adb<g-sttsne-locking.adb \
1157     g-sttsne.ads<g-sttsne-locking.ads \
1158     s-inmaop.adb<s-inmaop-posix.adb \
1159     s-intman.adb<s-intman-posix.adb \
1160     s-osinte.adb<s-osinte-lynxos.adb \
1161     s-osinte.ads<s-osinte-lynxos.ads \
1162     s-osprim.adb<s-osprim-posix.adb \
1163     s-taprop.adb<s-taprop-lynxos.adb \
1164     s-taspri.ads<s-taspri-lynxos.ads \
1165     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1166     system.ads<system-lynxos-ppc.ads
1167   endif
1168 endif
1169
1170 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1171   LIBGNAT_TARGET_PAIRS = \
1172   system.ads<system-rtems.ads \
1173   a-intnam.ads<a-intnam-rtems.ads \
1174   s-inmaop.adb<s-inmaop-posix.adb \
1175   s-intman.adb<s-intman-posix.adb \
1176   s-osinte.adb<s-osinte-rtems.adb \
1177   s-osinte.ads<s-osinte-rtems.ads \
1178   s-osprim.adb<s-osprim-posix.adb \
1179   s-parame.adb<s-parame-rtems.adb \
1180   s-taprop.adb<s-taprop-posix.adb \
1181   s-taspri.ads<s-taspri-posix.ads \
1182   s-tpopsp.adb<s-tpopsp-rtems.adb \
1183   s-stchop.adb<s-stchop-rtems.adb \
1184   s-interr.adb<s-interr-hwint.adb
1185 endif
1186
1187 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1188   LIBGNAT_TARGET_PAIRS = \
1189   a-intnam.ads<a-intnam-tru64.ads \
1190   s-inmaop.adb<s-inmaop-posix.adb \
1191   s-intman.adb<s-intman-posix.adb \
1192   s-mastop.adb<s-mastop-tru64.adb \
1193   s-osinte.adb<s-osinte-tru64.adb \
1194   s-osinte.ads<s-osinte-tru64.ads \
1195   s-osprim.adb<s-osprim-unix.adb \
1196   s-taprop.adb<s-taprop-tru64.adb \
1197   s-tasinf.ads<s-tasinf-tru64.ads \
1198   s-taspri.ads<s-taspri-tru64.ads \
1199   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1200   s-traceb.adb<s-traceb-mastop.adb \
1201   system.ads<system-tru64.ads
1202
1203   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-tru64.adb
1204
1205   EH_MECHANISM=-gcc
1206   GMEM_LIB=gmemlib
1207   THREADSLIB = -lpthread -lmach -lexc -lrt
1208   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1209   GNATLIB_SHARED = gnatlib-shared-default
1210   LIBRARY_VERSION := $(LIB_VERSION)
1211 endif
1212
1213 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
1214
1215 soext  = .exe
1216 hyphen = _
1217 LN = cp -p
1218 LN_S = cp -p
1219
1220 .SUFFIXES: .sym
1221
1222 .o.sym:
1223         @ gnu:[bin]vmssymvec $<
1224 endif
1225
1226 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1227 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1228   LIBGNAT_TARGET_PAIRS_AUX1 = \
1229   g-enblsp.adb<g-enblsp-vms-ia64.adb \
1230   g-trasym.adb<g-trasym-vms-ia64.adb \
1231   s-asthan.adb<s-asthan-vms-ia64.adb \
1232   s-osinte.adb<s-osinte-vms-ia64.adb \
1233   s-osinte.ads<s-osinte-vms-ia64.ads \
1234   s-vaflop.adb<s-vaflop-vms-ia64.adb \
1235   system.ads<system-vms-ia64.ads
1236
1237   LIBGNAT_TARGET_PAIRS_AUX2 = \
1238   s-parame.ads<s-parame-vms-ia64.ads
1239 else
1240 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1241   LIBGNAT_TARGET_PAIRS_AUX1 = \
1242   g-enblsp.adb<g-enblsp-vms-alpha.adb \
1243   g-trasym.adb<g-trasym-vms-alpha.adb \
1244   s-traent.adb<s-traent-vms.adb \
1245   s-traent.ads<s-traent-vms.ads \
1246   s-asthan.adb<s-asthan-vms-alpha.adb \
1247   s-osinte.adb<s-osinte-vms.adb \
1248   s-osinte.ads<s-osinte-vms.ads \
1249   s-vaflop.adb<s-vaflop-vms-alpha.adb \
1250   system.ads<system-vms_64.ads
1251
1252 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1253   LIBGNAT_TARGET_PAIRS_AUX2 = \
1254   s-parame.ads<s-parame-vms-restrict.ads
1255 else
1256   LIBGNAT_TARGET_PAIRS_AUX2 = \
1257   s-parame.ads<s-parame-vms-alpha.ads
1258 endif
1259 endif
1260 endif
1261
1262   LIBGNAT_TARGET_PAIRS = \
1263   a-caldel.adb<a-caldel-vms.adb \
1264   a-calend.adb<a-calend-vms.adb \
1265   a-calend.ads<a-calend-vms.ads \
1266   a-dirval.adb<a-dirval-vms.adb \
1267   a-excpol.adb<a-excpol-abort.adb \
1268   a-intnam.ads<a-intnam-vms.ads \
1269   a-numaux.ads<a-numaux-vms.ads \
1270   g-expect.adb<g-expect-vms.adb \
1271   g-socthi.ads<g-socthi-vms.ads \
1272   g-socthi.adb<g-socthi-vms.adb \
1273   g-stsifd.adb<g-stsifd-sockets.adb \
1274   g-sttsne.adb<g-sttsne-locking.adb \
1275   g-sttsne.ads<g-sttsne-locking.ads \
1276   i-c.ads<i-c-vms_64.ads \
1277   i-cstrin.ads<i-cstrin-vms_64.ads \
1278   i-cstrin.adb<i-cstrin-vms_64.adb \
1279   i-cpoint.ads<i-cpoint-vms_64.ads \
1280   i-cpoint.adb<i-cpoint-vms_64.adb \
1281   i-cstrea.adb<i-cstrea-vms.adb \
1282   memtrack.adb<memtrack-vms_64.adb \
1283   s-auxdec.ads<s-auxdec-vms_64.ads \
1284   s-crtl.ads<s-crtl-vms_64.ads \
1285   s-inmaop.adb<s-inmaop-vms.adb \
1286   s-interr.adb<s-interr-vms.adb \
1287   s-intman.adb<s-intman-vms.adb \
1288   s-intman.ads<s-intman-vms.ads \
1289   s-memory.adb<s-memory-vms_64.adb \
1290   s-memory.ads<s-memory-vms_64.ads \
1291   s-osprim.adb<s-osprim-vms.adb \
1292   s-osprim.ads<s-osprim-vms.ads \
1293   s-taprop.adb<s-taprop-vms.adb \
1294   s-taspri.ads<s-taspri-vms.ads \
1295   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1296   s-tpopde.adb<s-tpopde-vms.adb \
1297   s-tpopde.ads<s-tpopde-vms.ads \
1298   $(LIBGNAT_TARGET_PAIRS_AUX1) \
1299   $(LIBGNAT_TARGET_PAIRS_AUX2)
1300
1301 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1302   TOOLS_TARGET_PAIRS= \
1303   mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
1304   symbols.adb<symbols-vms.adb \
1305   symbols-processing.adb<symbols-processing-vms-ia64.adb
1306 else
1307   TOOLS_TARGET_PAIRS= \
1308   mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
1309   symbols.adb<symbols-vms.adb \
1310   symbols-processing.adb<symbols-processing-vms-alpha.adb
1311 endif
1312
1313 adamsg.o: adamsg.msg
1314         -$(DECC) --cc=message adamsg.msg -o adamsg.o
1315
1316   EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
1317
1318   GMEM_LIB = gmemlib
1319   EH_MECHANISM=-gcc
1320   GNATLIB_SHARED=gnatlib-shared-vms
1321 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1322   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1323   EXTRA_LIBGNAT_OBJS=vmshandler.o
1324 endif
1325   EXTRA_LIBGNAT_SRCS+=adamsg.msg
1326   EXTRA_LIBGNAT_OBJS+=adamsg.o
1327   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1328   EXTRA_GNATTOOLS = \
1329      ../../gnatlbr$(exeext)  \
1330      ../../gnatsym$(exeext)  \
1331      ../../vms_help$(exeext) \
1332      ../../gnat.hlp
1333   # This command transforms (YYYYMMDD) into YY,MMDD
1334   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)ada/gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
1335   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1336   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1337 endif
1338
1339 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1340   LIBGNAT_TARGET_PAIRS = \
1341   a-dirval.adb<a-dirval-mingw.adb \
1342   a-excpol.adb<a-excpol-abort.adb \
1343   a-numaux.adb<a-numaux-x86.adb \
1344   a-numaux.ads<a-numaux-x86.ads \
1345   s-gloloc.adb<s-gloloc-mingw.adb \
1346   s-inmaop.adb<s-inmaop-dummy.adb \
1347   s-memory.adb<s-memory-mingw.adb \
1348   s-taspri.ads<s-taspri-mingw.ads \
1349   s-tasinf.adb<s-tasinf-mingw.adb \
1350   s-tasinf.ads<s-tasinf-mingw.ads \
1351   g-bytswa.adb<g-bytswa-x86.adb \
1352   g-socthi.ads<g-socthi-mingw.ads \
1353   g-socthi.adb<g-socthi-mingw.adb \
1354   g-stsifd.adb<g-stsifd-sockets.adb \
1355   g-soliop.ads<g-soliop-mingw.ads
1356
1357   ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
1358     LIBGNAT_TARGET_PAIRS += \
1359     s-intman.adb<s-intman-dummy.adb \
1360     s-osinte.ads<s-osinte-rtx.ads \
1361     s-osprim.adb<s-osprim-rtx.adb \
1362     s-taprop.adb<s-taprop-rtx.adb
1363
1364     EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
1365
1366     ifeq ($(strip $(filter-out rtx_w32,$(THREAD_KIND))),)
1367        LIBGNAT_TARGET_PAIRS += system.ads<system-rtx.ads
1368
1369        EH_MECHANISM=-gcc
1370     else
1371        LIBGNAT_TARGET_PAIRS += \
1372        system.ads<system-rtx-rtss.ads \
1373        s-parame.adb<s-parame-vxworks.adb
1374
1375        EH_MECHANISM=
1376     endif
1377
1378   else
1379     LIBGNAT_TARGET_PAIRS += \
1380     a-exetim.adb<a-exetim-mingw.adb \
1381     a-exetim.ads<a-exetim-mingw.ads \
1382     a-intnam.ads<a-intnam-mingw.ads \
1383     g-sercom.adb<g-sercom-mingw.adb \
1384     s-interr.adb<s-interr-sigaction.adb \
1385     s-intman.adb<s-intman-mingw.adb \
1386     s-osinte.ads<s-osinte-mingw.ads \
1387     s-osprim.adb<s-osprim-mingw.adb \
1388     s-taprop.adb<s-taprop-mingw.adb
1389
1390     ifeq ($(strip $(filter-out x86_64%,$(arch))),)
1391       LIBGNAT_TARGET_PAIRS += \
1392         system.ads<system-mingw-x86_64.ads
1393     else
1394       LIBGNAT_TARGET_PAIRS += \
1395         system.ads<system-mingw.ads
1396     endif
1397
1398     EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o s-winext.o g-regist.o
1399     EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
1400
1401     MISCLIB = -lwsock32
1402
1403     # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
1404     # auto-import support for array/record will be done.
1405     GNATLIB_SHARED = gnatlib-shared-win32
1406
1407     EH_MECHANISM=-gcc
1408   endif
1409
1410   TOOLS_TARGET_PAIRS= \
1411   mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
1412   indepsw.adb<indepsw-mingw.adb
1413
1414   GMEM_LIB = gmemlib
1415   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1416   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1417   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1418   soext = .dll
1419   LIBRARY_VERSION := $(LIB_VERSION)
1420 endif
1421
1422 ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
1423   LIBGNAT_TARGET_PAIRS = \
1424   a-intnam.ads<a-intnam-linux.ads \
1425   s-inmaop.adb<s-inmaop-posix.adb \
1426   s-intman.adb<s-intman-posix.adb \
1427   s-linux.ads<s-linux.ads \
1428   s-osinte.adb<s-osinte-posix.adb \
1429   s-osinte.ads<s-osinte-linux.ads \
1430   s-osprim.adb<s-osprim-posix.adb \
1431   s-taprop.adb<s-taprop-linux.adb \
1432   s-tasinf.ads<s-tasinf-linux.ads \
1433   s-tasinf.adb<s-tasinf-linux.adb \
1434   s-taspri.ads<s-taspri-posix.ads \
1435   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1436   system.ads<system-linux-mips.ads
1437
1438   EH_MECHANISM=-gcc
1439   THREADSLIB = -lpthread
1440   GNATLIB_SHARED = gnatlib-shared-dual
1441   GMEM_LIB = gmemlib
1442   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1443   LIBRARY_VERSION := $(LIB_VERSION)
1444 endif
1445
1446 ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
1447   LIBGNAT_TARGET_PAIRS = \
1448   a-intnam.ads<a-intnam-linux.ads \
1449   s-inmaop.adb<s-inmaop-posix.adb \
1450   s-intman.adb<s-intman-posix.adb \
1451   s-linux.ads<s-linux.ads \
1452   s-osinte.adb<s-osinte-posix.adb \
1453   s-osinte.ads<s-osinte-linux.ads \
1454   s-osprim.adb<s-osprim-posix.adb \
1455   s-taprop.adb<s-taprop-linux.adb \
1456   s-tasinf.ads<s-tasinf-linux.ads \
1457   s-tasinf.adb<s-tasinf-linux.adb \
1458   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1459   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1460   g-sercom.adb<g-sercom-linux.adb \
1461   system.ads<system-linux-mipsel.ads
1462
1463   TOOLS_TARGET_PAIRS =  \
1464     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1465     indepsw.adb<indepsw-gnu.adb
1466
1467   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1468   EH_MECHANISM=-gcc
1469   THREADSLIB = -lpthread
1470   GNATLIB_SHARED = gnatlib-shared-dual
1471   GMEM_LIB = gmemlib
1472   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1473   LIBRARY_VERSION := $(LIB_VERSION)
1474 endif
1475
1476 ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
1477   LIBGNAT_TARGET_PAIRS_COMMON = \
1478   a-intnam.ads<a-intnam-linux.ads \
1479   s-inmaop.adb<s-inmaop-posix.adb \
1480   s-intman.adb<s-intman-posix.adb \
1481   s-linux.ads<s-linux.ads \
1482   s-osinte.adb<s-osinte-posix.adb \
1483   s-osinte.ads<s-osinte-linux.ads \
1484   s-osprim.adb<s-osprim-posix.adb \
1485   s-taprop.adb<s-taprop-linux.adb \
1486   s-tasinf.ads<s-tasinf-linux.ads \
1487   s-tasinf.adb<s-tasinf-linux.adb \
1488   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1489   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1490   g-sercom.adb<g-sercom-linux.adb
1491
1492   LIBGNAT_TARGET_PAIRS_32 = \
1493   system.ads<system-linux-ppc.ads
1494
1495   LIBGNAT_TARGET_PAIRS_64 = \
1496   system.ads<system-linux-ppc64.ads
1497
1498   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1499     LIBGNAT_TARGET_PAIRS = \
1500     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1501   else
1502     LIBGNAT_TARGET_PAIRS = \
1503     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1504   endif
1505
1506   TOOLS_TARGET_PAIRS =  \
1507     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1508     indepsw.adb<indepsw-gnu.adb
1509
1510   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1511   EH_MECHANISM=-gcc
1512   THREADSLIB = -lpthread
1513   GNATLIB_SHARED = gnatlib-shared-dual
1514   GMEM_LIB = gmemlib
1515   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1516   LIBRARY_VERSION := $(LIB_VERSION)
1517 endif
1518
1519 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
1520   LIBGNAT_TARGET_PAIRS_COMMON = \
1521   a-intnam.ads<a-intnam-linux.ads \
1522   s-inmaop.adb<s-inmaop-posix.adb \
1523   s-intman.adb<s-intman-posix.adb \
1524   s-linux.ads<s-linux.ads \
1525   s-osinte.adb<s-osinte-posix.adb \
1526   s-osinte.ads<s-osinte-linux.ads \
1527   s-osprim.adb<s-osprim-posix.adb \
1528   s-taprop.adb<s-taprop-linux.adb \
1529   s-tasinf.ads<s-tasinf-linux.ads \
1530   s-tasinf.adb<s-tasinf-linux.adb \
1531   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1532   s-tpopsp.adb<s-tpopsp-posix-foreign.adb
1533
1534   LIBGNAT_TARGET_PAIRS_32 = \
1535   system.ads<system-linux-sparc.ads
1536
1537   LIBGNAT_TARGET_PAIRS_64 = \
1538   system.ads<system-linux-sparcv9.ads
1539
1540   ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
1541     LIBGNAT_TARGET_PAIRS = \
1542     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
1543   else
1544     LIBGNAT_TARGET_PAIRS = \
1545     $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
1546   endif
1547
1548   TOOLS_TARGET_PAIRS =  \
1549     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1550     indepsw.adb<indepsw-gnu.adb
1551
1552   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1553   EH_MECHANISM=-gcc
1554   THREADSLIB = -lpthread
1555   GNATLIB_SHARED = gnatlib-shared-dual
1556   GMEM_LIB = gmemlib
1557   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1558   LIBRARY_VERSION := $(LIB_VERSION)
1559 endif
1560
1561 ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
1562   LIBGNAT_TARGET_PAIRS = \
1563   a-intnam.ads<a-intnam-linux.ads \
1564   s-inmaop.adb<s-inmaop-posix.adb \
1565   s-intman.adb<s-intman-posix.adb \
1566   s-linux.ads<s-linux-hppa.ads \
1567   s-osinte.adb<s-osinte-posix.adb \
1568   s-osinte.ads<s-osinte-linux.ads \
1569   s-osprim.adb<s-osprim-posix.adb \
1570   s-taprop.adb<s-taprop-linux.adb \
1571   s-tasinf.ads<s-tasinf-linux.ads \
1572   s-tasinf.adb<s-tasinf-linux.adb \
1573   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1574   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1575   system.ads<system-linux-hppa.ads
1576
1577   TOOLS_TARGET_PAIRS =  \
1578     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1579     indepsw.adb<indepsw-gnu.adb
1580
1581   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1582   EH_MECHANISM=-gcc
1583   THREADSLIB = -lpthread
1584   GNATLIB_SHARED = gnatlib-shared-dual
1585   GMEM_LIB = gmemlib
1586   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1587   LIBRARY_VERSION := $(LIB_VERSION)
1588 endif
1589
1590 ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
1591   LIBGNAT_TARGET_PAIRS = \
1592   a-intnam.ads<a-intnam-linux.ads \
1593   s-inmaop.adb<s-inmaop-posix.adb \
1594   s-intman.adb<s-intman-posix.adb \
1595   s-linux.ads<s-linux.ads \
1596   s-osinte.adb<s-osinte-posix.adb \
1597   s-osinte.ads<s-osinte-linux.ads \
1598   s-osprim.adb<s-osprim-posix.adb \
1599   s-taprop.adb<s-taprop-linux.adb \
1600   s-tasinf.ads<s-tasinf-linux.ads \
1601   s-tasinf.adb<s-tasinf-linux.adb \
1602   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1603   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1604   system.ads<system-linux-sh4.ads
1605
1606   TOOLS_TARGET_PAIRS =  \
1607     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1608     indepsw.adb<indepsw-linux.adb
1609
1610   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1611   EH_MECHANISM=-gcc
1612   MISCLIB=
1613   THREADSLIB = -lpthread
1614   GNATLIB_SHARED = gnatlib-shared-dual
1615   GMEM_LIB = gmemlib
1616   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1617   LIBRARY_VERSION := $(LIB_VERSION)
1618 endif
1619
1620 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1621   LIBGNAT_TARGET_PAIRS = \
1622   a-intnam.ads<a-intnam-linux.ads \
1623   a-numaux.ads<a-numaux-libc-x86.ads \
1624   s-inmaop.adb<s-inmaop-posix.adb \
1625   s-intman.adb<s-intman-posix.adb \
1626   s-linux.ads<s-linux.ads \
1627   s-osinte.ads<s-osinte-linux.ads \
1628   s-osinte.adb<s-osinte-posix.adb \
1629   s-osprim.adb<s-osprim-posix.adb \
1630   s-taprop.adb<s-taprop-linux.adb \
1631   s-tasinf.ads<s-tasinf-linux.ads \
1632   s-tasinf.adb<s-tasinf-linux.adb \
1633   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1634   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1635   g-sercom.adb<g-sercom-linux.adb \
1636   system.ads<system-linux-ia64.ads
1637
1638   TOOLS_TARGET_PAIRS =  \
1639     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1640     indepsw.adb<indepsw-gnu.adb
1641
1642   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1643   EH_MECHANISM=-gcc
1644   MISCLIB=
1645   THREADSLIB=-lpthread
1646   GNATLIB_SHARED=gnatlib-shared-dual
1647   GMEM_LIB = gmemlib
1648   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1649   LIBRARY_VERSION := $(LIB_VERSION)
1650 endif
1651
1652 ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
1653   LIBGNAT_TARGET_PAIRS = \
1654   a-intnam.ads<a-intnam-linux.ads \
1655   s-inmaop.adb<s-inmaop-posix.adb \
1656   s-intman.adb<s-intman-posix.adb \
1657   s-linux.ads<s-linux-alpha.ads \
1658   s-osinte.ads<s-osinte-linux.ads \
1659   s-osinte.adb<s-osinte-posix.adb \
1660   s-osprim.adb<s-osprim-posix.adb \
1661   s-taprop.adb<s-taprop-linux.adb \
1662   s-tasinf.ads<s-tasinf-linux.ads \
1663   s-tasinf.adb<s-tasinf-linux.adb \
1664   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1665   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1666   system.ads<system-linux-alpha.ads
1667
1668   TOOLS_TARGET_PAIRS =  \
1669     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1670     indepsw.adb<indepsw-gnu.adb
1671
1672   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1673   EH_MECHANISM=-gcc
1674   MISCLIB=
1675   THREADSLIB=-lpthread
1676   GNATLIB_SHARED=gnatlib-shared-dual
1677   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1678   LIBRARY_VERSION := $(LIB_VERSION)
1679 endif
1680
1681 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1682   LIBGNAT_TARGET_PAIRS = \
1683   a-intnam.ads<a-intnam-linux.ads \
1684   a-numaux.adb<a-numaux-x86.adb \
1685   a-numaux.ads<a-numaux-x86.ads \
1686   s-inmaop.adb<s-inmaop-posix.adb \
1687   s-intman.adb<s-intman-posix.adb \
1688   s-linux.ads<s-linux.ads \
1689   s-osinte.ads<s-osinte-linux.ads \
1690   s-osinte.adb<s-osinte-posix.adb \
1691   s-osprim.adb<s-osprim-posix.adb \
1692   s-taprop.adb<s-taprop-linux.adb \
1693   s-tasinf.ads<s-tasinf-linux.ads \
1694   s-tasinf.adb<s-tasinf-linux.adb \
1695   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1696   s-taspri.ads<s-taspri-posix.ads \
1697   g-sercom.adb<g-sercom-linux.adb \
1698   system.ads<system-linux-x86_64.ads
1699
1700   TOOLS_TARGET_PAIRS =  \
1701     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1702     indepsw.adb<indepsw-gnu.adb
1703
1704   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1705   EH_MECHANISM=-gcc
1706   THREADSLIB=-lpthread
1707   GNATLIB_SHARED=gnatlib-shared-dual
1708   GMEM_LIB = gmemlib
1709   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1710   LIBRARY_VERSION := $(LIB_VERSION)
1711 endif
1712
1713 ifeq ($(strip $(filter-out darwin%,$(osys))),)
1714   ifeq ($(strip $(filter-out %86,$(arch))),)
1715     LIBGNAT_TARGET_PAIRS = \
1716     a-intnam.ads<a-intnam-darwin.ads \
1717     s-inmaop.adb<s-inmaop-posix.adb \
1718     s-intman.adb<s-intman-posix.adb \
1719     s-osinte.adb<s-osinte-darwin.adb \
1720     s-osinte.ads<s-osinte-darwin.ads \
1721     s-osprim.adb<s-osprim-posix.adb \
1722     s-taprop.adb<s-taprop-posix.adb \
1723     s-taspri.ads<s-taspri-posix.ads \
1724     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1725     a-numaux.ads<a-numaux-x86.ads \
1726     a-numaux.adb<a-numaux-x86.adb
1727     ifeq ($(strip $(MULTISUBDIR)),/x86_64)
1728       LIBGNAT_TARGET_PAIRS += \
1729       system.ads<system-darwin-x86_64.ads
1730     else
1731       LIBGNAT_TARGET_PAIRS += \
1732       system.ads<system-darwin-x86.ads
1733     endif
1734   else
1735     LIBGNAT_TARGET_PAIRS = \
1736     a-intnam.ads<a-intnam-darwin.ads \
1737     s-inmaop.adb<s-inmaop-posix.adb \
1738     s-intman.adb<s-intman-posix.adb \
1739     s-osinte.adb<s-osinte-darwin.adb \
1740     s-osinte.ads<s-osinte-darwin.ads \
1741     s-osprim.adb<s-osprim-posix.adb \
1742     s-taprop.adb<s-taprop-posix.adb \
1743     s-taspri.ads<s-taspri-posix.ads \
1744     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1745     a-numaux.ads<a-numaux-darwin.ads \
1746     a-numaux.adb<a-numaux-darwin.adb \
1747     system.ads<system-darwin-ppc.ads
1748   endif
1749
1750   TOOLS_TARGET_PAIRS =  \
1751     mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb
1752
1753   EH_MECHANISM=-gcc
1754   GNATLIB_SHARED = gnatlib-shared-darwin
1755   SO_OPTS = -Wl,-flat_namespace -shared-libgcc
1756   RANLIB = ranlib -c
1757   GMEM_LIB = gmemlib
1758   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1759   LIBRARY_VERSION := $(LIB_VERSION)
1760   soext = .dylib
1761 endif
1762
1763 ifneq ($(EH_MECHANISM),)
1764   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
1765   EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
1766   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
1767 endif
1768
1769 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
1770 # explicitly already. The base files (a-except.ad?) are used only for building
1771 # the compiler and other basic tools.
1772 # These base versions lack Ada 2005 additions which would cause bootstrap
1773 # problems if included in the compiler and other basic tools.
1774
1775 ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
1776   LIBGNAT_TARGET_PAIRS += \
1777     a-except.ads<a-except-2005.ads \
1778     a-except.adb<a-except-2005.adb
1779 endif
1780
1781 # The runtime library for gnat comprises two directories.  One contains the
1782 # Ada source files that the compiler (gnat1) needs -- these files are listed
1783 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1784 # corresponding .ali files for the parts written in Ada, libgnat.a for
1785 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1786 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1787 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1788 # go into the directory.  The pthreads emulation is built in the threads
1789 # subdirectory and copied.
1790 LIBGNAT_SRCS = adaint.c adaint.h argv.c cio.c cstreams.c \
1791   errno.c exit.c cal.c ctrl_c.c env.c env.h arit64.c \
1792   raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
1793   final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
1794   socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
1795
1796 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
1797   raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o arit64.o \
1798   final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
1799
1800 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1801 #  the library installation will change and there will be a
1802 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1803 #  from ADA_INCLUDE_SRCS.
1804
1805 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1806 # the following include file:
1807
1808 include $(fsrcdir)/ada/Makefile.rtl
1809
1810 GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o a-nllrar.o a-nlrear.o \
1811   a-nucoar.o a-nurear.o i-forbla.o i-forlap.o s-gearop.o
1812
1813 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1814   $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
1815
1816 # Default run time files
1817
1818 ADA_INCLUDE_SRCS =\
1819  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1820  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1821  sequenio.ads system.ads memtrack.adb \
1822  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
1823  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
1824
1825 LIBGNAT=../$(RTSDIR)/libgnat.a
1826
1827 GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
1828
1829 # when compiling the tools, the runtime has to be first on the path so that
1830 # it hides the runtime files lying with the rest of the sources
1831 ifeq ($(TOOLSCASE),native)
1832   vpath %.ads ../$(RTSDIR) ../
1833   vpath %.adb ../$(RTSDIR) ../
1834   vpath %.c   ../$(RTSDIR) ../
1835   vpath %.h   ../$(RTSDIR) ../
1836 endif
1837
1838 # in the cross tools case, everything is compiled with the native
1839 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1840 ifeq ($(TOOLSCASE),cross)
1841   vpath %.ads ../
1842   vpath %.adb ../
1843   vpath %.c   ../
1844   vpath %.h   ../
1845 endif
1846
1847 common-tools:
1848         $(GNATMAKE) -c -b $(ADA_INCLUDES) \
1849           --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
1850           gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
1851           gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
1852         $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
1853                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1854         $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
1855                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1856         $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
1857                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1858         $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
1859                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1860         $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
1861                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1862         $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
1863                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1864         $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
1865                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1866         $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
1867                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1868         $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
1869                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1870
1871 ../../gnatsym$(exeext): 
1872         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1873         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1874         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1875
1876 ../../gnatdll$(exeext): 
1877         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1878         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
1879         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1880
1881 ../../vxaddr2line$(exeext): targext.o
1882         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1883         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
1884         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
1885
1886 gnatmake-re:  link.o targext.o
1887         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1888         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1889         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
1890         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1891                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1892
1893 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1894 # with the former version of gnatlink itself which cannot override itself.
1895 gnatlink-re:  link.o targext.o
1896         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1897         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
1898         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1899                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1900         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1901
1902 # Needs to be built with CC=gcc
1903 # Since the RTL should be built with the latest compiler, remove the
1904 #  stamp target in the parent directory whenever gnat1 is rebuilt
1905
1906 # Likewise for the tools
1907 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
1908         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1909                     $(TOOLS_LIBS)
1910
1911 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
1912         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1913                     $(TOOLS_LIBS)
1914
1915 ../stamp-gnatlib-$(RTSDIR):
1916         @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
1917         then \
1918           $(ECHO) You must first build the GNAT library: make gnatlib; \
1919           false; \
1920         else \
1921           true; \
1922         fi
1923
1924 install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
1925 #       Create the directory before deleting it, in case the directory is
1926 #       a list of directories (as it may be on VMS). This ensures we are
1927 #       deleting the right one.
1928         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1929         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1930         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1931         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1932         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1933         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1934         for file in $(RTSDIR)/*.ali; do \
1935             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1936         done
1937         -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1938         -cd $(RTSDIR); for file in *$(arext);do \
1939             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1940             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
1941         done
1942         -$(foreach file, $(EXTRA_ADALIB_FILES), \
1943             $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1944         ) true
1945 #     Install the shared libraries, if any, using $(INSTALL) instead
1946 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1947 #     for shared libraries on some targets, e.g. on HP-UX where the x
1948 #     permission is required.
1949         for file in gnat gnarl; do \
1950            if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
1951               $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1952                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1953            fi; \
1954            if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
1955               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1956               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
1957            fi; \
1958         done
1959 # This copy must be done preserving the date on the original file.
1960         for file in $(RTSDIR)/*.ad?; do \
1961             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1962         done
1963         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1964         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1965
1966 ../stamp-gnatlib2-$(RTSDIR):
1967         $(RM) $(RTSDIR)/s-*.ali
1968         $(RM) $(RTSDIR)/s-*$(objext)
1969         $(RM) $(RTSDIR)/a-*.ali
1970         $(RM) $(RTSDIR)/a-*$(objext)
1971         $(RM) $(RTSDIR)/*.ali
1972         $(RM) $(RTSDIR)/*$(objext)
1973         $(RM) $(RTSDIR)/*$(arext)
1974         $(RM) $(RTSDIR)/*$(soext)
1975         touch ../stamp-gnatlib2-$(RTSDIR)
1976         $(RM) ../stamp-gnatlib-$(RTSDIR)
1977
1978 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1979 #       successive target commands. Although the Gnu make documentation
1980 #       implies this is true on all systems, I suspect it may not be, So care
1981 #       has been taken to allow a sed script to look for ";)" and substitue
1982 #       for ";" the appropriate character in the range of lines below
1983 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1984
1985 # GNULLI Begin ###########################################################
1986
1987 ../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
1988         $(RMDIR) $(RTSDIR)
1989         $(MKDIR) $(RTSDIR)
1990         $(CHMOD) u+w $(RTSDIR)
1991 # Copy target independent sources
1992         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1993           $(LN_S) $(fsrcpfx)ada/$(f) $(RTSDIR) ;) true
1994 # Remove files to be replaced by target dependent sources
1995         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1996                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
1997         $(RM) $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb
1998 # Copy new target dependent sources
1999         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
2000                   $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \
2001                         $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
2002 # Copy generated target dependent sources
2003         $(RM) $(RTSDIR)/s-oscons.ads
2004         (cd $(RTSDIR); $(LN_S) ../s-oscons.ads s-oscons.ads)
2005         $(RM) ../stamp-gnatlib-$(RTSDIR)
2006         touch ../stamp-gnatlib1-$(RTSDIR)
2007
2008 # GNULLI End #############################################################
2009
2010 # Don't use semicolon separated shell commands that involve list expansions.
2011 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
2012 # line lengths in excess of 256 characters.
2013 # Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS)
2014 # is guaranteed to overflow the buffer.
2015
2016 gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
2017         $(MAKE) -C $(RTSDIR) \
2018                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2019                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2020                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
2021                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
2022                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2023                 srcdir=$(fsrcdir) \
2024                 -f ../Makefile $(LIBGNAT_OBJS)
2025         $(MAKE) -C $(RTSDIR) \
2026                 CC="`echo \"$(GCC_FOR_TARGET)\" \
2027                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
2028                 ADA_INCLUDES="" \
2029                 CFLAGS="$(GNATLIBCFLAGS)" \
2030                 ADAFLAGS="$(GNATLIBFLAGS)" \
2031                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
2032                 srcdir=$(fsrcdir) \
2033                 -f ../Makefile \
2034                 $(GNATRTL_OBJS)
2035         $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
2036         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
2037            $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
2038         ifneq ($(PREFIX_OBJS),)
2039                 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgccprefix$(arext) \
2040                   $(PREFIX_OBJS);
2041                 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgccprefix$(arext)
2042         endif
2043         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
2044         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
2045            $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
2046         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
2047         $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnala$(arext) \
2048            $(addprefix $(RTSDIR)/,$(GNATRTL_LINEARALGEBRA_OBJS))
2049         $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnala$(arext)
2050         ifeq ($(GMEM_LIB),gmemlib)
2051                 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
2052                   $(RTSDIR)/memtrack.o
2053                 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
2054         endif
2055         $(CHMOD) a-wx $(RTSDIR)/*.ali
2056         touch ../stamp-gnatlib-$(RTSDIR)
2057
2058 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2059 gnatlib-shared-default:
2060         $(MAKE) $(FLAGS_TO_PASS) \
2061              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2062              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2063              MULTISUBDIR="$(MULTISUBDIR)" \
2064              THREAD_KIND="$(THREAD_KIND)" \
2065              gnatlib
2066         $(RM) $(RTSDIR)/libgna*$(soext)
2067         cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
2068                 $(TARGET_LIBGCC2_CFLAGS) \
2069                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2070                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2071                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2072                 $(MISCLIB) -lm
2073         cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
2074                 $(TARGET_LIBGCC2_CFLAGS) \
2075                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2076                 $(GNATRTL_TASKING_OBJS) \
2077                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2078                 $(THREADSLIB)
2079         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2080                 libgnat$(soext)
2081         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2082                 libgnarl$(soext)
2083
2084 gnatlib-shared-dual:
2085         $(MAKE) $(FLAGS_TO_PASS) \
2086              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2087              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2088              MULTISUBDIR="$(MULTISUBDIR)" \
2089              THREAD_KIND="$(THREAD_KIND)" \
2090              gnatlib-shared-default
2091         $(MV) $(RTSDIR)/libgna*$(soext) .
2092         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2093         $(MAKE) $(FLAGS_TO_PASS) \
2094              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2095              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2096              MULTISUBDIR="$(MULTISUBDIR)" \
2097              THREAD_KIND="$(THREAD_KIND)" \
2098              gnatlib
2099         $(MV) libgna*$(soext) $(RTSDIR)
2100
2101 gnatlib-shared-dual-win32:
2102         $(MAKE) $(FLAGS_TO_PASS) \
2103              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2104              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2105              MULTISUBDIR="$(MULTISUBDIR)" \
2106              THREAD_KIND="$(THREAD_KIND)" \
2107              gnatlib-shared-win32
2108         $(MV) $(RTSDIR)/libgna*$(soext) .
2109         $(RM) ../stamp-gnatlib2-$(RTSDIR)
2110         $(MAKE) $(FLAGS_TO_PASS) \
2111              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2112              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2113              MULTISUBDIR="$(MULTISUBDIR)" \
2114              THREAD_KIND="$(THREAD_KIND)" \
2115              gnatlib
2116         $(MV) libgna*$(soext) $(RTSDIR)
2117
2118 # ??? we need to add the option to support auto-import of arrays/records to
2119 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
2120 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
2121 # Windows.
2122 gnatlib-shared-win32:
2123         $(MAKE) $(FLAGS_TO_PASS) \
2124              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2125              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2126              MULTISUBDIR="$(MULTISUBDIR)" \
2127              THREAD_KIND="$(THREAD_KIND)" \
2128              gnatlib
2129         $(RM) $(RTSDIR)/libgna*$(soext)
2130         cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2131                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2132                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2133                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2134         cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2135                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2136                 $(GNATRTL_TASKING_OBJS) \
2137                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2138                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2139
2140 gnatlib-shared-darwin:
2141         $(MAKE) $(FLAGS_TO_PASS) \
2142              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2143              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
2144                             -fno-common" \
2145              MULTISUBDIR="$(MULTISUBDIR)" \
2146              THREAD_KIND="$(THREAD_KIND)" \
2147              gnatlib
2148         $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
2149         cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
2150                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2151                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2152                 $(SO_OPTS) \
2153                 $(MISCLIB) -lm
2154         cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
2155                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2156                 $(GNATRTL_TASKING_OBJS) \
2157                 $(SO_OPTS) \
2158                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2159         cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2160                 libgnat$(soext)
2161         cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2162                 libgnarl$(soext)
2163
2164 gnatlib-shared-vms:
2165         $(MAKE) $(FLAGS_TO_PASS) \
2166              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2167              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2168              MULTISUBDIR="$(MULTISUBDIR)" \
2169              THREAD_KIND="$(THREAD_KIND)" \
2170              gnatlib
2171         $(RM) $(RTSDIR)/libgna*$(soext)
2172         cd $(RTSDIR) && \
2173         ../../gnatsym -s SYMVEC_$$$$.opt \
2174         $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
2175         ../../xgcc -g -B../../ -shared -shared-libgcc \
2176            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
2177            sys\$$library:trace.exe \
2178            --for-linker=/noinform \
2179            --for-linker=SYMVEC_$$$$.opt \
2180            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2181         cd $(RTSDIR) && \
2182         ../../gnatsym -s SYMVEC_$$$$.opt \
2183         $(GNATRTL_TASKING_OBJS) && \
2184         ../../xgcc -g -B../../ -shared -shared-libgcc \
2185            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2186            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2187            sys\$$library:trace.exe \
2188            --for-linker=/noinform \
2189            --for-linker=SYMVEC_$$$$.opt \
2190            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2191
2192 gnatlib-shared:
2193         $(MAKE) $(FLAGS_TO_PASS) \
2194              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2195              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2196              MULTISUBDIR="$(MULTISUBDIR)" \
2197              THREAD_KIND="$(THREAD_KIND)" \
2198              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2199              $(GNATLIB_SHARED)
2200
2201 gnatlib-sjlj:
2202         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1-$(RTSDIR)
2203         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2204         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2205         $(MAKE) $(FLAGS_TO_PASS) \
2206              EH_MECHANISM="" \
2207              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2208              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2209              MULTISUBDIR="$(MULTISUBDIR)" \
2210              THREAD_KIND="$(THREAD_KIND)" \
2211              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2212
2213 gnatlib-zcx:
2214         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1-$(RTSDIR)
2215         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
2216         $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
2217         $(MAKE) $(FLAGS_TO_PASS) \
2218              EH_MECHANISM="-gcc" \
2219              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2220              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2221              MULTISUBDIR="$(MULTISUBDIR)" \
2222              THREAD_KIND="$(THREAD_KIND)" \
2223              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2224
2225 # .s files for cross-building
2226 gnat-cross: force
2227         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2228
2229 # Compiling object files from source files.
2230
2231 # Note that dependencies on obstack.h are not written
2232 # because that file is not part of GCC.
2233 # Dependencies on gvarargs.h are not written
2234 # because all that file does, when not compiling with GCC,
2235 # is include the system varargs.h.
2236
2237 b_gnatl.c : $(GNATLINK_OBJS)
2238         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2239 b_gnatl.o : b_gnatl.c
2240
2241 b_gnatm.c : $(GNATMAKE_OBJS)
2242         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2243 b_gnatm.o : b_gnatm.c
2244
2245 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2246 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2247
2248 # force no sibling call optimization on s-traceb.o so the number of stack
2249 # frames to be skipped when computing a call chain is not modified by
2250 # optimization. However we can do that only when building the runtime
2251 # (not the compiler) because the -fno-optimize-sibling-calls option exists
2252 # only in GCC 3 and above.
2253
2254 ifneq (,$(findstring xgcc,$(CC)))
2255 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
2256 else
2257 NO_SIBLING_ADAFLAGS=
2258 endif
2259
2260 s-traceb.o  : s-traceb.adb
2261         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2262               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
2263       $< $(OUTPUT_OPTION)
2264
2265 # force debugging information on s-tasdeb.o so that it is always
2266 # possible to set conditional breakpoints on tasks.
2267
2268 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
2269         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2270               $< $(OUTPUT_OPTION)
2271
2272 # force no function reordering on a-except.o because of the exclusion bounds
2273 # mechanism (see the source file for more detailed information). However we
2274 # can do that only when building the runtime (not the compiler) because the
2275 # -fno-toplevel-reorder option exists only in GCC 4.2 and above.
2276
2277 ifneq (,$(findstring xgcc,$(CC)))
2278 NO_REORDER_ADAFLAGS=-fno-toplevel-reorder
2279 else
2280 NO_REORDER_ADAFLAGS=
2281 endif
2282
2283 # force debugging information on a-except.o so that it is always
2284 # possible to set conditional breakpoints on exceptions.
2285 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
2286
2287 a-except.o  : a-except.adb a-except.ads
2288         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
2289               $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2290
2291 # compile s-except.o without optimization and with debug info to let the
2292 # debugger set breakpoints and inspect subprogram parameters on exception
2293 # related events.
2294
2295 s-except.o  : s-except.adb s-except.ads
2296         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2297               $< $(OUTPUT_OPTION)
2298
2299 # force debugging information on s-assert.o so that it is always
2300 # possible to set breakpoint on assert failures.
2301
2302 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
2303         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
2304               $< $(OUTPUT_OPTION)
2305
2306 adadecode.o : adadecode.c adadecode.h
2307 aux-io.o  : aux-io.c
2308 argv.o    : argv.c
2309 cal.o     : cal.c
2310 deftarg.o : deftarg.c
2311 errno.o   : errno.c
2312 exit.o    : adaint.h exit.c
2313 expect.o  : expect.c
2314 final.o   : final.c
2315 gmem.o    : gmem.c
2316 link.o    : link.c
2317 mkdir.o   : mkdir.c
2318 socket.o  : socket.c gsocket.h
2319 sysdep.o  : sysdep.c
2320 raise-gcc.o : raise-gcc.c raise.h
2321 raise.o   : raise.c raise.h
2322 vx_stack_info.o : vx_stack_info.c
2323
2324 cio.o     : cio.c
2325         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2326                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2327
2328 init.o    : init.c adaint.h raise.h
2329         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2330                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2331
2332 initialize.o : initialize.c raise.h
2333         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2334                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2335
2336 targext.o : targext.c
2337         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2338                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
2339                 $< $(OUTPUT_OPTION)
2340
2341 # No optimization to compile this file as optimizations (-O1 or above) breaks
2342 # the SEH handling on Windows. The reasons are not clear.
2343 seh_init.o : seh_init.c raise.h
2344         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
2345                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2346
2347 # Need to keep the frame pointer in this file to pop the stack properly on
2348 # some targets.
2349 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
2350         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2351               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2352
2353 # In GNU Make, ignore whether `stage*' exists.
2354 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2355 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2356
2357 force:
2358
2359 # Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS
2360
2361 ../../gnatlbr$(exeext): ../../prefix.o
2362         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2363         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2364         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2365
2366 ../../vms_help$(exeext):
2367         $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)"
2368         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help
2369         $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2370
2371 ../../gnat.hlp: ../../vms_help$(exeext)
2372         ../../vms_help$(exeext) $(fsrcdir)/ada/gnat.help_in \
2373                                 $(fsrcdir)/ada/vms_data.ads ../../gnat.hlp