OSDN Git Service

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