OSDN Git Service

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