OSDN Git Service

2003-11-24 Jose Ruiz <ruiz@act-europe.fr>
[pf3gnuchains/gcc-fork.git] / gcc / ada / Makefile.in
1 # Makefile for GNU Ada Compiler (GNAT).
2 #   Copyright (C) 1994-2003 Free Software Foundation, Inc.
3
4 #This file is part of GCC.
5
6 #GCC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
10
11 #GCC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with GCC; see the file COPYING.  If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA.
20
21 # The makefile built from this file lives in the language subdirectory.
22 # Its purpose is to provide support for:
23 #
24 # 1) recursion where necessary, and only then (building .o's), and
25 # 2) building and debugging cc1 from the language subdirectory, and
26 # 3) nothing else.
27 #
28 # The parent makefile handles all other chores, with help from the
29 # language makefile fragment, of course.
30 #
31 # The targets for external use are:
32 # all, TAGS, ???mostlyclean, ???clean.
33
34 # This makefile will only work with Gnu make.
35 # The rules are written assuming a minimum subset of tools are available:
36 #
37 # Required:
38 #      MAKE:    Only Gnu make will work.
39 #      MV:      Must accept (at least) one, maybe wildcard, source argument,
40 #               a file or directory destination, and support creation/
41 #               modification date preservation.  Gnu mv -f works.
42 #      RM:      Must accept an arbitrary number of space separated file
43 #               arguments, or one wildcard argument. Gnu rm works.
44 #      RMDIR:   Must delete a directory and all its contents. Gnu rm -rf works.
45 #      ECHO:    Must support command line redirection. Any Unix-like
46 #               shell will typically provide this, otherwise a custom version
47 #               is trivial to write.
48 #      AR:      Gnu ar works.
49 #      MKDIR:   Gnu mkdir works.
50 #      CHMOD:   Gnu chmod works.
51 #      true:    Does nothing and returns a normal successful return code.
52 #      pwd:     Prints the current directory on stdout.
53 #      cd:      Change directory.
54 #
55 # Optional:
56 #      BISON:   Gnu bison works.
57 #      FLEX:    Gnu flex works.
58 #      Other miscellaneous tools for obscure targets.
59
60 # Tell GNU make 3.79 not to run this directory in parallel.
61 # Not all of the required dependencies are present.
62 .NOTPARALLEL:
63
64 # Suppress smart makes who think they know how to automake Yacc files
65 .y.c:
66
67 # Variables that exist for you to override.
68 # See below for how to change them for certain systems.
69
70 # Various ways of specifying flags for compilations:  
71 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
72 # BOOT_CFLAGS is the value of CFLAGS to pass
73 # to the stage2 and stage3 compilations
74 # XCFLAGS is used for most compilations but not when using the GCC just built.
75 XCFLAGS =
76 CFLAGS = -g
77 BOOT_CFLAGS = -O $(CFLAGS)
78 # These exists to be overridden by the x-* and t-* files, respectively.
79 X_CFLAGS =
80 T_CFLAGS =
81
82 X_CPPFLAGS =
83 T_CPPFLAGS =
84
85 X_ADA_CFLAGS =
86 T_ADA_CFLAGS =
87
88 X_ADAFLAGS =
89 T_ADAFLAGS =
90
91 CC = cc
92 BISON = bison
93 BISONFLAGS =
94 ECHO = echo
95 LEX = flex
96 LEXFLAGS =
97 CHMOD = chmod
98 LN = ln
99 LN_S = ln -s
100 CP = cp -p
101 MV = mv -f
102 RM = rm -f
103 RMDIR = rm -rf
104 MKDIR = mkdir -p
105 AR = ar
106 AR_FLAGS = rc
107 LS = ls
108 # How to invoke ranlib.
109 RANLIB = ranlib
110 # Test to use to see whether ranlib exists on the system.
111 RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
112
113 SHELL = @SHELL@
114 PWD_COMMAND = $${PWDCMD-pwd}
115 # How to copy preserving the date
116 INSTALL_DATA_DATE = cp -p
117 MAKEINFO = makeinfo
118 TEXI2DVI = texi2dvi
119 GNATBIND = $(STAGE_PREFIX)gnatbind
120 GNATBIND_FLAGS = -static -x
121 ADA_CFLAGS =
122 ADAFLAGS = -W -Wall -gnatpg -gnata
123 SOME_ADAFLAGS =-gnata
124 FORCE_DEBUG_ADAFLAGS = -g
125 GNATLIBFLAGS = -gnatpg
126 GNATLIBCFLAGS = -g -O2
127 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
128         -DIN_RTS
129 ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
130 ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
131         $(ADAFLAGS)
132 MOST_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
133         $(SOME_ADAFLAGS)
134 THREAD_KIND = native
135 THREADSLIB =
136 GMEM_LIB =
137 MISCLIB =
138 SYMLIB =
139 SYMDEPS = $(LIBINTL_DEP)
140 OUTPUT_OPTION = @OUTPUT_OPTION@
141
142 objext = .o
143 exeext =
144 arext  = .a
145 soext  = .so
146 shext  =
147
148 # Define this as & to perform parallel make on a Sequent.
149 # Note that this has some bugs, and it seems currently necessary 
150 # to compile all the gen* files first by hand to avoid erroneous results.
151 P =
152
153 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
154 # It omits XCFLAGS, and specifies -B./.
155 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
156 GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
157
158 # Tools to use when building a cross-compiler.
159 # These are used because `configure' appends `cross-make'
160 # to the makefile when making a cross-compiler.
161
162 # We don't use cross-make.  Instead we use the tools from the build tree,
163 # if they are available.
164 # program_transform_name and objdir are set by configure.in.
165 program_transform_name =
166 objdir = .
167
168 target=@target@
169 xmake_file = @xmake_file@
170 tmake_file = @tmake_file@
171 host_canonical=@host@
172 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
173 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
174
175 # Directory where sources are, from where we are.
176 srcdir = @srcdir@
177 VPATH = $(srcdir)
178
179 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
180 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
181 fcurdir := $(shell ${PWD_COMMAND})
182 fcurpfx := $(shell ${PWD_COMMAND})/
183
184 # Top build directory, relative to here.
185 top_builddir = ../..
186
187 # Internationalization library.
188 LIBINTL = @LIBINTL@
189 LIBINTL_DEP = @LIBINTL_DEP@
190
191 # Any system libraries needed just for GNAT.
192 SYSLIBS = @GNAT_LIBEXC@
193
194 # List of extra object files linked in with various programs.
195 EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o
196
197 # List extra gnattools
198 EXTRA_GNATTOOLS =
199
200 # List of target dependent sources, overridden below as necessary
201 TARGET_ADA_SRCS =
202
203 # Type of tools build we are doing; default is not compiling tools.
204 TOOLSCASE =
205
206 # End of variables for you to override.
207
208 all: all.indirect
209
210 # This tells GNU Make version 3 not to put all variables in the environment.
211 .NOEXPORT:
212
213 # tmake_file and xmake_file expand to lists with entries of the form
214 # $(srcdir)/config/...  but here $(srcdir) is the ada subdirectory so we
215 # need to adjust the paths.  There can't be spaces in the subst arguments
216 # or we get spurious spaces in the actual list of files to include.
217
218 # target overrides
219 ifneq ($(tmake_file),)
220 include $(subst /config,/../config,$(tmake_file))
221 endif
222
223 # host overrides
224 ifneq ($(xmake_file),)
225 include $(subst /config,/../config,$(xmake_file))
226 endif
227 \f
228 # Now figure out from those variables how to compile and link.
229
230 all.indirect: Makefile ../gnat1$(exeext)
231
232 # IN_GCC distinguishes between code compiled into GCC itself and other
233 # programs built during a bootstrap.
234 # autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
235 INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
236
237 # This is the variable actually used when we compile.
238 LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
239 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS) \
240         $(XCFLAGS)
241
242 # Likewise.
243 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
244
245 # This is where we get libiberty.a from.
246 LIBIBERTY = ../../libiberty/libiberty.a
247
248 # How to link with both our special library facilities
249 # and the system's installed libraries.
250 LIBS = $(LIBINTL) $(LIBIBERTY) $(SYSLIBS)
251 LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY)
252 TOOLS_LIBS = $(LIBGNAT) $(EXTRA_GNATTOOLS_OBJS) ../../../libiberty/libiberty.a $(SYSLIBS)
253
254 # Specify the directories to be searched for header files.
255 # Both . and srcdir are used, in that order,
256 # so that tm.h and config.h will be found in the compilation
257 # subdirectory rather than in the source directory.
258 INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \
259         -I$(srcdir)/../../include
260
261 ADA_INCLUDES = -I- -I. -I$(srcdir)
262
263 INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \
264         -I$(fsrcdir)/../../include -I$(fsrcdir)/..
265 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)
266
267 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
268 .SUFFIXES: .in .def
269
270 # Say how to compile Ada programs.
271 .SUFFIXES: .ada .adb .ads .asm
272
273 # Always use -I$(srcdir)/config when compiling.
274 .asm.o:
275         $(CC) -c -x assembler $< $(OUTPUT_OPTION)
276
277 .c.o:
278         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
279           $(OUTPUT_OPTION)
280
281 .adb.o:
282         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
283
284 .ads.o:
285         $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
286
287 # how to regenerate this file
288 Makefile: ../config.status $(srcdir)/Makefile.in $(srcdir)/../version.c
289         cd ..; \
290         LANGUAGES="$(CONFIG_LANGUAGES)" \
291         CONFIG_HEADERS= \
292         CONFIG_FILES=ada/Makefile $(SHELL) config.status
293
294 # This tells GNU make version 3 not to export all the variables
295 # defined in this file into the environment.
296 .NOEXPORT:
297 \f
298 # Lists of files for various purposes.
299
300 GNATLINK_OBJS = gnatlink.o link.o \
301  ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o gnatvsn.o \
302  hostparm.o namet.o opt.o osint.o output.o rident.o sdefault.o \
303  stylesw.o switch.o table.o tree_io.o types.o validsw.o widechar.o
304
305 GNATMAKE_OBJS = ctrl_c.o ali.o ali-util.o s-casuti.o \
306  alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
307  erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
308  gnatmake.o gnatvsn.o hostparm.o krunch.o lib.o make.o makeusg.o \
309  mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \
310  namet.o nlists.o opt.o osint.o osint-m.o output.o \
311  prj.o prj-attr.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \
312  prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
313  rident.o 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 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<4nintnam.ads \
344 s-inmaop.adb<5ninmaop.adb \
345 s-intman.adb<5nintman.adb \
346 s-osinte.ads<5nosinte.ads \
347 s-osprim.adb<7sosprim.adb \
348 s-taprop.adb<5ntaprop.adb \
349 s-taspri.ads<5ntaspri.ads
350
351 # Default shared object option. Note that we rely on the fact that the "soname"
352 # option will always be present and last in this flag, so that we can have
353 # $(SO_OPTS)libgnat-x.xx
354
355 SO_OPTS = -Wl,-soname,
356
357 # Default gnatlib-shared target.
358 # By default, equivalent to gnatlib.
359 # Set to gnatlib-shared-default, gnatlib-shared-dual, or a platform specific
360 # target when supported.
361 GNATLIB_SHARED = gnatlib
362
363 # default value for gnatmake's target dependent file
364 MLIB_TGT = mlib-tgt
365
366 # By default, do not distribute prefix.o (in libgccprefix), since it is only
367 # needed by external GNAT tools such as gnatdist and Glide.
368 # Override this variable on native platforms when needed.
369 PREFIX_OBJS =
370
371 # To avoid duplicate code, use this variable to set PREFIX_OBJS when needed:
372 PREFIX_REAL_OBJS = ../prefix.o \
373   ../../libiberty/concat.o     \
374   ../../libiberty/xmalloc.o    \
375   ../../libiberty/xstrdup.o    \
376   ../../libiberty/xexit.o
377
378 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
379 # $(strip STRING) removes leading and trailing spaces from STRING.
380 # If what's left is null then it's a match.
381
382 ifeq ($(strip $(filter-out %86 os2 OS2 os2_emx,$(arch) $(osys))),)
383   LIBGNAT_TARGET_PAIRS = \
384   a-excpol.adb<4wexcpol.adb \
385   a-intnam.ads<4nintnam.ads \
386   a-numaux.adb<86numaux.adb \
387   a-numaux.ads<86numaux.ads \
388   s-inmaop.adb<5ninmaop.adb \
389   s-interr.adb<5ointerr.adb \
390   s-intman.adb<5nintman.adb \
391   s-mastop.adb<5omastop.adb \
392   s-osinte.adb<5oosinte.adb \
393   s-osinte.ads<5oosinte.ads \
394   s-osprim.adb<5oosprim.adb \
395   s-parame.adb<5oparame.adb \
396   system.ads<5osystem.ads \
397   s-taprop.adb<5otaprop.adb \
398   s-taspri.ads<5otaspri.ads
399
400   EXTRA_GNATRTL_NONTASKING_OBJS = \
401   i-os2err.o \
402   i-os2lib.o \
403   i-os2syn.o \
404   i-os2thr.o
405 endif
406
407 ifeq ($(strip $(filter-out %86 interix%,$(arch) $(osys))),)
408   LIBGNAT_TARGET_PAIRS = \
409   a-excpol.adb<4hexcpol.adb \
410   a-intnam.ads<4pintnam.ads \
411   a-numaux.adb<86numaux.adb \
412   a-numaux.ads<86numaux.ads \
413   g-soccon.ads<3psoccon.ads \
414   s-inmaop.adb<7sinmaop.adb \
415   s-intman.adb<7sintman.adb \
416   s-mastop.adb<5omastop.adb \
417   s-osinte.adb<7sosinte.adb \
418   s-osinte.ads<5posinte.ads \
419   s-osprim.adb<5posprim.adb \
420   s-taprop.adb<7staprop.adb \
421   system.ads<5psystem.ads \
422   s-taspri.ads<7staspri.ads \
423   s-tpopsp.adb<7stpopsp.adb
424
425   THREADSLIB = -lgthreads -lmalloc
426   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
427 endif
428
429 # sysv5uw is SCO UnixWare 7
430 ifeq ($(strip $(filter-out %86 sysv5uw%,$(arch) $(osys))),)
431   LIBGNAT_TARGET_PAIRS = \
432   a-excpol.adb<4wexcpol.adb \
433   a-intnam.ads<41intnam.ads \
434   a-numaux.adb<86numaux.adb \
435   a-numaux.ads<86numaux.ads \
436   s-inmaop.adb<7sinmaop.adb \
437   s-intman.adb<7sintman.adb \
438   s-mastop.adb<5omastop.adb \
439   s-osinte.ads<51osinte.ads \
440   s-osinte.adb<51osinte.adb \
441   s-osprim.adb<5posprim.adb \
442   s-taprop.adb<7staprop.adb \
443   s-taspri.ads<7staspri.ads \
444   s-tpopsp.adb<5atpopsp.adb \
445   system.ads<51system.ads \
446   g-soccon.ads<31soccon.ads \
447   g-soliop.ads<31soliop.ads
448
449   THREADSLIB = -lthread
450   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
451   SO_OPTS = -Wl,-h,
452   GNATLIB_SHARED = gnatlib-shared-dual
453   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
454 endif
455
456 ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),)
457   LIBGNAT_TARGET_PAIRS = \
458   a-sytaco.ads<4zsytaco.ads \
459   a-sytaco.adb<4zsytaco.adb \
460   a-intnam.ads<4zintnam.ads \
461   a-numaux.ads<4znumaux.ads \
462   s-inmaop.adb<7sinmaop.adb \
463   s-interr.adb<5zinterr.adb \
464   s-intman.ads<5zintman.ads \
465   s-intman.adb<5zintman.adb \
466   s-osinte.adb<5zosinte.adb \
467   s-osinte.ads<5zosinte.ads \
468   s-osprim.adb<5zosprim.adb \
469   s-parame.ads<5zparame.ads \
470   s-taprop.adb<5ztaprop.adb \
471   s-tpopsp.adb<5ztpopsp.adb \
472   s-taspri.ads<5ztaspri.ads \
473   s-vxwork.ads<5avxwork.ads \
474   g-soccon.ads<3zsoccon.ads \
475   g-socthi.ads<3zsocthi.ads \
476   g-socthi.adb<3zsocthi.adb \
477   system.ads<5zsystem.ads
478
479   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
480   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
481 endif
482
483 ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
484   LIBGNAT_TARGET_PAIRS = \
485   a-sytaco.ads<4zsytaco.ads \
486   a-sytaco.adb<4zsytaco.adb \
487   a-intnam.ads<4zintnam.ads \
488   a-numaux.ads<4znumaux.ads \
489   s-inmaop.adb<7sinmaop.adb \
490   s-interr.adb<5zinterr.adb \
491   s-intman.ads<5zintman.ads \
492   s-intman.adb<5zintman.adb \
493   s-osinte.adb<5zosinte.adb \
494   s-osinte.ads<5zosinte.ads \
495   s-osprim.adb<5zosprim.adb \
496   s-parame.ads<5zparame.ads \
497   s-taprop.adb<5ztaprop.adb \
498   s-taspri.ads<5ztaspri.ads \
499   s-tpopsp.adb<5ztpopsp.adb \
500   s-vxwork.ads<5kvxwork.ads \
501   g-soccon.ads<3zsoccon.ads \
502   g-socthi.ads<3zsocthi.ads \
503   g-socthi.adb<3zsocthi.adb \
504   system.ads<5ksystem.ads
505
506   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
507
508   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
509   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
510
511   ifeq ($(strip $(filter-out yes,$(TRACE))),)
512     LIBGNAT_TARGET_PAIRS += \
513     s-traces.adb<7straces.adb \
514     s-tratas.adb<7stratas.adb \
515     s-trafor.adb<7strafor.adb \
516     s-trafor.ads<7strafor.ads \
517     s-tfsetr.adb<5ztfsetr.adb 
518   endif
519 endif
520
521 ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
522   LIBGNAT_TARGET_PAIRS = \
523   a-sytaco.ads<4zsytaco.ads \
524   a-sytaco.adb<4zsytaco.adb \
525   a-intnam.ads<4zintnam.ads \
526   a-numaux.ads<4znumaux.ads \
527   s-inmaop.adb<7sinmaop.adb \
528   s-interr.adb<5zinterr.adb \
529   s-intman.ads<5zintman.ads \
530   s-intman.adb<5zintman.adb \
531   s-osinte.adb<5zosinte.adb \
532   s-osinte.ads<5zosinte.ads \
533   s-osprim.adb<5zosprim.adb \
534   s-parame.ads<5zparame.ads \
535   s-taprop.adb<5ztaprop.adb \
536   s-taspri.ads<5ztaspri.ads \
537   s-tpopsp.adb<5ztpopsp.adb \
538   s-vxwork.ads<5pvxwork.ads \
539   g-soccon.ads<3zsoccon.ads \
540   g-socthi.ads<3zsocthi.ads \
541   g-socthi.adb<3zsocthi.adb \
542   system.ads<5ysystem.ads
543
544   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
545
546   EXTRA_HIE_NONE_TARGET_PAIRS= \
547   system.ads<50system.ads
548
549   EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads
550   EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o
551   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
552   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
553   HIE_RAVEN_TARGET_PAIRS=\
554   $(HIE_NONE_TARGET_PAIRS) \
555   a-reatim.ads<1areatim.ads \
556   a-reatim.adb<1areatim.adb \
557   a-retide.adb<1aretide.adb \
558   a-interr.adb<1ainterr.adb \
559   s-interr.ads<1sinterr.ads \
560   s-interr.adb<1sinterr.adb \
561   s-taskin.ads<1staskin.ads \
562   s-taskin.adb<1staskin.adb \
563   s-tarest.adb<1starest.adb \
564   s-tposen.ads<1stposen.ads \
565   s-tposen.adb<1stposen.adb \
566   s-osinte.adb<1sosinte.adb \
567   s-taprop.ads<1staprop.ads \
568   s-taprop.adb<1staprop.adb \
569   s-taprob.ads<1staprob.ads \
570   s-taprob.adb<1staprob.adb \
571   a-sytaco.ads<1asytaco.ads \
572   a-sytaco.adb<1asytaco.adb \
573   a-intnam.ads<4zintnam.ads \
574   s-osinte.ads<5zosinte.ads \
575   s-parame.ads<5zparame.ads \
576   s-taspri.ads<5ztaspri.ads \
577   s-vxwork.ads<5pvxwork.ads \
578   a-taside.adb<1ataside.adb \
579
580   CERT_LEVEL_B_TARGET_PAIRS=\
581   a-tags.ads<1atags.ads     \
582   a-tags.adb<1atags.adb     \
583   a-except.adb<2aexcept.adb \
584   a-except.ads<2aexcept.ads \
585   a-excach.adb<2aexcach.adb \
586   i-c.ads<1ic.ads           \
587   g-io.adb<2gio.adb         \
588   s-init.ads<2sinit.ads     \
589   s-init.adb<5zinit.adb     \
590   s-memory.adb<2smemory.adb \
591   s-memory.ads<2smemory.ads \
592   s-osinte.ads<2sosinte.ads \
593   s-secsta.ads<2ssecsta.ads \
594   s-secsta.adb<2ssecsta.adb \
595   s-soflin.adb<2ssoflin.adb \
596   s-soflin.ads<2ssoflin.ads \
597   s-stalib.adb<1sstalib.adb \
598   s-stalib.ads<1sstalib.ads \
599   s-thread.adb<5zthread.adb \
600   s-thrini.ads<2sthrini.ads \
601   s-thrini.adb<5zthrini.adb \
602   s-tiitho.adb<5ztiitho.adb \
603   s-traceb.adb<2straceb.adb \
604   s-traceb.ads<2straceb.ads \
605   system.ads<5isystem.ads
606
607   ifeq ($(strip $(filter-out yes,$(TRACE))),)
608     LIBGNAT_TARGET_PAIRS += \
609     s-traces.adb<7straces.adb \
610     s-trafor.adb<7strafor.adb \
611     s-trafor.ads<7strafor.ads \
612     s-tratas.adb<7stratas.adb \
613     s-tfsetr.adb<5ztfsetr.adb 
614   endif
615 endif
616
617
618 ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
619   LIBGNAT_TARGET_PAIRS = \
620   a-sytaco.ads<4zsytaco.ads \
621   a-sytaco.adb<4zsytaco.adb \
622   a-intnam.ads<4zintnam.ads \
623   a-numaux.ads<4znumaux.ads \
624   s-inmaop.adb<7sinmaop.adb \
625   s-interr.adb<5zinterr.adb \
626   s-intman.ads<5zintman.ads \
627   s-intman.adb<5zintman.adb \
628   s-osinte.adb<5zosinte.adb \
629   s-osinte.ads<5zosinte.ads \
630   s-osprim.adb<5zosprim.adb \
631   s-parame.ads<5yparame.ads \
632   s-taprop.adb<5ztaprop.adb \
633   s-taspri.ads<5ztaspri.ads \
634   s-thread.adb<5zthread.adb \
635   s-thrini.ads<2sthrini.ads \
636   s-thrini.adb<5zthrini.adb \
637   s-tiitho.adb<5ytiitho.adb \
638   s-tpopsp.adb<5ztpopsp.adb \
639   s-vxwork.ads<5pvxwork.ads \
640   g-soccon.ads<3zsoccon.ads \
641   g-socthi.ads<3zsocthi.ads \
642   g-socthi.adb<3zsocthi.adb \
643   system.ads<5ysystem.ads
644
645   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
646
647   EXTRA_HIE_NONE_TARGET_PAIRS= \
648   system.ads<50system.ads
649
650   EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads
651   EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o
652   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-thread.o s-thrini.o
653   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
654   HIE_RAVEN_TARGET_PAIRS=\
655   $(HIE_NONE_TARGET_PAIRS) \
656   a-reatim.ads<1areatim.ads \
657   a-reatim.adb<1areatim.adb \
658   a-retide.adb<1aretide.adb \
659   a-interr.adb<1ainterr.adb \
660   s-interr.ads<1sinterr.ads \
661   s-interr.adb<1sinterr.adb \
662   s-taskin.ads<1staskin.ads \
663   s-taskin.adb<1staskin.adb \
664   s-tarest.adb<1starest.adb \
665   s-tposen.ads<1stposen.ads \
666   s-tposen.adb<1stposen.adb \
667   s-osinte.adb<1sosinte.adb \
668   s-taprop.ads<1staprop.ads \
669   s-taprop.adb<1staprop.adb \
670   s-taprob.ads<1staprob.ads \
671   s-taprob.adb<1staprob.adb \
672   a-sytaco.ads<1asytaco.ads \
673   a-sytaco.adb<1asytaco.adb \
674   a-intnam.ads<4zintnam.ads \
675   s-osinte.ads<5zosinte.ads \
676   s-parame.ads<5zparame.ads \
677   s-taspri.ads<5ztaspri.ads \
678   s-vxwork.ads<5pvxwork.ads \
679   a-taside.adb<1ataside.adb \
680
681   CERT_LEVEL_B_TARGET_PAIRS=\
682   a-tags.ads<1atags.ads     \
683   a-tags.adb<1atags.adb     \
684   a-except.adb<2aexcept.adb \
685   a-except.ads<2aexcept.ads \
686   a-excach.adb<2aexcach.adb \
687   i-c.ads<1ic.ads           \
688   g-io.adb<2gio.adb         \
689   s-init.ads<2sinit.ads     \
690   s-init.adb<5zinit.adb     \
691   s-memory.adb<2smemory.adb \
692   s-memory.ads<2smemory.ads \
693   s-osinte.ads<2sosinte.ads \
694   s-secsta.ads<2ssecsta.ads \
695   s-secsta.adb<2ssecsta.adb \
696   s-soflin.adb<2ssoflin.adb \
697   s-soflin.ads<2ssoflin.ads \
698   s-stalib.adb<1sstalib.adb \
699   s-stalib.ads<1sstalib.ads \
700   s-thread.adb<5zthread.adb \
701   s-thrini.ads<2sthrini.ads \
702   s-thrini.adb<5zthrini.adb \
703   s-tiitho.adb<5ytiitho.adb \
704   s-traceb.adb<2straceb.adb \
705   s-traceb.ads<2straceb.ads \
706   system.ads<5isystem.ads
707
708   ifeq ($(strip $(filter-out yes,$(TRACE))),)
709     LIBGNAT_TARGET_PAIRS += \
710     s-traces.adb<7straces.adb \
711     s-trafor.adb<7strafor.adb \
712     s-trafor.ads<7strafor.ads \
713     s-tratas.adb<7stratas.adb \
714     s-tfsetr.adb<5ztfsetr.adb 
715   endif
716 endif
717
718 ifeq ($(strip $(filter-out powerpc% unknown elf,$(targ))),)
719   EXTRA_HIE_NONE_TARGET_PAIRS= \
720   system.ads<59system.ads
721
722   LIBGNAT_TARGET_PAIRS = \
723   $(HIE_NONE_TARGET_PAIRS) \
724   $(EXTRA_HIE_NONE_TARGET_PAIRS)
725 endif
726
727 ifeq ($(strip $(filter-out sparc% unknown elf,$(targ))),)
728   EXTRA_HIE_NONE_TARGET_PAIRS= \
729   system.ads<5rsystem.ads
730
731   LIBGNAT_TARGET_PAIRS = \
732   $(HIE_NONE_TARGET_PAIRS) \
733   $(EXTRA_HIE_NONE_TARGET_PAIRS)
734 endif
735
736 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
737   LIBGNAT_TARGET_PAIRS = \
738   a-sytaco.ads<4zsytaco.ads \
739   a-sytaco.adb<4zsytaco.adb \
740   a-intnam.ads<4zintnam.ads \
741   a-numaux.ads<4znumaux.ads \
742   s-inmaop.adb<7sinmaop.adb \
743   s-interr.adb<5zinterr.adb \
744   s-intman.ads<5zintman.ads \
745   s-intman.adb<5zintman.adb \
746   s-osinte.adb<5zosinte.adb \
747   s-osinte.ads<5zosinte.ads \
748   s-osprim.adb<5zosprim.adb \
749   s-parame.ads<5zparame.ads \
750   s-taprop.adb<5ztaprop.adb \
751   s-taspri.ads<5ztaspri.ads \
752   s-tpopsp.adb<5ztpopsp.adb \
753   s-vxwork.ads<5svxwork.ads \
754   g-soccon.ads<3zsoccon.ads \
755   g-socthi.ads<3zsocthi.ads \
756   g-socthi.adb<3zsocthi.adb \
757   system.ads<5csystem.ads   \
758
759   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
760
761   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
762   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
763 endif
764
765 ifeq ($(strip $(filter-out xscale% coff wrs vx%,$(targ))),)
766   LIBGNAT_TARGET_PAIRS = \
767   a-sytaco.ads<4zsytaco.ads \
768   a-sytaco.adb<4zsytaco.adb \
769   a-intnam.ads<4zintnam.ads \
770   a-numaux.ads<4znumaux.ads \
771   s-inmaop.adb<7sinmaop.adb \
772   s-interr.adb<5zinterr.adb \
773   s-intman.ads<5zintman.ads \
774   s-intman.adb<5zintman.adb \
775   s-osinte.adb<5zosinte.adb \
776   s-osinte.ads<5zosinte.ads \
777   s-osprim.adb<5zosprim.adb \
778   s-parame.ads<5zparame.ads \
779   s-taprop.adb<5ztaprop.adb \
780   s-taspri.ads<5ztaspri.ads \
781   s-tpopsp.adb<5ztpopsp.adb \
782   s-vxwork.ads<5xvxwork.ads \
783   g-soccon.ads<3zsoccon.ads \
784   g-socthi.ads<3zsocthi.ads \
785   g-socthi.adb<3zsocthi.adb \
786   system.ads<5rsystem.ads
787
788   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
789
790   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
791   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
792 endif
793
794 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
795   LIBGNAT_TARGET_PAIRS = \
796   a-sytaco.ads<4zsytaco.ads \
797   a-sytaco.adb<4zsytaco.adb \
798   a-intnam.ads<4zintnam.ads \
799   a-numaux.ads<4znumaux.ads \
800   s-inmaop.adb<7sinmaop.adb \
801   s-interr.adb<5zinterr.adb \
802   s-intman.ads<5zintman.ads \
803   s-intman.adb<5zintman.adb \
804   s-osinte.adb<5zosinte.adb \
805   s-osinte.ads<5zosinte.ads \
806   s-osprim.adb<5zosprim.adb \
807   s-parame.ads<5zparame.ads \
808   s-taprop.adb<5ztaprop.adb \
809   s-taspri.ads<5ztaspri.ads \
810   s-tpopsp.adb<5ztpopsp.adb \
811   s-vxwork.ads<5mvxwork.ads \
812   g-soccon.ads<3zsoccon.ads \
813   g-socthi.ads<3zsocthi.ads \
814   g-socthi.adb<3zsocthi.adb \
815   system.ads<5msystem.ads
816
817   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
818
819   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
820   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
821 endif
822
823 ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
824   LIBGNAT_TARGET_PAIRS = \
825   a-intnam.ads<4sintnam.ads \
826   s-inmaop.adb<7sinmaop.adb \
827   s-intman.adb<5sintman.adb \
828   s-osinte.adb<5sosinte.adb \
829   s-osinte.ads<5sosinte.ads \
830   s-osprim.adb<5sosprim.adb \
831   s-parame.adb<5sparame.adb \
832   s-taprop.adb<5staprop.adb \
833   s-tasinf.adb<5stasinf.adb \
834   s-tasinf.ads<5stasinf.ads \
835   s-taspri.ads<5staspri.ads \
836   s-tpopsp.adb<5stpopsp.adb \
837   g-soccon.ads<3ssoccon.ads \
838   g-soliop.ads<3ssoliop.ads \
839   system.ads<5ssystem.ads
840
841   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5sml-tgt.adb
842
843   THREADSLIB = -lposix4 -lthread
844   MISCLIB = -lposix4 -lnsl -lsocket
845   SYMLIB = -laddr2line -lbfd $(LIBINTL)
846   SO_OPTS = -Wl,-h,
847   GNATLIB_SHARED = gnatlib-shared-dual
848   GMEM_LIB = gmemlib
849   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
850   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
851
852   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
853     LIBGNAT_TARGET_PAIRS = \
854     a-intnam.ads<4sintnam.ads \
855     s-inmaop.adb<7sinmaop.adb \
856     s-intman.adb<5sintman.adb \
857     s-osinte.adb<7sosinte.adb \
858     s-osinte.ads<5tosinte.ads \
859     s-osprim.adb<5sosprim.adb \
860     s-taprop.adb<7staprop.adb \
861     s-taspri.ads<7staspri.ads \
862     s-tpopsp.adb<7stpopsp.adb \
863     g-soccon.ads<3ssoccon.ads \
864     g-soliop.ads<3ssoliop.ads \
865     system.ads<5ssystem.ads
866
867     THREADSLIB = -lgthreads -lmalloc
868   endif
869
870   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
871     LIBGNAT_TARGET_PAIRS = \
872     a-intnam.ads<4sintnam.ads \
873     s-inmaop.adb<7sinmaop.adb \
874     s-intman.adb<7sintman.adb \
875     s-osinte.adb<5iosinte.adb \
876     s-osinte.ads<54osinte.ads \
877     s-osprim.adb<5sosprim.adb \
878     s-taprop.adb<7staprop.adb \
879     s-taspri.ads<7staspri.ads \
880     s-tpopsp.adb<5atpopsp.adb \
881     g-soccon.ads<3ssoccon.ads \
882     g-soliop.ads<3ssoliop.ads \
883     system.ads<5ssystem.ads
884
885     THREADSLIB = -lposix4 -lpthread
886   endif
887
888   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
889     LIBGNAT_TARGET_PAIRS = \
890     a-intnam.ads<4sintnam.ads \
891     s-inmaop.adb<7sinmaop.adb \
892     s-intman.adb<5sintman.adb \
893     s-osinte.adb<5sosinte.adb \
894     s-osinte.ads<5sosinte.ads \
895     s-osprim.adb<5sosprim.adb \
896     s-parame.adb<5sparame.adb \
897     s-taprop.adb<5staprop.adb \
898     s-tasinf.adb<5stasinf.adb \
899     s-tasinf.ads<5stasinf.ads \
900     s-taspri.ads<5staspri.ads \
901     s-tpopsp.adb<5stpopsp.adb \
902     g-soccon.ads<3ssoccon.ads \
903     g-soliop.ads<3ssoliop.ads \
904     system.ads<5usystem.ads
905   endif
906 endif
907
908 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
909   LIBGNAT_TARGET_PAIRS = \
910   a-numaux.adb<86numaux.adb \
911   a-numaux.ads<86numaux.ads \
912   a-intnam.ads<4sintnam.ads \
913   s-inmaop.adb<7sinmaop.adb \
914   s-intman.adb<5sintman.adb \
915   s-mastop.adb<5omastop.adb \
916   s-osinte.adb<5sosinte.adb \
917   s-osinte.ads<5sosinte.ads \
918   s-osprim.adb<5sosprim.adb \
919   s-parame.adb<5sparame.adb \
920   s-taprop.adb<5staprop.adb \
921   s-tasinf.adb<5stasinf.adb \
922   s-tasinf.ads<5stasinf.ads \
923   s-taspri.ads<5staspri.ads \
924   s-tpopsp.adb<5stpopsp.adb \
925   g-soccon.ads<3ssoccon.ads \
926   g-soliop.ads<3ssoliop.ads \
927   system.ads<5esystem.ads
928
929   THREADSLIB = -lposix4 -lthread
930   MISCLIB = -lposix4 -lnsl -lsocket
931   SO_OPTS = -Wl,-h,
932   GNATLIB_SHARED = gnatlib-shared-dual
933   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
934   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
935 endif
936
937 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
938   LIBGNAT_TARGET_PAIRS = \
939   a-intnam.ads<4lintnam.ads \
940   a-numaux.adb<86numaux.adb \
941   a-numaux.ads<86numaux.ads \
942   s-inmaop.adb<7sinmaop.adb \
943   s-intman.adb<5lintman.adb \
944   s-mastop.adb<5omastop.adb \
945   s-osinte.adb<5iosinte.adb \
946   s-osinte.ads<5iosinte.ads \
947   s-osprim.adb<7sosprim.adb \
948   s-taprop.adb<5itaprop.adb \
949   s-taspri.ads<5itaspri.ads \
950   s-tpopsp.adb<5atpopsp.adb \
951   s-parame.adb<5lparame.adb \
952   system.ads<5lsystem.ads
953
954   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5lml-tgt.adb
955   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
956   THREADSLIB = -lpthread
957   GNATLIB_SHARED = gnatlib-shared-dual
958   GMEM_LIB = gmemlib
959   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
960   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
961
962   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
963     LIBGNAT_TARGET_PAIRS = \
964     a-intnam.ads<4lintnam.ads \
965     a-numaux.adb<86numaux.adb \
966     a-numaux.ads<86numaux.ads \
967     s-inmaop.adb<7sinmaop.adb \
968     s-intman.adb<5lintman.adb \
969     s-mastop.adb<5omastop.adb \
970     s-osinte.adb<7sosinte.adb \
971     s-osinte.ads<5losinte.ads \
972     s-osprim.adb<7sosprim.adb \
973     s-taprop.adb<7staprop.adb \
974     s-taspri.ads<7staspri.ads \
975     s-tpopsp.adb<7stpopsp.adb \
976     system.ads<5lsystem.ads
977
978     THREADSLIB = -lgthreads -lmalloc
979   endif
980 endif
981
982 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
983   LIBGNAT_TARGET_PAIRS = \
984   a-intnam.ads<45intnam.ads \
985   g-soccon.ads<35soccon.ads \
986   s-inmaop.adb<7sinmaop.adb \
987   s-intman.adb<7sintman.adb \
988   s-mastop.adb<5omastop.adb \
989   s-osinte.adb<55osinte.adb \
990   s-osinte.ads<55osinte.ads \
991   s-osprim.adb<7sosprim.adb \
992   s-taprop.adb<7staprop.adb \
993   s-taspri.ads<7staspri.ads \
994   s-tpopsp.adb<7stpopsp.adb \
995   system.ads<56system.ads
996
997   THREADSLIB=
998   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
999 endif
1000
1001 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
1002   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
1003     LIBGNAT_TARGET_PAIRS = \
1004     a-intnam.ads<4gintnam.ads \
1005     s-inmaop.adb<7sinmaop.adb \
1006     s-intman.adb<5fintman.adb \
1007     s-mastop.adb<5gmastop.adb \
1008     s-osinte.adb<5fosinte.adb \
1009     s-osinte.ads<5fosinte.ads \
1010     s-osprim.adb<7sosprim.adb \
1011     s-proinf.adb<5gproinf.adb \
1012     s-proinf.ads<5gproinf.ads \
1013     s-taprop.adb<5ftaprop.adb \
1014     s-tasinf.ads<5ftasinf.ads \
1015     s-taspri.ads<7staspri.ads \
1016     s-tpopsp.adb<7stpopsp.adb \
1017     s-traceb.adb<7straceb.adb \
1018     g-soccon.ads<3gsoccon.ads \
1019     system.ads<5gsystem.ads
1020
1021     THREADSLIB = -lpthread
1022     GNATLIB_SHARED = gnatlib-shared-default
1023
1024   else
1025     LIBGNAT_TARGET_PAIRS = \
1026     a-intnam.ads<4gintnam.ads \
1027     s-inmaop.adb<5ninmaop.adb \
1028     s-interr.adb<5ginterr.adb \
1029     s-intman.adb<5gintman.adb \
1030     s-mastop.adb<5gmastop.adb \
1031     s-osinte.adb<5fosinte.adb \
1032     s-osinte.ads<5gosinte.ads \
1033     s-osprim.adb<7sosprim.adb \
1034     s-proinf.adb<5gproinf.adb \
1035     s-proinf.ads<5gproinf.ads \
1036     s-taprop.adb<5gtaprop.adb \
1037     s-tasinf.adb<5gtasinf.adb \
1038     s-tasinf.ads<5gtasinf.ads \
1039     s-taspri.ads<7staspri.ads \
1040     s-traceb.adb<7straceb.adb \
1041     g-soccon.ads<3gsoccon.ads \
1042     system.ads<5fsystem.ads
1043
1044     THREADSLIB = -lathread
1045   endif
1046
1047   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5gml-tgt.adb
1048   TGT_LIB = -lexc
1049   MISCLIB = -lexc
1050   SO_OPTS = -Wl,-all,-set_version,sgi1.0,-update_registry,../so_locations,-soname,
1051   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1052   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
1053 endif
1054
1055 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
1056   LIBGNAT_TARGET_PAIRS = \
1057   a-excpol.adb<4wexcpol.adb \
1058   a-intnam.ads<4hintnam.ads \
1059   s-inmaop.adb<7sinmaop.adb \
1060   s-interr.adb<5ginterr.adb \
1061   s-intman.adb<7sintman.adb \
1062   s-osinte.adb<5hosinte.adb \
1063   s-osinte.ads<5hosinte.ads \
1064   s-parame.ads<5hparame.ads \
1065   s-osprim.adb<7sosprim.adb \
1066   s-taprop.adb<5htaprop.adb \
1067   s-taspri.ads<5htaspri.ads \
1068   s-tpopsp.adb<7stpopsp.adb \
1069   g-soccon.ads<3hsoccon.ads \
1070   system.ads<5hsystem.ads
1071
1072   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1073 endif
1074
1075 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
1076   LIBGNAT_TARGET_PAIRS = \
1077   a-intnam.ads<4hintnam.ads \
1078   s-inmaop.adb<7sinmaop.adb \
1079   s-intman.adb<7sintman.adb \
1080   s-osinte.adb<5iosinte.adb \
1081   s-osinte.ads<53osinte.ads \
1082   s-parame.ads<5hparame.ads \
1083   s-osprim.adb<7sosprim.adb \
1084   s-traceb.adb<5htraceb.adb \
1085   s-taprop.adb<7staprop.adb \
1086   s-taspri.ads<7staspri.ads \
1087   s-tpopsp.adb<5atpopsp.adb \
1088   g-soccon.ads<3hsoccon.ads \
1089   system.ads<5hsystem.ads
1090
1091   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5hml-tgt.adb
1092   TGT_LIB = /usr/lib/libcl.a
1093   THREADSLIB = -lpthread
1094   SYMLIB = -laddr2line -lbfd $(LIBINTL)
1095   GMEM_LIB = gmemlib
1096   soext = .sl
1097   SO_OPTS = -Wl,+h,
1098   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1099   GNATLIB_SHARED = gnatlib-shared-dual
1100   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
1101
1102   ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),)
1103     LIBGNAT_TARGET_PAIRS = \
1104     a-excpol.adb<4wexcpol.adb \
1105     a-intnam.ads<4hintnam.ads \
1106     s-inmaop.adb<7sinmaop.adb \
1107     s-interr.adb<5ginterr.adb \
1108     s-intman.adb<7sintman.adb \
1109     s-osinte.adb<5hosinte.adb \
1110     s-osinte.ads<5hosinte.ads \
1111     s-parame.ads<5hparame.ads \
1112     s-osprim.adb<7sosprim.adb \
1113     s-taprop.adb<5htaprop.adb \
1114     s-taspri.ads<5htaspri.ads \
1115     s-tpopsp.adb<7stpopsp.adb \
1116     g-soccon.ads<3hsoccon.ads \
1117     system.ads<5hsystem.ads
1118
1119     TGT_LIB =
1120     THREADSLIB = -lcma
1121   endif
1122 endif
1123
1124 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1125   LIBGNAT_TARGET_PAIRS = \
1126   a-intnam.ads<4cintnam.ads \
1127   s-inmaop.adb<7sinmaop.adb \
1128   s-intman.adb<7sintman.adb \
1129   s-osinte.adb<5bosinte.adb \
1130   s-osinte.ads<5bosinte.ads \
1131   s-osprim.adb<7sosprim.adb \
1132   s-taprop.adb<7staprop.adb \
1133   s-taspri.ads<7staspri.ads \
1134   s-tpopsp.adb<7stpopsp.adb \
1135   g-soccon.ads<3bsoccon.ads \
1136   system.ads<5bsystem.ads
1137
1138   THREADSLIB = -lpthreads
1139   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1140
1141   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
1142     LIBGNAT_TARGET_PAIRS = \
1143     a-intnam.ads<4cintnam.ads \
1144     s-inmaop.adb<7sinmaop.adb \
1145     s-intman.adb<7sintman.adb \
1146     s-osinte.adb<7sosinte.adb \
1147     s-osinte.ads<5cosinte.ads \
1148     s-osprim.adb<7sosprim.adb \
1149     s-taprop.adb<7staprop.adb \
1150     s-taspri.ads<7staspri.ads \
1151     s-tpopsp.adb<7stpopsp.adb \
1152     g-soccon.ads<3bsoccon.ads \
1153     system.ads<5bsystem.ads
1154
1155     THREADSLIB = -lgthreads -lmalloc
1156   endif
1157
1158   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5bml-tgt.adb
1159   GMEM_LIB = gmemlib
1160   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
1161
1162 endif
1163
1164 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1165   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1166     LIBGNAT_TARGET_PAIRS = \
1167     a-numaux.adb<86numaux.adb \
1168     a-numaux.ads<86numaux.ads \
1169     a-intnam.ads<42intnam.ads \
1170     s-mastop.adb<5omastop.adb \
1171     s-inmaop.adb<7sinmaop.adb \
1172     s-intman.adb<7sintman.adb \
1173     s-osinte.adb<56osinte.adb \
1174     s-osinte.ads<56osinte.ads \
1175     s-osprim.adb<7sosprim.adb \
1176     s-taprop.adb<56taprop.adb \
1177     s-taspri.ads<56taspri.ads \
1178     s-tpopsp.adb<56tpopsp.adb \
1179     system.ads<58system.ads
1180
1181     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1182
1183   else
1184     LIBGNAT_TARGET_PAIRS = \
1185     a-intnam.ads<42intnam.ads \
1186     s-inmaop.adb<7sinmaop.adb \
1187     s-intman.adb<7sintman.adb \
1188     s-osinte.adb<52osinte.adb \
1189     s-osinte.ads<52osinte.ads \
1190     s-osprim.adb<7sosprim.adb \
1191     s-taprop.adb<7staprop.adb \
1192     s-taspri.ads<7staspri.ads \
1193     s-tpopsp.adb<7stpopsp.adb \
1194     system.ads<57system.ads
1195
1196     ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
1197       LIBGNAT_TARGET_PAIRS = \
1198       a-intnam.ads<42intnam.ads \
1199       s-inmaop.adb<7sinmaop.adb \
1200       s-intman.adb<7sintman.adb \
1201       s-osinte.adb<56osinte.adb \
1202       s-osinte.ads<56osinte.ads \
1203       s-osprim.adb<7sosprim.adb \
1204       s-taprop.adb<56taprop.adb \
1205       s-taspri.ads<56taspri.ads \
1206       s-tpopsp.adb<56tpopsp.adb \
1207       system.ads<57system.ads
1208     endif
1209
1210   endif
1211 endif
1212
1213 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1214   LIBGNAT_TARGET_PAIRS = \
1215   a-intnam.ads<4rintnam.ads \
1216   s-inmaop.adb<7sinmaop.adb \
1217   s-intman.adb<7sintman.adb \
1218   s-osinte.adb<5rosinte.adb \
1219   s-osinte.ads<5rosinte.ads \
1220   s-osprim.adb<7sosprim.adb \
1221   s-parame.adb<5rparame.adb \
1222   s-taprop.adb<7staprop.adb \
1223   s-taspri.ads<7staspri.ads \
1224   s-tpopsp.adb<5rtpopsp.adb
1225 endif
1226
1227 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1228   LIBGNAT_TARGET_PAIRS = \
1229   a-intnam.ads<4aintnam.ads \
1230   s-inmaop.adb<7sinmaop.adb \
1231   s-intman.adb<7sintman.adb \
1232   s-mastop.adb<5amastop.adb \
1233   s-osinte.adb<5aosinte.adb \
1234   s-osinte.ads<5aosinte.ads \
1235   s-osprim.adb<5posprim.adb \
1236   s-taprop.adb<5ataprop.adb \
1237   s-tasinf.ads<5atasinf.ads \
1238   s-taspri.ads<5ataspri.ads \
1239   s-tpopsp.adb<5atpopsp.adb \
1240   s-traceb.adb<7straceb.adb \
1241   g-soccon.ads<3asoccon.ads \
1242   system.ads<5asystem.ads
1243
1244   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5aml-tgt.adb
1245
1246   GMEM_LIB=gmemlib
1247   SYMLIB = -laddr2line -lbfd $(LIBINTL)
1248   THREADSLIB = -lpthread -lmach -lexc -lrt
1249   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1250   GNATLIB_SHARED = gnatlib-shared-default
1251   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
1252 endif
1253
1254 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(host))),)
1255
1256 soext  = .exe
1257
1258 .SUFFIXES: .sym
1259
1260 .o.sym: 
1261         @ gnu:[bin]vmssymvec $<
1262 endif
1263
1264 ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1265 ifeq ($(strip $(filter-out alpha64% dec vms% openvms% alphavms%,$(targ))),)
1266   LIBGNAT_TARGET_PAIRS_AUX =
1267 else
1268 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1269   LIBGNAT_TARGET_PAIRS_AUX = \
1270   s-parame.ads<5xparame.ads
1271 else
1272   LIBGNAT_TARGET_PAIRS_AUX = \
1273   s-parame.ads<5vparame.ads
1274 endif
1275 endif
1276
1277   LIBGNAT_TARGET_PAIRS = \
1278   a-caldel.adb<4vcaldel.adb \
1279   a-calend.adb<4vcalend.adb \
1280   a-calend.ads<4vcalend.ads \
1281   a-excpol.adb<4wexcpol.adb \
1282   a-intnam.ads<4vintnam.ads \
1283   g-expect.adb<3vexpect.adb \
1284   g-soccon.ads<3vsoccon.ads \
1285   g-socthi.ads<3vsocthi.ads \
1286   g-socthi.adb<3vsocthi.adb \
1287   g-trasym.adb<3vtrasym.adb \
1288   i-cstrea.adb<6vcstrea.adb \
1289   i-cpp.adb<6vcpp.adb \
1290   interfac.ads<6vinterf.ads \
1291   s-asthan.adb<5vasthan.adb \
1292   s-inmaop.adb<5vinmaop.adb \
1293   s-interr.adb<5vinterr.adb \
1294   s-intman.adb<5vintman.adb \
1295   s-intman.ads<5vintman.ads \
1296   s-osinte.adb<5vosinte.adb \
1297   s-osinte.ads<5vosinte.ads \
1298   s-osprim.adb<5vosprim.adb \
1299   s-osprim.ads<5vosprim.ads \
1300   s-taprop.adb<5vtaprop.adb \
1301   s-taspri.ads<5vtaspri.ads \
1302   s-tpopsp.adb<7stpopsp.adb \
1303   s-tpopde.adb<5vtpopde.adb \
1304   s-tpopde.ads<5vtpopde.ads \
1305   s-traent.adb<5vtraent.adb \
1306   s-traent.ads<5vtraent.ads \
1307   s-vaflop.adb<5vvaflop.adb \
1308   system.ads<5xsystem.ads   \
1309   $(LIBGNAT_TARGET_PAIRS_AUX)
1310
1311   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5vml-tgt.adb
1312
1313   GNATLIB_SHARED=gnatlib-shared-vms
1314   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1315   EXTRA_LIBGNAT_OBJS=vmshandler.o
1316   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1317   EXTRA_GNATTOOLS = \
1318      ../../gnatlbr$(exeext) \
1319      ,,/../gnatsym$(exeext)
1320   # This command transforms (YYYYMMDD) into YY,MMDD
1321   GSMATCH_VERSION := $(shell grep "^ *Gnat_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
1322   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/' -e 's/\./_/g'))
1323   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1324 endif
1325
1326 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1327   LIBGNAT_TARGET_PAIRS = \
1328   a-calend.adb<4wcalend.adb \
1329   a-excpol.adb<4wexcpol.adb \
1330   a-intnam.ads<4wintnam.ads \
1331   a-numaux.adb<86numaux.adb \
1332   a-numaux.ads<86numaux.ads \
1333   s-gloloc.adb<5wgloloc.adb \
1334   s-inmaop.adb<5ninmaop.adb \
1335   s-interr.adb<5ginterr.adb \
1336   s-intman.adb<5wintman.adb \
1337   s-mastop.adb<5omastop.adb \
1338   s-memory.adb<5wmemory.adb \
1339   s-osinte.ads<5wosinte.ads \
1340   s-osprim.adb<5wosprim.adb \
1341   s-taprop.adb<5wtaprop.adb \
1342   s-taspri.ads<5wtaspri.ads \
1343   g-socthi.ads<3wsocthi.ads \
1344   g-socthi.adb<3wsocthi.adb \
1345   g-soccon.ads<3wsoccon.ads \
1346   g-soliop.ads<3wsoliop.ads \
1347   system.ads<5wsystem.ads
1348
1349   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5wml-tgt.adb
1350   MISCLIB = -lwsock32
1351   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
1352   GMEM_LIB = gmemlib
1353   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1354   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1355   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1356   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1357   soext = .dll
1358   GNATLIB_SHARED = gnatlib-shared-win32
1359   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
1360 endif
1361
1362 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1363   LIBGNAT_TARGET_PAIRS = \
1364   a-intnam.ads<4lintnam.ads \
1365   s-inmaop.adb<7sinmaop.adb \
1366   s-intman.adb<5lintman.adb \
1367   s-osinte.ads<5iosinte.ads \
1368   s-osinte.adb<5iosinte.adb \
1369   s-osprim.adb<7sosprim.adb \
1370   s-taprop.adb<5itaprop.adb \
1371   s-tpopsp.adb<5atpopsp.adb \
1372   s-taspri.ads<5itaspri.ads \
1373   system.ads<55system.ads
1374
1375   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
1376   MISCLIB=
1377   THREADSLIB=-lpthread
1378   GNATLIB_SHARED=gnatlib-shared-dual
1379   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1380   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
1381 endif
1382
1383 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1384   LIBGNAT_TARGET_PAIRS = \
1385   a-intnam.ads<4lintnam.ads \
1386   s-inmaop.adb<7sinmaop.adb \
1387   s-intman.adb<5lintman.adb \
1388   s-osinte.ads<5iosinte.ads \
1389   s-osinte.adb<5iosinte.adb \
1390   s-osprim.adb<7sosprim.adb \
1391   s-taprop.adb<5itaprop.adb \
1392   s-tpopsp.adb<5atpopsp.adb \
1393   s-taspri.ads<5itaspri.ads \
1394   system.ads<5nsystem.ads
1395
1396   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
1397   MISCLIB=
1398   THREADSLIB=-lpthread
1399   GNATLIB_SHARED=gnatlib-shared-dual
1400   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1401   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
1402 endif
1403
1404 # The runtime library for gnat comprises two directories.  One contains the
1405 # Ada source files that the compiler (gnat1) needs -- these files are listed
1406 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1407 # corresponding .ali files for the parts written in Ada, libgnat.a for
1408 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1409 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1410 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1411 # go into the directory.  The pthreads emulation is built in the threads
1412 # subdirectory and copied.
1413 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1414   errno.c exit.c cal.c ctrl_c.c \
1415   raise.h raise.c sysdep.c types.h aux-io.c init.c \
1416   final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c \
1417   $(EXTRA_LIBGNAT_SRCS)
1418
1419 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
1420   raise.o sysdep.o aux-io.o init.o cal.o final.o \
1421   tracebak.o expect.o mkdir.o socket.o $(EXTRA_LIBGNAT_OBJS)
1422
1423 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1424 #  the library installation will change and there will be a
1425 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1426 #  from ADA_INCLUDE_SRCS.
1427
1428 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1429 # the following include file:
1430
1431 include $(fsrcdir)/Makefile.rtl
1432
1433 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1434   g-trasym.o memtrack.o
1435
1436 # Files which are suitable in no run time/hi integrity mode
1437
1438 COMPILABLE_HIE_SOURCES= \
1439  system.ads   \
1440  ada.ads      \
1441  gnat.ads     \
1442  g-souinf.ads \
1443  interfac.ads \
1444  i-c.ads      \
1445  s-stoele.ads \
1446  s-stoele.adb \
1447  s-maccod.ads \
1448  s-unstyp.ads \
1449  s-fatflt.ads \
1450  s-fatlfl.ads \
1451  s-fatllf.ads \
1452  s-fatsfl.ads \
1453  s-secsta.ads \
1454  s-secsta.adb \
1455  a-tags.ads   \
1456  a-tags.adb  \
1457  a-except.ads \
1458  a-except.adb $(EXTRA_HIE_SOURCES)
1459
1460 NON_COMPILABLE_HIE_SOURCES= \
1461  a-unccon.ads \
1462  a-uncdea.ads \
1463  s-fatgen.adb \
1464  s-fatgen.ads \
1465  unchconv.ads \
1466  s-atacco.ads \
1467  s-atacco.adb \
1468  unchdeal.ads
1469
1470
1471 HIE_SOURCES = $(NON_COMPILABLE_HIE_SOURCES) $(COMPILABLE_HIE_SOURCES)
1472
1473 # Object to generate for the HI run time
1474
1475 HIE_OBJS =  \
1476  system.o   \
1477  ada.o      \
1478  a-except.o \
1479  gnat.o     \
1480  g-souinf.o \
1481  interfac.o \
1482  i-c.o      \
1483  s-stoele.o \
1484  s-maccod.o \
1485  s-unstyp.o \
1486  s-fatflt.o \
1487  s-fatlfl.o \
1488  s-fatllf.o \
1489  s-secsta.o \
1490  a-tags.o $(EXTRA_HIE_OBJS)
1491
1492 # Files which are needed in ravenscar mode
1493
1494 COMPILABLE_RAVEN_SOURCES = \
1495 $(COMPILABLE_HIE_SOURCES) \
1496  s-parame.ads \
1497  s-parame.adb \
1498  s-purexc.ads \
1499  s-osinte.ads \
1500  s-osinte.adb \
1501  s-tasinf.ads \
1502  s-tasinf.adb \
1503  s-taspri.ads \
1504  s-taprop.ads \
1505  s-taprop.adb \
1506  s-taskin.ads \
1507  s-taskin.adb \
1508  s-interr.ads \
1509  s-interr.adb \
1510  a-interr.ads \
1511  a-interr.adb \
1512  a-intnam.ads \
1513  a-reatim.ads \
1514  a-reatim.adb \
1515  a-retide.ads \
1516  a-retide.adb \
1517  s-taprob.ads \
1518  s-taprob.adb \
1519  s-tposen.ads \
1520  s-tposen.adb \
1521  s-tasres.ads \
1522  s-tarest.ads \
1523  s-tarest.adb \
1524  a-sytaco.ads \
1525  a-sytaco.adb \
1526  a-taside.ads \
1527  a-taside.adb $(EXTRA_RAVEN_SOURCES)
1528
1529 NON_COMPILABLE_RAVEN_SOURCES= $(NON_COMPILABLE_HIE_SOURCES)
1530
1531 RAVEN_SOURCES = $(NON_COMPILABLE_RAVEN_SOURCES) $(COMPILABLE_RAVEN_SOURCES)
1532
1533 # Objects to generate for the ravenscar run time
1534
1535 RAVEN_OBJS = \
1536  $(HIE_OBJS) \
1537  s-parame.o  \
1538  s-purexc.o  \
1539  s-osinte.o  \
1540  s-tasinf.o  \
1541  s-taspri.o  \
1542  s-taprop.o  \
1543  s-taskin.o  \
1544  s-interr.o  \
1545  a-interr.o  \
1546  a-intnam.o  \
1547  a-reatim.o  \
1548  a-retide.o  \
1549  s-taprob.o  \
1550  s-tposen.o  \
1551  s-tasres.o  \
1552  s-tarest.o  \
1553  a-sytaco.o \
1554  a-taside.o $(EXTRA_RAVEN_OBJS)
1555
1556
1557 # Files which are needed for the cert level B runtime
1558
1559 COMPILABLE_CERT_LEVEL_B_SOURCES = \
1560 $(COMPILABLE_HIE_SOURCES) \
1561  a-except.adb \
1562  a-except.ads \
1563  a-exctra.ads \
1564  a-exctra.adb \
1565  s-init.adb   \
1566  s-init.ads   \
1567  s-memory.adb \
1568  s-memory.ads \
1569  s-osinte.ads \
1570  s-soflin.adb \
1571  s-soflin.ads \
1572  s-stalib.adb \
1573  s-stalib.ads \
1574  s-thrini.adb \
1575  s-thrini.ads \
1576  s-assert.adb \
1577  s-assert.ads \
1578  s-exnint.adb \
1579  s-exnint.ads \
1580  s-strops.adb \
1581  s-strops.ads \
1582  s-thread.adb \
1583  s-thread.ads \
1584  s-traceb.adb \
1585  s-traceb.ads \
1586  s-traent.ads \
1587  s-traent.adb \
1588  g-debuti.ads \
1589  g-debuti.adb \
1590  g-io.adb     \
1591  g-io.ads     \
1592  $(EXTRA_CERT_LEVEL_B_SOURCES)
1593
1594 NON_COMPILABLE_CERT_LEVEL_B_SOURCES= \
1595  a-excach.adb \
1596  s-tiitho.adb \
1597  $(NON_COMPILABLE_HIE_SOURCES)
1598
1599 CERT_LEVEL_B_SOURCES = \
1600 $(NON_COMPILABLE_CERT_LEVEL_B_SOURCES) \
1601 $(COMPILABLE_CERT_LEVEL_B_SOURCES)
1602
1603 # Objects to generate for the cert level B run time
1604
1605 CERT_LEVEL_B_OBJS = \
1606  $(HIE_OBJS) \
1607  a-except.o  \
1608  a-excach.o  \
1609  s-init.o    \
1610  s-memory.o  \
1611  s-soflin.o  \
1612  s-stalib.o  \
1613  s-tiitho.o  \
1614  s-thrini.o  \
1615  s-traceb.o  \
1616  s-assert.o  \
1617  s-exnint.o  \
1618  s-strops.o  \
1619  s-thread.o  \
1620  g-debuti.o  \
1621  g-io.o      \
1622  $(EXTRA_CERT_LEVEL_B_OBJS)
1623
1624 # C files for the cert level B run time (without the .c extension)
1625
1626 CERT_LEVEL_B_C_FILES = \
1627 2raise \
1628 $(EXTRA_CERT_LEVEL_B_C_FILES)
1629
1630 # Default run time files
1631
1632 ADA_INCLUDE_SRCS =\
1633  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1634  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1635  sequenio.ads system.ads Makefile.adalib Makefile.prolog Makefile.generic \
1636  memtrack.adb \
1637  a-*.adb a-*.ads g-*.ad? i-*.ad? \
1638  s-[a-o]*.adb s-[p-z]*.adb \
1639  s-[a-o]*.ads s-[p-z]*.ads
1640
1641 LIBGNAT=../rts/libgnat.a 
1642 TOOLS_FLAGS_TO_PASS=            \
1643         "CC=$(CC)"              \
1644         "CFLAGS=$(CFLAGS)"      \
1645         "LDFLAGS=$(LDFLAGS)"    \
1646         "ADAFLAGS=$(ADAFLAGS)"  \
1647         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
1648         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
1649         "libsubdir=$(libsubdir)"        \
1650         "exeext=$(exeext)"      \
1651         "fsrcdir=$(fsrcdir)"    \
1652         "srcdir=$(fsrcdir)"     \
1653         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
1654         "GNATMAKE=$(GNATMAKE)"  \
1655         "GNATLINK=$(GNATLINK)"  \
1656         "GNATBIND=$(GNATBIND)"
1657
1658 # Build directory for the tools. Let's copy the target-dependent
1659 # sources using the same mechanism as for gnatlib. The other sources are 
1660 # accessed using the vpath directive below
1661
1662 ../stamp-tools:
1663         -$(RM) tools/*
1664         -$(RMDIR) tools
1665         -$(MKDIR) tools
1666         -(cd tools; $(LN_S) ../sdefault.adb .)
1667         -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
1668                   $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\
1669                   $(LN_S) $(fsrcdir)/$(word 2,$(subst <, ,$(PAIR))) \
1670                         tools/$(word 1,$(subst <, ,$(PAIR)));)
1671         touch ../stamp-tools
1672
1673 # when compiling the tools, the runtime has to be first on the path so that
1674 # it hides the runtime files lying with the rest of the sources
1675 ifeq ($(TOOLSCASE),native)
1676   vpath %.ads ../rts ../
1677   vpath %.adb ../rts ../
1678   vpath %.c   ../rts ../
1679   vpath %.h   ../rts ../
1680 endif
1681
1682 # in the cross tools case, everything is compiled with the native 
1683 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1684 ifeq ($(TOOLSCASE),cross)
1685   vpath %.ads ../
1686   vpath %.adb ../
1687   vpath %.c   ../
1688   vpath %.h   ../
1689 endif
1690
1691 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap 
1692 # reasons: gnatmake should be built with a recent compiler, a recent compiler
1693 # may not generate ALI files compatible with an old gnatmake so it is important
1694 # to be able to build gnatmake without a version of gnatmake around. Once 
1695 # everything has been compiled once, gnatmake can be recompiled with itself 
1696 # (see target gnattools1-re) 
1697 gnattools1: ../stamp-tools ../stamp-gnatlib
1698         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1699           TOOLSCASE=native \
1700           ../../gnatmake$(exeext) ../../gnatlink$(exeext) ../../gnatbl$(exeext)
1701
1702 # gnatmake/link can be built with recent gnatmake/link if they are available.
1703 # This is especially convenient for building cross tools or for rebuilding
1704 # the tools when the original bootstrap has already be done.
1705 gnattools1-re: ../stamp-tools
1706         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1707           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
1708
1709 # these tools are built with gnatmake & are common to native and cross
1710 gnattools2: ../stamp-tools
1711         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1712           TOOLSCASE=native \
1713           ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
1714           ../../gnatls$(exeext) ../../gnatprep$(exeext) \
1715           ../../gnatxref$(exeext) \
1716           ../../gnatfind$(exeext) ../../gnatname$(exeext) \
1717           ../../gnatclean$(exeext) \
1718           ../../gprcmd$(exeext)   ../../gpr2make$(exeext)
1719
1720 # These tools are only built for the native version.
1721 gnattools3: ../stamp-tools
1722 #       $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1723 #         TOOLSCASE=native top_builddir=../../.. \
1724 #         ../../gnatmem$(exeext) $(EXTRA_GNATTOOLS)
1725
1726 # those tools are only built for the cross version
1727 gnattools4: ../stamp-tools
1728         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1729           TOOLSCASE=cross top_buildir=../../.. \
1730            ../../vxaddr2line$(exeext)
1731
1732 ../../gnatchop$(exeext): ../stamp-tools
1733         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1734         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1735         $(GNATLINK) -v gnatchop -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1736                 $(TOOLS_LIBS)
1737
1738 ../../gnat$(exeext): ../stamp-tools
1739         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1740         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1741         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1742
1743 ../../gnatkr$(exeext): ../stamp-tools
1744         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1745         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1746         $(GNATLINK) -v gnatkr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1747
1748 ../../gnatls$(exeext): ../stamp-tools
1749         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1750         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1751         $(GNATLINK) -v gnatls -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1752
1753 ../../gnatname$(exeext): ../stamp-tools
1754         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1755         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1756         $(GNATLINK) -v gnatname -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1757                     $(TOOLS_LIBS)
1758
1759 ../../gpr2make$(exeext): ../stamp-tools
1760         $(GNATMAKE) -c $(ADA_INCLUDES) gpr2make --GCC="$(CC) $(ALL_ADAFLAGS)"
1761         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gpr2make 
1762         $(GNATLINK) -v gpr2make -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1763                     $(TOOLS_LIBS)
1764
1765 ../../gnatprep$(exeext): ../stamp-tools
1766         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1767         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1768         $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1769                     $(TOOLS_LIBS)
1770
1771 ../../gnatxref$(exeext): ../stamp-tools
1772         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1773         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1774         $(GNATLINK) -v gnatxref -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1775                     $(TOOLS_LIBS)
1776
1777 ../../gnatfind$(exeext): ../stamp-tools
1778         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1779         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1780         $(GNATLINK) -v gnatfind -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1781                     $(TOOLS_LIBS)
1782
1783 ../../gnatclean$(exeext): ../stamp-tools
1784         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1785         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1786         $(GNATLINK) -v gnatclean -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1787                     $(TOOLS_LIBS)
1788
1789 ../../gnatsym$(exeext): ../stamp-tools
1790         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1791         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1792         $(GNATLINK) -v gnatsym -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1793                     $(TOOLS_LIBS)
1794
1795 ../../gnatmem$(exeext): ../stamp-tools gmem.o $(SYMDEPS)
1796 ifeq ($(GMEM_LIB),gmemlib)
1797            $(GNATMAKE) -c $(ADA_INCLUDES) gnatmem --GCC="$(CC) $(ALL_ADAFLAGS)"
1798            $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmem 
1799            $(GNATLINK) -v gnatmem -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1800                     gmem.o $(SYMLIB) $(TOOLS_LIBS)
1801 endif 
1802
1803 ../../gnatdll$(exeext): ../stamp-tools
1804         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1805         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1806         $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1807                 $(TOOLS_LIBS)
1808
1809 ../../gprcmd$(exeext): ../stamp-tools
1810         $(GNATMAKE) -c $(ADA_INCLUDES) gprcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1811         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprcmd 
1812         $(GNATLINK) -v gprcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1813
1814 ../../vxaddr2line$(exeext): ../stamp-tools
1815         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1816         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1817         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(CLIB)
1818
1819 gnatmake-re: ../stamp-tools
1820         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1821         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1822         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1823         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1824                 --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1825
1826 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1827 # with the former version of gnatlink itself which cannot override itself.
1828 gnatlink-re: ../stamp-tools link.o
1829         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1830         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1831         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1832                     --GCC="$(CC) $(ADA_INCLUDES)" link.o $(TOOLS_LIBS)
1833         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1834   
1835 # Needs to be built with CC=gcc
1836 # Since the RTL should be built with the latest compiler, remove the
1837 #  stamp target in the parent directory whenever gnat1 is rebuilt
1838
1839 # Likewise for the tools
1840 ../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
1841         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1842               $(TOOLS_LIBS)
1843
1844 ../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
1845         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1846               $(TOOLS_LIBS)
1847
1848 ../../gnatbl$(exeext): gnatbl.o
1849         $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1850
1851 gnatbl.o: gnatbl.c adaint.h
1852         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
1853
1854 ../stamp-gnatlib:
1855         @if [ ! -f stamp-gnatlib ] ; \
1856         then \
1857           $(ECHO) You must first build the GNAT library: make gnatlib; \
1858           false; \
1859         else \
1860           true; \
1861         fi
1862
1863 install-gnatlib: ../stamp-gnatlib
1864 #       Create the directory before deleting it, in case the directory is
1865 #       a list of directories (as it may be on VMS). This ensures we are
1866 #       deleting the right one.
1867         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1868         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1869         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1870         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1871         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1872         $(RMDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1873         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1874         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1875         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1876         -$(INSTALL_DATA) rts/Makefile.prolog $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1877         -$(INSTALL_DATA) rts/Makefile.generic $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1878         for file in rts/*.ali; do \
1879             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1880         done
1881         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1882         -for file in rts/*$(arext);do \
1883             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1884         done
1885 #     Install the shared libraries, if any, using $(INSTALL) instead
1886 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1887 #     for shared libraries on some targets, e.g. on HP-UX where the x
1888 #     permission is required.
1889 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
1890         -for file in rts/lib*$(soext);do \
1891             $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1892         done
1893 else
1894         -for file in rts/lib*-*$(soext);do \
1895             $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1896         done
1897 endif
1898         if [ -f rts/libgnat-*$(soext) ]; then \
1899            (cd $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1900             $(LN_S) libgnat-*$(soext) libgnat$(soext) && \
1901             $(LN_S) libgnarl-*$(soext) libgnarl$(soext)) \
1902         fi
1903 # This copy must be done preserving the date on the original file.
1904         for file in rts/*.adb rts/*.ads; do \
1905             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1906         done
1907         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1908         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1909
1910 ../stamp-gnatlib2:
1911         $(RM) rts/s-*.ali
1912         $(RM) rts/s-*$(objext)
1913         $(RM) rts/a-*.ali
1914         $(RM) rts/a-*$(objext)
1915         $(RM) rts/*.ali
1916         $(RM) rts/*$(objext)
1917         $(RM) rts/*$(arext)
1918         $(RM) rts/*$(soext)
1919         touch ../stamp-gnatlib2
1920         $(RM) ../stamp-gnatlib
1921
1922 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1923 #       successive target commands. Although the Gnu make documentation
1924 #       implies this is true on all systems, I suspect it may not be, So care
1925 #       has been taken to allow a sed script to look for ";)" and substitue
1926 #       for ";" the appropriate character in the range of lines below
1927 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1928
1929 # GNULLI Begin ###########################################################
1930
1931 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1932         $(RMDIR) rts
1933         $(MKDIR) rts
1934         $(CHMOD) u+w rts
1935 # Copy target independent sources
1936         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1937           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1938 # Remove files to be replaced by target dependent sources
1939         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1940                         rts/$(word 1,$(subst <, ,$(PAIR))))
1941 # Copy new target dependent sources
1942         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1943                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1944                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1945         $(RM) ../stamp-gnatlib
1946         touch ../stamp-gnatlib1
1947
1948 # GNULLI End #############################################################
1949
1950 # Don't use semicolon separated shell commands that involve list expansions.
1951 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1952 # line lengths in excess of 256 characters.
1953 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1954 # is guaranteed to overflow the buffer.
1955
1956 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1957         $(MAKE) -C rts CC="../../xgcc -B../../" \
1958                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1959                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1960                 srcdir=$(fsrcdir) \
1961                 -f ../Makefile $(LIBGNAT_OBJS)
1962         $(MAKE) -C rts CC="../../xgcc -B../../" \
1963                 ADA_INCLUDES="" \
1964                 CFLAGS="$(GNATLIBCFLAGS)" \
1965                 ADAFLAGS="$(GNATLIBFLAGS)" \
1966                 srcdir=$(fsrcdir) \
1967                 -f ../Makefile \
1968                 $(GNATRTL_OBJS)
1969         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1970         $(AR) $(AR_FLAGS) rts/libgnat$(arext) \
1971            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1972         ifneq ($(PREFIX_OBJS),)
1973                 $(AR) $(AR_FLAGS) rts/libgccprefix$(arext) $(PREFIX_OBJS);
1974         endif
1975         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnat$(arext); else true; fi
1976         $(AR) $(AR_FLAGS) rts/libgnarl$(arext) \
1977            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1978         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnarl$(arext); else true; fi
1979         ifeq ($(GMEM_LIB),gmemlib)
1980                 $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o;
1981         endif
1982         $(CHMOD) a-wx rts/*.ali
1983         touch ../stamp-gnatlib
1984
1985 HIE_NONE_TARGET_PAIRS=\
1986  a-except.ads<1aexcept.ads \
1987  a-except.adb<1aexcept.adb \
1988  a-tags.ads<1atags.ads \
1989  a-tags.adb<1atags.adb \
1990  s-secsta.ads<1ssecsta.ads \
1991  s-secsta.adb<1ssecsta.adb \
1992  i-c.ads<1ic.ads $(EXTRA_HIE_NONE_TARGET_PAIRS)
1993
1994 # This target needs RTS_NAME, RTS_SRCS, RTS_TARGET_PAIRS to be set properly
1995 # it creates a rts with the proper structure and the right target 
1996 # dependant srcs
1997 prepare-rts:
1998         $(RMDIR) rts-$(RTS_NAME)
1999         $(MKDIR) rts-$(RTS_NAME)
2000         $(CHMOD) u+w rts-$(RTS_NAME)
2001         $(MKDIR) rts-$(RTS_NAME)/adalib
2002         $(MKDIR) rts-$(RTS_NAME)/adainclude
2003         $(CHMOD) u+w rts-$(RTS_NAME)/*
2004 # Generate the project file
2005         $(ECHO) "project $(RTS_NAME) is" > rts-$(RTS_NAME)/$(RTS_NAME).gpr
2006         $(ECHO) "   for Source_Dirs use (\"adainclude\");" \
2007                 >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
2008         $(ECHO) "   for Object_Dir use \"adalib\";" \
2009                 >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
2010         $(ECHO) "   for Source_List_File use " \
2011                 >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2012         $(ECHO) "      \"rts-$(RTS_NAME)_source_list.txt\";" \
2013                 >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2014         $(ECHO) "   package Builder is" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2015         $(ECHO) "     for Default_Switches (\"Ada\") use (\"-a\");" \
2016                  >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2017         $(ECHO) "  end Builder;" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2018         $(ECHO) "  package Compiler is" >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
2019         $(ECHO) "     for Default_Switches (\"Ada\") use (\"-nostdinc\");" \
2020                  >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2021         $(ECHO) "  end Compiler;" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2022         $(ECHO) "end $(RTS_NAME);" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
2023
2024         $(foreach f, $(COMPILABLE_SOURCES), \
2025                 $(ECHO) $(f) >> \
2026                         rts-$(RTS_NAME)/rts-$(RTS_NAME)_source_list.txt ;) true
2027 # Copy target independent sources
2028         $(foreach f,$(RTS_SRCS), \
2029           $(CP) $(fsrcpfx)$(f) rts-$(RTS_NAME)/adainclude/ ;) true
2030 # Remove files to be replaced by target dependent sources
2031         $(RM) $(foreach PAIR,$(RTS_TARGET_PAIRS), \
2032                  rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR))))
2033 # Copy new target dependent sources
2034         $(foreach PAIR,$(RTS_TARGET_PAIRS), \
2035             $(CP) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
2036                     rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR)));)
2037
2038 install-rts: force
2039         $(CP) -r rts-$(RTS_NAME) $(DESTDIR)$(libsubdir)/
2040
2041 rts-zfp: force
2042         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
2043            RTS_NAME=zfp RTS_SRCS="$(HIE_SOURCES)" \
2044            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
2045            COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" 
2046         -$(GNATMAKE) -Prts-zfp/zfp.gpr --GCC="../../../xgcc -B../../../"
2047         $(RM) rts-zfp/adalib/*.o
2048         $(CHMOD) a-wx rts-zfp/adalib/*.ali
2049
2050 rts-cert: force
2051 # First compile the Ada files ...
2052         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
2053            RTS_NAME=cert RTS_SRCS="$(CERT_LEVEL_B_SOURCES)" \
2054            RTS_TARGET_PAIRS="$(CERT_LEVEL_B_TARGET_PAIRS)" \
2055            COMPILABLE_SOURCES="$(COMPILABLE_CERT_LEVEL_B_SOURCES)" 
2056         -$(GNATMAKE) -Prts-cert/cert.gpr --GCC="../../../xgcc -B../../../"
2057         $(CHMOD) a-wx rts-cert/adalib/*.ali
2058 # ... then the C files. This section will eventually be removed.
2059         $(foreach f,$(CERT_LEVEL_B_C_FILES), \
2060           $(CP) $(fsrcpfx)$(f).c rts-cert/adainclude/ ;)
2061         cd rts-cert/adalib ; \
2062         $(foreach f,$(CERT_LEVEL_B_C_FILES), \
2063         ../../../$(GCC_FOR_TARGET) -B../../../ $(TARGET_LIBGCC2_CFLAGS) \
2064         $(ALL_CFLAGS) $(GNATLIBCFLAGS_FOR_C) -c ../adainclude/$(f).c \
2065         -I../adainclude $(INCLUDES_FOR_SUBDIR) -I../../../ ;) \
2066         ../../../xgcc -B../../../ *.o -o libgnat ; \
2067         $(CHMOD) a-wx *.ali ; \
2068         $(RM) *.o ; \
2069         $(MV) libgnat libgnat.o
2070
2071 rts-none: force
2072         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
2073            RTS_NAME=none RTS_SRCS="$(HIE_SOURCES)" \
2074            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
2075            COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" 
2076         -$(GNATMAKE) -Prts-none/none.gpr --GCC="../../../xgcc -B../../../"
2077         $(RM) rts-none/adalib/*.o
2078         $(CHMOD) a-wx rts-none/adalib/*.ali
2079
2080 rts-ravenscar: force
2081         $(MAKE)  $(FLAGS_TO_PASS) prepare-rts \
2082            RTS_NAME=ravenscar RTS_SRCS="$(RAVEN_SOURCES)" \
2083            RTS_TARGET_PAIRS="$(HIE_RAVEN_TARGET_PAIRS)" \
2084            COMPILABLE_SOURCES="$(COMPILABLE_RAVEN_SOURCES)" 
2085         -$(GNATMAKE) -Prts-ravenscar/ravenscar.gpr \
2086            --GCC="../../../xgcc -B../../../"
2087         $(CHMOD) a-wx rts-ravenscar/adalib/*.ali
2088
2089 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2090 gnatlib-shared-default:
2091         $(MAKE) $(FLAGS_TO_PASS) \
2092              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2093              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2094              THREAD_KIND="$(THREAD_KIND)" \
2095              gnatlib
2096         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
2097         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2098                 -o libgnat-$(LIBRARY_VERSION)$(soext) \
2099                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2100                 $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) $(MISCLIB) -lm
2101         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2102                 -o libgnarl-$(LIBRARY_VERSION)$(soext) \
2103                 $(GNATRTL_TASKING_OBJS) \
2104                 $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) $(THREADSLIB)
2105         cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
2106         cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext)
2107
2108 gnatlib-shared-dual:
2109         $(MAKE) $(FLAGS_TO_PASS) \
2110              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2111              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2112              THREAD_KIND="$(THREAD_KIND)" \
2113              gnatlib-shared-default
2114         $(MV) rts/libgna*$(soext) .
2115         $(RM) ../stamp-gnatlib2
2116         $(MAKE) $(FLAGS_TO_PASS) \
2117              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2118              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2119              THREAD_KIND="$(THREAD_KIND)" \
2120              gnatlib
2121         $(MV) libgna*$(soext) rts
2122
2123 # Note that on Win32 the auto-import does not work for DLL, so on the
2124 # platform we have a specific setup. The libgnat.dll contains only
2125 # non-tasking objects and libgnarl.dll contains tasking and non-tasking
2126 # objects. A tasking program must be linked with libgnarl.dll only.
2127 gnatlib-shared-win32:
2128         $(MAKE) $(FLAGS_TO_PASS) \
2129              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2130              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2131              THREAD_KIND="$(THREAD_KIND)" \
2132              gnatlib
2133         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
2134         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2135                 -o libgnat-$(LIBRARY_VERSION)$(soext) \
2136                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2137                 $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2138         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2139                 -o libgnarl-$(LIBRARY_VERSION)$(soext) \
2140                 $(GNATRTL_TASKING_OBJS) \
2141                 $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) \
2142                 $(THREADSLIB) -Wl,libgnat-$(LIBRARY_VERSION)$(soext)
2143         cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
2144         cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext)
2145
2146 gnatlib-shared-vms:
2147         $(MAKE) $(FLAGS_TO_PASS) \
2148              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2149              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2150              THREAD_KIND="$(THREAD_KIND)" \
2151              gnatlib
2152         $(RM) rts/libgnat*$(soext) rts/libgnarl*$(soext)
2153         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
2154         objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
2155         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
2156         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
2157         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
2158            -o libgnat_s$(soext) libgnat.a \
2159            sys\$$library:trace.exe \
2160            --for-linker=/noinform \
2161            --for-linker=SYMVEC_$$$$.opt \
2162            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2163         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
2164         objdump --syms $(GNATRTL_TASKING_OBJS) | \
2165         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
2166         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
2167         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
2168            -o libgnarl_s$(soext) \
2169            libgnarl.a libgnat_s$(soext) \
2170            sys\$$library:trace.exe \
2171            --for-linker=/noinform \
2172            --for-linker=SYMVEC_$$$$.opt \
2173            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2174
2175 gnatlib-shared:
2176         $(MAKE) $(FLAGS_TO_PASS) \
2177              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2178              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2179              THREAD_KIND="$(THREAD_KIND)" \
2180              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2181              $(GNATLIB_SHARED)
2182
2183 gnatlib-sjlj: ../stamp-gnatlib1
2184         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
2185         $(MV) rts/s.ads rts/system.ads
2186         $(MAKE) $(FLAGS_TO_PASS) \
2187              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2188              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2189              THREAD_KIND="$(THREAD_KIND)" \
2190              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2191
2192 # .s files for cross-building
2193 gnat-cross: force
2194         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2195
2196 # Compiling object files from source files.
2197
2198 # Note that dependencies on obstack.h are not written
2199 # because that file is not part of GCC.
2200 # Dependencies on gvarargs.h are not written
2201 # because all that file does, when not compiling with GCC,
2202 # is include the system varargs.h.
2203
2204 b_gnatl.c : $(GNATLINK_OBJS)
2205         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2206 b_gnatl.o : b_gnatl.c
2207
2208 b_gnatm.c : $(GNATMAKE_OBJS)
2209         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2210 b_gnatm.o : b_gnatm.c
2211
2212 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2213 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2214 ADA_SHARE_MAKE_DIR = $(prefix)/share/make
2215
2216 # force no sibling call optimization on s-traceb.o so the number of stack
2217 # frames to be skipped when computing a call chain is not modified by
2218 # optimization. However we can do that only when building the runtime
2219 # (not the compiler) because the -fno-optimize-sibling-calls exists
2220 # only in GCC 3.
2221
2222 ifneq (,$(findstring xgcc,$(CC)))
2223 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
2224 else
2225 NO_SIBLING_ADAFLAGS=
2226 endif
2227
2228 s-traceb.o  : s-traceb.adb
2229         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2230               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
2231               $< $(OUTPUT_OPTION)
2232
2233 adadecode.o : adadecode.c adadecode.h
2234 aux-io.o  : aux-io.c
2235 argv.o    : argv.c
2236 cal.o     : cal.c
2237 deftarg.o  : deftarg.c
2238 errno.o   : errno.c
2239 exit.o    : raise.h exit.c
2240 expect.o  : expect.c
2241 final.o   : raise.h final.c
2242 gmem.o    : gmem.c
2243 link.o    : link.c
2244 mkdir.o   : mkdir.c
2245 socket.o  : socket.c
2246 sysdep.o  : sysdep.c
2247
2248 cio.o     : cio.c 
2249         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2250                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2251
2252 init.o    : init.c ada.h types.h raise.h
2253         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2254                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2255
2256 raise.o   : raise.c raise.h
2257         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2258                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2259
2260 # Need to keep the frame pointer in this file to pop the stack properly on
2261 # some targets.
2262 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c
2263         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2264               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2265
2266 # In GNU Make, ignore whether `stage*' exists.
2267 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2268 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2269
2270 force:
2271
2272 # Gnatlbr is only used on VMS
2273
2274 ../../gnatlbr$(exeext): ../../prefix.o
2275         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2276         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2277         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
2278                 $(TOOLS_LIBS)