OSDN Git Service

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