OSDN Git Service

2003-12-03 Thomas Quinot <quinot@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 LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
379
380 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
381 # $(strip STRING) removes leading and trailing spaces from STRING.
382 # If what's left is null then it's a match.
383
384 ifeq ($(strip $(filter-out %86 os2 OS2 os2_emx,$(arch) $(osys))),)
385   LIBGNAT_TARGET_PAIRS = \
386   a-excpol.adb<4wexcpol.adb \
387   a-intnam.ads<4nintnam.ads \
388   a-numaux.adb<86numaux.adb \
389   a-numaux.ads<86numaux.ads \
390   s-inmaop.adb<5ninmaop.adb \
391   s-interr.adb<5ointerr.adb \
392   s-intman.adb<5nintman.adb \
393   s-mastop.adb<5omastop.adb \
394   s-osinte.adb<5oosinte.adb \
395   s-osinte.ads<5oosinte.ads \
396   s-osprim.adb<5oosprim.adb \
397   s-parame.adb<5oparame.adb \
398   system.ads<5osystem.ads \
399   s-taprop.adb<5otaprop.adb \
400   s-taspri.ads<5otaspri.ads
401
402   EXTRA_GNATRTL_NONTASKING_OBJS = \
403   i-os2err.o \
404   i-os2lib.o \
405   i-os2syn.o \
406   i-os2thr.o
407 endif
408
409 ifeq ($(strip $(filter-out %86 interix%,$(arch) $(osys))),)
410   LIBGNAT_TARGET_PAIRS = \
411   a-excpol.adb<4hexcpol.adb \
412   a-intnam.ads<4pintnam.ads \
413   a-numaux.adb<86numaux.adb \
414   a-numaux.ads<86numaux.ads \
415   g-soccon.ads<3psoccon.ads \
416   s-inmaop.adb<7sinmaop.adb \
417   s-intman.adb<7sintman.adb \
418   s-mastop.adb<5omastop.adb \
419   s-osinte.adb<7sosinte.adb \
420   s-osinte.ads<5posinte.ads \
421   s-osprim.adb<5posprim.adb \
422   s-taprop.adb<7staprop.adb \
423   system.ads<5psystem.ads \
424   s-taspri.ads<7staspri.ads \
425   s-tpopsp.adb<7stpopsp.adb
426
427   THREADSLIB = -lgthreads -lmalloc
428   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
429 endif
430
431 # sysv5uw is SCO UnixWare 7
432 ifeq ($(strip $(filter-out %86 sysv5uw%,$(arch) $(osys))),)
433   LIBGNAT_TARGET_PAIRS = \
434   a-excpol.adb<4wexcpol.adb \
435   a-intnam.ads<41intnam.ads \
436   a-numaux.adb<86numaux.adb \
437   a-numaux.ads<86numaux.ads \
438   s-inmaop.adb<7sinmaop.adb \
439   s-intman.adb<7sintman.adb \
440   s-mastop.adb<5omastop.adb \
441   s-osinte.ads<51osinte.ads \
442   s-osinte.adb<51osinte.adb \
443   s-osprim.adb<5posprim.adb \
444   s-taprop.adb<7staprop.adb \
445   s-taspri.ads<7staspri.ads \
446   s-tpopsp.adb<5atpopsp.adb \
447   system.ads<51system.ads \
448   g-soccon.ads<31soccon.ads \
449   g-soliop.ads<31soliop.ads
450
451   THREADSLIB = -lthread
452   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
453   SO_OPTS = -Wl,-h,
454   GNATLIB_SHARED = gnatlib-shared-dual
455   LIBRARY_VERSION := $(LIB_VERSION)
456 endif
457
458 ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),)
459   LIBGNAT_TARGET_PAIRS = \
460   a-sytaco.ads<4zsytaco.ads \
461   a-sytaco.adb<4zsytaco.adb \
462   a-intnam.ads<4zintnam.ads \
463   a-numaux.ads<4znumaux.ads \
464   s-inmaop.adb<7sinmaop.adb \
465   s-interr.adb<5zinterr.adb \
466   s-intman.ads<5zintman.ads \
467   s-intman.adb<5zintman.adb \
468   s-osinte.adb<5zosinte.adb \
469   s-osinte.ads<5zosinte.ads \
470   s-osprim.adb<5zosprim.adb \
471   s-parame.ads<5zparame.ads \
472   s-taprop.adb<5ztaprop.adb \
473   s-tpopsp.adb<5ztpopsp.adb \
474   s-taspri.ads<5ztaspri.ads \
475   s-vxwork.ads<5avxwork.ads \
476   g-soccon.ads<3zsoccon.ads \
477   g-socthi.ads<3zsocthi.ads \
478   g-socthi.adb<3zsocthi.adb \
479   system.ads<5zsystem.ads
480
481   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
482   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
483 endif
484
485 ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
486   LIBGNAT_TARGET_PAIRS = \
487   a-sytaco.ads<4zsytaco.ads \
488   a-sytaco.adb<4zsytaco.adb \
489   a-intnam.ads<4zintnam.ads \
490   a-numaux.ads<4znumaux.ads \
491   s-inmaop.adb<7sinmaop.adb \
492   s-interr.adb<5zinterr.adb \
493   s-intman.ads<5zintman.ads \
494   s-intman.adb<5zintman.adb \
495   s-osinte.adb<5zosinte.adb \
496   s-osinte.ads<5zosinte.ads \
497   s-osprim.adb<5zosprim.adb \
498   s-parame.ads<5zparame.ads \
499   s-taprop.adb<5ztaprop.adb \
500   s-taspri.ads<5ztaspri.ads \
501   s-tpopsp.adb<5ztpopsp.adb \
502   s-vxwork.ads<5kvxwork.ads \
503   g-soccon.ads<3zsoccon.ads \
504   g-socthi.ads<3zsocthi.ads \
505   g-socthi.adb<3zsocthi.adb \
506   system.ads<5ksystem.ads
507
508   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
509
510   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
511   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
512
513   ifeq ($(strip $(filter-out yes,$(TRACE))),)
514     LIBGNAT_TARGET_PAIRS += \
515     s-traces.adb<7straces.adb \
516     s-tratas.adb<7stratas.adb \
517     s-trafor.adb<7strafor.adb \
518     s-trafor.ads<7strafor.ads \
519     s-tfsetr.adb<5ztfsetr.adb 
520   endif
521 endif
522
523 ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
524   LIBGNAT_TARGET_PAIRS = \
525   a-sytaco.ads<4zsytaco.ads \
526   a-sytaco.adb<4zsytaco.adb \
527   a-intnam.ads<4zintnam.ads \
528   a-numaux.ads<4znumaux.ads \
529   s-inmaop.adb<7sinmaop.adb \
530   s-interr.adb<5zinterr.adb \
531   s-intman.ads<5zintman.ads \
532   s-intman.adb<5zintman.adb \
533   s-osinte.adb<5zosinte.adb \
534   s-osinte.ads<5zosinte.ads \
535   s-osprim.adb<5zosprim.adb \
536   s-parame.ads<5zparame.ads \
537   s-taprop.adb<5ztaprop.adb \
538   s-taspri.ads<5ztaspri.ads \
539   s-tpopsp.adb<5ztpopsp.adb \
540   s-vxwork.ads<5pvxwork.ads \
541   g-soccon.ads<3zsoccon.ads \
542   g-socthi.ads<3zsocthi.ads \
543   g-socthi.adb<3zsocthi.adb \
544   system.ads<5ysystem.ads
545
546   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
547
548   EXTRA_HIE_NONE_TARGET_PAIRS= \
549   system.ads<50system.ads
550
551   EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads
552   EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o
553   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
554   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
555   HIE_RAVEN_TARGET_PAIRS=\
556   $(HIE_NONE_TARGET_PAIRS) \
557   a-reatim.ads<1areatim.ads \
558   a-reatim.adb<1areatim.adb \
559   a-retide.adb<1aretide.adb \
560   a-interr.adb<1ainterr.adb \
561   s-interr.ads<1sinterr.ads \
562   s-interr.adb<1sinterr.adb \
563   s-taskin.ads<1staskin.ads \
564   s-taskin.adb<1staskin.adb \
565   s-tarest.adb<1starest.adb \
566   s-tposen.ads<1stposen.ads \
567   s-tposen.adb<1stposen.adb \
568   s-osinte.adb<1sosinte.adb \
569   s-taprop.ads<1staprop.ads \
570   s-taprop.adb<1staprop.adb \
571   s-taprob.ads<1staprob.ads \
572   s-taprob.adb<1staprob.adb \
573   a-sytaco.ads<1asytaco.ads \
574   a-sytaco.adb<1asytaco.adb \
575   a-intnam.ads<4zintnam.ads \
576   s-osinte.ads<5zosinte.ads \
577   s-parame.ads<5zparame.ads \
578   s-taspri.ads<5ztaspri.ads \
579   s-vxwork.ads<5pvxwork.ads \
580   a-taside.adb<1ataside.adb \
581
582   ifeq ($(strip $(filter-out yes,$(TRACE))),)
583     LIBGNAT_TARGET_PAIRS += \
584     s-traces.adb<7straces.adb \
585     s-trafor.adb<7strafor.adb \
586     s-trafor.ads<7strafor.ads \
587     s-tratas.adb<7stratas.adb \
588     s-tfsetr.adb<5ztfsetr.adb 
589   endif
590 endif
591
592
593 ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
594   LIBGNAT_TARGET_PAIRS = \
595   a-sytaco.ads<4zsytaco.ads \
596   a-sytaco.adb<4zsytaco.adb \
597   a-intnam.ads<4zintnam.ads \
598   a-numaux.ads<4znumaux.ads \
599   s-inmaop.adb<7sinmaop.adb \
600   s-interr.adb<5zinterr.adb \
601   s-intman.ads<5zintman.ads \
602   s-intman.adb<5zintman.adb \
603   s-osinte.adb<5zosinte.adb \
604   s-osinte.ads<5zosinte.ads \
605   s-osprim.adb<5zosprim.adb \
606   s-parame.ads<5yparame.ads \
607   s-taprop.adb<5ztaprop.adb \
608   s-taspri.ads<5ztaspri.ads \
609   s-thread.adb<5zthread.adb \
610   s-tpopsp.adb<5ztpopsp.adb \
611   s-vxwork.ads<5pvxwork.ads \
612   g-soccon.ads<3zsoccon.ads \
613   g-socthi.ads<3zsocthi.ads \
614   g-socthi.adb<3zsocthi.adb \
615   system.ads<5ysystem.ads
616
617   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
618
619   EXTRA_HIE_NONE_TARGET_PAIRS= \
620   system.ads<50system.ads
621
622   EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads
623   EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o
624   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-thread.o
625   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
626   HIE_RAVEN_TARGET_PAIRS=\
627   $(HIE_NONE_TARGET_PAIRS) \
628   a-reatim.ads<1areatim.ads \
629   a-reatim.adb<1areatim.adb \
630   a-retide.adb<1aretide.adb \
631   a-interr.adb<1ainterr.adb \
632   s-interr.ads<1sinterr.ads \
633   s-interr.adb<1sinterr.adb \
634   s-taskin.ads<1staskin.ads \
635   s-taskin.adb<1staskin.adb \
636   s-tarest.adb<1starest.adb \
637   s-tposen.ads<1stposen.ads \
638   s-tposen.adb<1stposen.adb \
639   s-osinte.adb<1sosinte.adb \
640   s-taprop.ads<1staprop.ads \
641   s-taprop.adb<1staprop.adb \
642   s-taprob.ads<1staprob.ads \
643   s-taprob.adb<1staprob.adb \
644   a-sytaco.ads<1asytaco.ads \
645   a-sytaco.adb<1asytaco.adb \
646   a-intnam.ads<4zintnam.ads \
647   s-osinte.ads<5zosinte.ads \
648   s-parame.ads<5zparame.ads \
649   s-taspri.ads<5ztaspri.ads \
650   s-vxwork.ads<5pvxwork.ads \
651   a-taside.adb<1ataside.adb \
652
653   CERT_LEVEL_B_TARGET_PAIRS=\
654   a-tags.ads<1atags.ads     \
655   a-tags.adb<1atags.adb     \
656   a-elchha.ads<2aelchha.ads \
657   a-elchha.adb<2aelchha.adb.empty \
658   a-elchha.adb.full<2aelchha.adb.full \
659   a-except.adb<2aexcept.adb \
660   a-except.ads<2aexcept.ads \
661   a-excach.adb<2aexcach.adb \
662   i-c.ads<1ic.ads           \
663   g-io.adb<2gio.adb         \
664   s-init.ads<2sinit.ads     \
665   s-init.adb<5zinit.adb     \
666   s-memory.adb<2smemory.adb \
667   s-memory.ads<2smemory.ads \
668   s-osinte.ads<2sosinte.ads \
669   s-secsta.ads<2ssecsta.ads \
670   s-secsta.adb<2ssecsta.adb \
671   s-soflin.adb<2ssoflin.adb \
672   s-soflin.ads<2ssoflin.ads \
673   s-stalib.adb<1sstalib.adb \
674   s-stalib.ads<1sstalib.ads \
675   s-thread.adb<5zthread.adb \
676   s-traceb.adb<2straceb.adb \
677   s-traceb.ads<2straceb.ads \
678   system.ads<5isystem.ads
679
680   CERT_LEVEL_B_EXTRA_OBJECT_FILES=a-elchha.adb
681
682   ifeq ($(strip $(filter-out yes,$(TRACE))),)
683     LIBGNAT_TARGET_PAIRS += \
684     s-traces.adb<7straces.adb \
685     s-trafor.adb<7strafor.adb \
686     s-trafor.ads<7strafor.ads \
687     s-tratas.adb<7stratas.adb \
688     s-tfsetr.adb<5ztfsetr.adb 
689   endif
690 endif
691
692 ifeq ($(strip $(filter-out powerpc% unknown elf,$(targ))),)
693   EXTRA_HIE_NONE_TARGET_PAIRS= \
694   system.ads<59system.ads
695
696   LIBGNAT_TARGET_PAIRS = \
697   $(HIE_NONE_TARGET_PAIRS)
698 endif
699
700 ifeq ($(strip $(filter-out sparc% unknown elf,$(targ))),)
701   EXTRA_HIE_NONE_TARGET_PAIRS= \
702   system.ads<5rsystem.ads
703
704   LIBGNAT_TARGET_PAIRS = \
705   $(HIE_NONE_TARGET_PAIRS)
706 endif
707
708 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
709   LIBGNAT_TARGET_PAIRS = \
710   a-sytaco.ads<4zsytaco.ads \
711   a-sytaco.adb<4zsytaco.adb \
712   a-intnam.ads<4zintnam.ads \
713   a-numaux.ads<4znumaux.ads \
714   s-inmaop.adb<7sinmaop.adb \
715   s-interr.adb<5zinterr.adb \
716   s-intman.ads<5zintman.ads \
717   s-intman.adb<5zintman.adb \
718   s-osinte.adb<5zosinte.adb \
719   s-osinte.ads<5zosinte.ads \
720   s-osprim.adb<5zosprim.adb \
721   s-parame.ads<5zparame.ads \
722   s-taprop.adb<5ztaprop.adb \
723   s-taspri.ads<5ztaspri.ads \
724   s-tpopsp.adb<5ztpopsp.adb \
725   s-vxwork.ads<5svxwork.ads \
726   g-soccon.ads<3zsoccon.ads \
727   g-socthi.ads<3zsocthi.ads \
728   g-socthi.adb<3zsocthi.adb \
729   system.ads<5csystem.ads   \
730
731   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
732
733   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
734   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
735 endif
736
737 ifeq ($(strip $(filter-out xscale% coff wrs vx%,$(targ))),)
738   LIBGNAT_TARGET_PAIRS = \
739   a-sytaco.ads<4zsytaco.ads \
740   a-sytaco.adb<4zsytaco.adb \
741   a-intnam.ads<4zintnam.ads \
742   a-numaux.ads<4znumaux.ads \
743   s-inmaop.adb<7sinmaop.adb \
744   s-interr.adb<5zinterr.adb \
745   s-intman.ads<5zintman.ads \
746   s-intman.adb<5zintman.adb \
747   s-osinte.adb<5zosinte.adb \
748   s-osinte.ads<5zosinte.ads \
749   s-osprim.adb<5zosprim.adb \
750   s-parame.ads<5zparame.ads \
751   s-taprop.adb<5ztaprop.adb \
752   s-taspri.ads<5ztaspri.ads \
753   s-tpopsp.adb<5ztpopsp.adb \
754   s-vxwork.ads<5xvxwork.ads \
755   g-soccon.ads<3zsoccon.ads \
756   g-socthi.ads<3zsocthi.ads \
757   g-socthi.adb<3zsocthi.adb \
758   system.ads<5rsystem.ads
759
760   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
761
762   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
763   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
764 endif
765
766 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
767   LIBGNAT_TARGET_PAIRS = \
768   a-sytaco.ads<4zsytaco.ads \
769   a-sytaco.adb<4zsytaco.adb \
770   a-intnam.ads<4zintnam.ads \
771   a-numaux.ads<4znumaux.ads \
772   s-inmaop.adb<7sinmaop.adb \
773   s-interr.adb<5zinterr.adb \
774   s-intman.ads<5zintman.ads \
775   s-intman.adb<5zintman.adb \
776   s-osinte.adb<5zosinte.adb \
777   s-osinte.ads<5zosinte.ads \
778   s-osprim.adb<5zosprim.adb \
779   s-parame.ads<5zparame.ads \
780   s-taprop.adb<5ztaprop.adb \
781   s-taspri.ads<5ztaspri.ads \
782   s-tpopsp.adb<5ztpopsp.adb \
783   s-vxwork.ads<5mvxwork.ads \
784   g-soccon.ads<3zsoccon.ads \
785   g-socthi.ads<3zsocthi.ads \
786   g-socthi.adb<3zsocthi.adb \
787   system.ads<5msystem.ads
788
789   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
790
791   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
792   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
793 endif
794
795 ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
796   LIBGNAT_TARGET_PAIRS = \
797   a-intnam.ads<4sintnam.ads \
798   s-inmaop.adb<7sinmaop.adb \
799   s-intman.adb<5sintman.adb \
800   s-osinte.adb<5sosinte.adb \
801   s-osinte.ads<5sosinte.ads \
802   s-osprim.adb<5sosprim.adb \
803   s-parame.adb<5sparame.adb \
804   s-taprop.adb<5staprop.adb \
805   s-tasinf.adb<5stasinf.adb \
806   s-tasinf.ads<5stasinf.ads \
807   s-taspri.ads<5staspri.ads \
808   s-tpopsp.adb<5stpopsp.adb \
809   g-soccon.ads<3ssoccon.ads \
810   g-soliop.ads<3ssoliop.ads \
811   system.ads<5ssystem.ads
812
813   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5sml-tgt.adb
814
815   THREADSLIB = -lposix4 -lthread
816   MISCLIB = -lposix4 -lnsl -lsocket
817   SYMLIB = -laddr2line -lbfd $(LIBINTL)
818   SO_OPTS = -Wl,-h,
819   GNATLIB_SHARED = gnatlib-shared-dual
820   GMEM_LIB = gmemlib
821   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
822   LIBRARY_VERSION := $(LIB_VERSION)
823
824   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
825     LIBGNAT_TARGET_PAIRS = \
826     a-intnam.ads<4sintnam.ads \
827     s-inmaop.adb<7sinmaop.adb \
828     s-intman.adb<5sintman.adb \
829     s-osinte.adb<7sosinte.adb \
830     s-osinte.ads<5tosinte.ads \
831     s-osprim.adb<5sosprim.adb \
832     s-taprop.adb<7staprop.adb \
833     s-taspri.ads<7staspri.ads \
834     s-tpopsp.adb<7stpopsp.adb \
835     g-soccon.ads<3ssoccon.ads \
836     g-soliop.ads<3ssoliop.ads \
837     system.ads<5ssystem.ads
838
839     THREADSLIB = -lgthreads -lmalloc
840   endif
841
842   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
843     LIBGNAT_TARGET_PAIRS = \
844     a-intnam.ads<4sintnam.ads \
845     s-inmaop.adb<7sinmaop.adb \
846     s-intman.adb<7sintman.adb \
847     s-osinte.adb<5iosinte.adb \
848     s-osinte.ads<54osinte.ads \
849     s-osprim.adb<5sosprim.adb \
850     s-taprop.adb<7staprop.adb \
851     s-taspri.ads<7staspri.ads \
852     s-tpopsp.adb<5atpopsp.adb \
853     g-soccon.ads<3ssoccon.ads \
854     g-soliop.ads<3ssoliop.ads \
855     system.ads<5ssystem.ads
856
857     THREADSLIB = -lposix4 -lpthread
858   endif
859
860   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
861     LIBGNAT_TARGET_PAIRS = \
862     a-intnam.ads<4sintnam.ads \
863     s-inmaop.adb<7sinmaop.adb \
864     s-intman.adb<5sintman.adb \
865     s-osinte.adb<5sosinte.adb \
866     s-osinte.ads<5sosinte.ads \
867     s-osprim.adb<5sosprim.adb \
868     s-parame.adb<5sparame.adb \
869     s-taprop.adb<5staprop.adb \
870     s-tasinf.adb<5stasinf.adb \
871     s-tasinf.ads<5stasinf.ads \
872     s-taspri.ads<5staspri.ads \
873     s-tpopsp.adb<5stpopsp.adb \
874     g-soccon.ads<3ssoccon.ads \
875     g-soliop.ads<3ssoliop.ads \
876     system.ads<5usystem.ads
877   endif
878 endif
879
880 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
881   LIBGNAT_TARGET_PAIRS = \
882   a-numaux.adb<86numaux.adb \
883   a-numaux.ads<86numaux.ads \
884   a-intnam.ads<4sintnam.ads \
885   s-inmaop.adb<7sinmaop.adb \
886   s-intman.adb<5sintman.adb \
887   s-mastop.adb<5omastop.adb \
888   s-osinte.adb<5sosinte.adb \
889   s-osinte.ads<5sosinte.ads \
890   s-osprim.adb<5sosprim.adb \
891   s-parame.adb<5sparame.adb \
892   s-taprop.adb<5staprop.adb \
893   s-tasinf.adb<5stasinf.adb \
894   s-tasinf.ads<5stasinf.ads \
895   s-taspri.ads<5staspri.ads \
896   s-tpopsp.adb<5stpopsp.adb \
897   g-soccon.ads<3ssoccon.ads \
898   g-soliop.ads<3ssoliop.ads \
899   system.ads<5esystem.ads
900
901   THREADSLIB = -lposix4 -lthread
902   MISCLIB = -lposix4 -lnsl -lsocket
903   SO_OPTS = -Wl,-h,
904   GNATLIB_SHARED = gnatlib-shared-dual
905   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
906   LIBRARY_VERSION := $(LIB_VERSION)
907 endif
908
909 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
910   LIBGNAT_TARGET_PAIRS = \
911   a-intnam.ads<4lintnam.ads \
912   a-numaux.adb<86numaux.adb \
913   a-numaux.ads<86numaux.ads \
914   s-inmaop.adb<7sinmaop.adb \
915   s-intman.adb<7sintman.adb \
916   s-mastop.adb<5omastop.adb \
917   s-osinte.adb<5iosinte.adb \
918   s-osinte.ads<5iosinte.ads \
919   s-osprim.adb<7sosprim.adb \
920   s-taprop.adb<5itaprop.adb \
921   s-taspri.ads<5itaspri.ads \
922   s-tpopsp.adb<5atpopsp.adb \
923   s-parame.adb<5lparame.adb \
924   system.ads<5lsystem.ads
925
926   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5lml-tgt.adb
927   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
928   THREADSLIB = -lpthread
929   GNATLIB_SHARED = gnatlib-shared-dual
930   GMEM_LIB = gmemlib
931   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
932   LIBRARY_VERSION := $(LIB_VERSION)
933
934   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
935     LIBGNAT_TARGET_PAIRS = \
936     a-intnam.ads<4lintnam.ads \
937     a-numaux.adb<86numaux.adb \
938     a-numaux.ads<86numaux.ads \
939     s-inmaop.adb<7sinmaop.adb \
940     s-intman.adb<7sintman.adb \
941     s-mastop.adb<5omastop.adb \
942     s-osinte.adb<7sosinte.adb \
943     s-osinte.ads<5losinte.ads \
944     s-osprim.adb<7sosprim.adb \
945     s-taprop.adb<7staprop.adb \
946     s-taspri.ads<7staspri.ads \
947     s-tpopsp.adb<7stpopsp.adb \
948     system.ads<5lsystem.ads
949
950     THREADSLIB = -lgthreads -lmalloc
951   endif
952 endif
953
954 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
955   LIBGNAT_TARGET_PAIRS = \
956   a-intnam.ads<45intnam.ads \
957   g-soccon.ads<35soccon.ads \
958   s-inmaop.adb<7sinmaop.adb \
959   s-intman.adb<7sintman.adb \
960   s-mastop.adb<5omastop.adb \
961   s-osinte.adb<55osinte.adb \
962   s-osinte.ads<55osinte.ads \
963   s-osprim.adb<7sosprim.adb \
964   s-taprop.adb<7staprop.adb \
965   s-taspri.ads<7staspri.ads \
966   s-tpopsp.adb<7stpopsp.adb \
967   system.ads<56system.ads
968
969   THREADSLIB=
970   LIBRARY_VERSION := $(LIB_VERSION)
971 endif
972
973 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
974   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
975     LIBGNAT_TARGET_PAIRS = \
976     a-intnam.ads<4gintnam.ads \
977     s-inmaop.adb<7sinmaop.adb \
978     s-intman.adb<5fintman.adb \
979     s-mastop.adb<5gmastop.adb \
980     s-osinte.adb<5fosinte.adb \
981     s-osinte.ads<5fosinte.ads \
982     s-osprim.adb<7sosprim.adb \
983     s-proinf.adb<5gproinf.adb \
984     s-proinf.ads<5gproinf.ads \
985     s-taprop.adb<5ftaprop.adb \
986     s-tasinf.ads<5ftasinf.ads \
987     s-taspri.ads<7staspri.ads \
988     s-tpopsp.adb<7stpopsp.adb \
989     s-traceb.adb<7straceb.adb \
990     g-soccon.ads<3gsoccon.ads \
991     system.ads<5gsystem.ads
992
993     THREADSLIB = -lpthread
994     GNATLIB_SHARED = gnatlib-shared-default
995
996   else
997     LIBGNAT_TARGET_PAIRS = \
998     a-intnam.ads<4gintnam.ads \
999     s-inmaop.adb<5ninmaop.adb \
1000     s-interr.adb<5ginterr.adb \
1001     s-intman.adb<5gintman.adb \
1002     s-mastop.adb<5gmastop.adb \
1003     s-osinte.adb<5fosinte.adb \
1004     s-osinte.ads<5gosinte.ads \
1005     s-osprim.adb<7sosprim.adb \
1006     s-proinf.adb<5gproinf.adb \
1007     s-proinf.ads<5gproinf.ads \
1008     s-taprop.adb<5gtaprop.adb \
1009     s-tasinf.adb<5gtasinf.adb \
1010     s-tasinf.ads<5gtasinf.ads \
1011     s-taspri.ads<7staspri.ads \
1012     s-traceb.adb<7straceb.adb \
1013     g-soccon.ads<3gsoccon.ads \
1014     system.ads<5fsystem.ads
1015
1016     THREADSLIB = -lathread
1017   endif
1018
1019   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5gml-tgt.adb
1020   TGT_LIB = -lexc
1021   MISCLIB = -lexc
1022   SO_OPTS = -Wl,-all,-set_version,sgi1.0,-update_registry,../so_locations,-soname,
1023   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1024   LIBRARY_VERSION := $(LIB_VERSION)
1025 endif
1026
1027 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
1028   LIBGNAT_TARGET_PAIRS = \
1029   a-excpol.adb<4wexcpol.adb \
1030   a-intnam.ads<4hintnam.ads \
1031   s-inmaop.adb<7sinmaop.adb \
1032   s-interr.adb<5ginterr.adb \
1033   s-intman.adb<7sintman.adb \
1034   s-osinte.adb<5hosinte.adb \
1035   s-osinte.ads<5hosinte.ads \
1036   s-parame.ads<5hparame.ads \
1037   s-osprim.adb<7sosprim.adb \
1038   s-taprop.adb<5htaprop.adb \
1039   s-taspri.ads<5htaspri.ads \
1040   s-tpopsp.adb<7stpopsp.adb \
1041   g-soccon.ads<3hsoccon.ads \
1042   system.ads<5hsystem.ads
1043
1044   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1045 endif
1046
1047 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
1048   LIBGNAT_TARGET_PAIRS = \
1049   a-intnam.ads<4hintnam.ads \
1050   s-inmaop.adb<7sinmaop.adb \
1051   s-intman.adb<7sintman.adb \
1052   s-osinte.adb<5iosinte.adb \
1053   s-osinte.ads<53osinte.ads \
1054   s-parame.ads<5hparame.ads \
1055   s-osprim.adb<7sosprim.adb \
1056   s-traceb.adb<5htraceb.adb \
1057   s-taprop.adb<7staprop.adb \
1058   s-taspri.ads<7staspri.ads \
1059   s-tpopsp.adb<5atpopsp.adb \
1060   g-soccon.ads<3hsoccon.ads \
1061   system.ads<5hsystem.ads
1062
1063   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5hml-tgt.adb
1064   TGT_LIB = /usr/lib/libcl.a
1065   THREADSLIB = -lpthread
1066   SYMLIB = -laddr2line -lbfd $(LIBINTL)
1067   GMEM_LIB = gmemlib
1068   soext = .sl
1069   SO_OPTS = -Wl,+h,
1070   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1071   GNATLIB_SHARED = gnatlib-shared-dual
1072   LIBRARY_VERSION := $(LIB_VERSION)
1073
1074   ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),)
1075     LIBGNAT_TARGET_PAIRS = \
1076     a-excpol.adb<4wexcpol.adb \
1077     a-intnam.ads<4hintnam.ads \
1078     s-inmaop.adb<7sinmaop.adb \
1079     s-interr.adb<5ginterr.adb \
1080     s-intman.adb<7sintman.adb \
1081     s-osinte.adb<5hosinte.adb \
1082     s-osinte.ads<5hosinte.ads \
1083     s-parame.ads<5hparame.ads \
1084     s-osprim.adb<7sosprim.adb \
1085     s-taprop.adb<5htaprop.adb \
1086     s-taspri.ads<5htaspri.ads \
1087     s-tpopsp.adb<7stpopsp.adb \
1088     g-soccon.ads<3hsoccon.ads \
1089     system.ads<5hsystem.ads
1090
1091     TGT_LIB =
1092     THREADSLIB = -lcma
1093   endif
1094 endif
1095
1096 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1097   LIBGNAT_TARGET_PAIRS = \
1098   a-intnam.ads<4cintnam.ads \
1099   s-inmaop.adb<7sinmaop.adb \
1100   s-intman.adb<7sintman.adb \
1101   s-osinte.adb<5bosinte.adb \
1102   s-osinte.ads<5bosinte.ads \
1103   s-osprim.adb<7sosprim.adb \
1104   s-taprop.adb<7staprop.adb \
1105   s-taspri.ads<7staspri.ads \
1106   s-tpopsp.adb<7stpopsp.adb \
1107   g-soccon.ads<3bsoccon.ads \
1108   system.ads<5bsystem.ads
1109
1110   THREADSLIB = -lpthreads
1111   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1112
1113   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
1114     LIBGNAT_TARGET_PAIRS = \
1115     a-intnam.ads<4cintnam.ads \
1116     s-inmaop.adb<7sinmaop.adb \
1117     s-intman.adb<7sintman.adb \
1118     s-osinte.adb<7sosinte.adb \
1119     s-osinte.ads<5cosinte.ads \
1120     s-osprim.adb<7sosprim.adb \
1121     s-taprop.adb<7staprop.adb \
1122     s-taspri.ads<7staspri.ads \
1123     s-tpopsp.adb<7stpopsp.adb \
1124     g-soccon.ads<3bsoccon.ads \
1125     system.ads<5bsystem.ads
1126
1127     THREADSLIB = -lgthreads -lmalloc
1128   endif
1129
1130   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5bml-tgt.adb
1131   GMEM_LIB = gmemlib
1132   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
1133
1134 endif
1135
1136 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1137   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1138     LIBGNAT_TARGET_PAIRS = \
1139     a-numaux.adb<86numaux.adb \
1140     a-numaux.ads<86numaux.ads \
1141     a-intnam.ads<42intnam.ads \
1142     s-mastop.adb<5omastop.adb \
1143     s-inmaop.adb<7sinmaop.adb \
1144     s-intman.adb<7sintman.adb \
1145     s-osinte.adb<56osinte.adb \
1146     s-osinte.ads<56osinte.ads \
1147     s-osprim.adb<7sosprim.adb \
1148     s-taprop.adb<56taprop.adb \
1149     s-taspri.ads<56taspri.ads \
1150     s-tpopsp.adb<56tpopsp.adb \
1151     system.ads<58system.ads
1152
1153     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1154
1155   else
1156     LIBGNAT_TARGET_PAIRS = \
1157     a-intnam.ads<42intnam.ads \
1158     s-inmaop.adb<7sinmaop.adb \
1159     s-intman.adb<7sintman.adb \
1160     s-osinte.adb<52osinte.adb \
1161     s-osinte.ads<52osinte.ads \
1162     s-osprim.adb<7sosprim.adb \
1163     s-taprop.adb<7staprop.adb \
1164     s-taspri.ads<7staspri.ads \
1165     s-tpopsp.adb<7stpopsp.adb \
1166     system.ads<57system.ads
1167
1168     ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
1169       LIBGNAT_TARGET_PAIRS = \
1170       a-intnam.ads<42intnam.ads \
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<57system.ads
1180     endif
1181
1182   endif
1183 endif
1184
1185 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1186   LIBGNAT_TARGET_PAIRS = \
1187   a-intnam.ads<4rintnam.ads \
1188   s-inmaop.adb<7sinmaop.adb \
1189   s-intman.adb<7sintman.adb \
1190   s-osinte.adb<5rosinte.adb \
1191   s-osinte.ads<5rosinte.ads \
1192   s-osprim.adb<7sosprim.adb \
1193   s-parame.adb<5rparame.adb \
1194   s-taprop.adb<7staprop.adb \
1195   s-taspri.ads<7staspri.ads \
1196   s-tpopsp.adb<5rtpopsp.adb
1197 endif
1198
1199 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1200   LIBGNAT_TARGET_PAIRS = \
1201   a-intnam.ads<4aintnam.ads \
1202   s-inmaop.adb<7sinmaop.adb \
1203   s-intman.adb<7sintman.adb \
1204   s-mastop.adb<5amastop.adb \
1205   s-osinte.adb<5aosinte.adb \
1206   s-osinte.ads<5aosinte.ads \
1207   s-osprim.adb<5posprim.adb \
1208   s-taprop.adb<5ataprop.adb \
1209   s-tasinf.ads<5atasinf.ads \
1210   s-taspri.ads<5ataspri.ads \
1211   s-tpopsp.adb<5atpopsp.adb \
1212   s-traceb.adb<7straceb.adb \
1213   g-soccon.ads<3asoccon.ads \
1214   system.ads<5asystem.ads
1215
1216   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5aml-tgt.adb
1217
1218   GMEM_LIB=gmemlib
1219   SYMLIB = -laddr2line -lbfd $(LIBINTL)
1220   THREADSLIB = -lpthread -lmach -lexc -lrt
1221   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1222   GNATLIB_SHARED = gnatlib-shared-default
1223   LIBRARY_VERSION := $(LIB_VERSION)
1224 endif
1225
1226 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(host))),)
1227
1228 soext  = .exe
1229
1230 .SUFFIXES: .sym
1231
1232 .o.sym: 
1233         @ gnu:[bin]vmssymvec $<
1234 endif
1235
1236 ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1237 ifeq ($(strip $(filter-out alpha64% dec vms% openvms% alphavms%,$(targ))),)
1238   LIBGNAT_TARGET_PAIRS_AUX =
1239 else
1240 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1241   LIBGNAT_TARGET_PAIRS_AUX = \
1242   s-parame.ads<5xparame.ads
1243 else
1244   LIBGNAT_TARGET_PAIRS_AUX = \
1245   s-parame.ads<5vparame.ads
1246 endif
1247 endif
1248
1249   LIBGNAT_TARGET_PAIRS = \
1250   a-caldel.adb<4vcaldel.adb \
1251   a-calend.adb<4vcalend.adb \
1252   a-calend.ads<4vcalend.ads \
1253   a-excpol.adb<4wexcpol.adb \
1254   a-intnam.ads<4vintnam.ads \
1255   g-expect.adb<3vexpect.adb \
1256   g-soccon.ads<3vsoccon.ads \
1257   g-socthi.ads<3vsocthi.ads \
1258   g-socthi.adb<3vsocthi.adb \
1259   g-trasym.adb<3vtrasym.adb \
1260   i-cstrea.adb<6vcstrea.adb \
1261   i-cpp.adb<6vcpp.adb \
1262   interfac.ads<6vinterf.ads \
1263   s-asthan.adb<5vasthan.adb \
1264   s-inmaop.adb<5vinmaop.adb \
1265   s-interr.adb<5vinterr.adb \
1266   s-intman.adb<5vintman.adb \
1267   s-intman.ads<5vintman.ads \
1268   s-osinte.adb<5vosinte.adb \
1269   s-osinte.ads<5vosinte.ads \
1270   s-osprim.adb<5vosprim.adb \
1271   s-osprim.ads<5vosprim.ads \
1272   s-taprop.adb<5vtaprop.adb \
1273   s-taspri.ads<5vtaspri.ads \
1274   s-tpopsp.adb<7stpopsp.adb \
1275   s-tpopde.adb<5vtpopde.adb \
1276   s-tpopde.ads<5vtpopde.ads \
1277   s-traent.adb<5vtraent.adb \
1278   s-traent.ads<5vtraent.ads \
1279   s-vaflop.adb<5vvaflop.adb \
1280   system.ads<5xsystem.ads   \
1281   $(LIBGNAT_TARGET_PAIRS_AUX)
1282
1283   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5vml-tgt.adb
1284
1285   GNATLIB_SHARED=gnatlib-shared-vms
1286   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1287   EXTRA_LIBGNAT_OBJS=vmshandler.o
1288   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1289   EXTRA_GNATTOOLS = \
1290      ../../gnatlbr$(exeext) \
1291      ,,/../gnatsym$(exeext)
1292   # This command transforms (YYYYMMDD) into YY,MMDD
1293   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
1294   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1295 endif
1296
1297 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1298   LIBGNAT_TARGET_PAIRS = \
1299   a-calend.adb<4wcalend.adb \
1300   a-excpol.adb<4wexcpol.adb \
1301   a-intnam.ads<4wintnam.ads \
1302   a-numaux.adb<86numaux.adb \
1303   a-numaux.ads<86numaux.ads \
1304   s-gloloc.adb<5wgloloc.adb \
1305   s-inmaop.adb<5ninmaop.adb \
1306   s-interr.adb<5ginterr.adb \
1307   s-intman.adb<5wintman.adb \
1308   s-mastop.adb<5omastop.adb \
1309   s-memory.adb<5wmemory.adb \
1310   s-osinte.ads<5wosinte.ads \
1311   s-osprim.adb<5wosprim.adb \
1312   s-taprop.adb<5wtaprop.adb \
1313   s-taspri.ads<5wtaspri.ads \
1314   g-socthi.ads<3wsocthi.ads \
1315   g-socthi.adb<3wsocthi.adb \
1316   g-soccon.ads<3wsoccon.ads \
1317   g-soliop.ads<3wsoliop.ads \
1318   system.ads<5wsystem.ads
1319
1320   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5wml-tgt.adb
1321   MISCLIB = -lwsock32
1322   SYMLIB = -laddr2line -lbfd -liberty $(LIBINTL)
1323   GMEM_LIB = gmemlib
1324   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1325   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1326   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1327   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1328   soext = .dll
1329   GNATLIB_SHARED = gnatlib-shared-win32
1330   LIBRARY_VERSION := $(LIB_VERSION)
1331 endif
1332
1333 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1334   LIBGNAT_TARGET_PAIRS = \
1335   a-intnam.ads<4lintnam.ads \
1336   s-inmaop.adb<7sinmaop.adb \
1337   s-intman.adb<7sintman.adb \
1338   s-osinte.ads<5iosinte.ads \
1339   s-osinte.adb<5iosinte.adb \
1340   s-osprim.adb<7sosprim.adb \
1341   s-taprop.adb<5itaprop.adb \
1342   s-tpopsp.adb<5atpopsp.adb \
1343   s-taspri.ads<5itaspri.ads \
1344   system.ads<55system.ads
1345
1346   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
1347   MISCLIB=
1348   THREADSLIB=-lpthread
1349   GNATLIB_SHARED=gnatlib-shared-dual
1350   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1351   LIBRARY_VERSION := $(LIB_VERSION)
1352 endif
1353
1354 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1355   LIBGNAT_TARGET_PAIRS = \
1356   a-intnam.ads<4lintnam.ads \
1357   s-inmaop.adb<7sinmaop.adb \
1358   s-intman.adb<7sintman.adb \
1359   s-osinte.ads<5iosinte.ads \
1360   s-osinte.adb<5iosinte.adb \
1361   s-osprim.adb<7sosprim.adb \
1362   s-taprop.adb<5itaprop.adb \
1363   s-tpopsp.adb<5atpopsp.adb \
1364   s-taspri.ads<5itaspri.ads \
1365   system.ads<5nsystem.ads
1366
1367   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
1368   MISCLIB=
1369   THREADSLIB=-lpthread
1370   GNATLIB_SHARED=gnatlib-shared-dual
1371   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1372   LIBRARY_VERSION := $(LIB_VERSION)
1373 endif
1374
1375 # The runtime library for gnat comprises two directories.  One contains the
1376 # Ada source files that the compiler (gnat1) needs -- these files are listed
1377 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1378 # corresponding .ali files for the parts written in Ada, libgnat.a for
1379 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1380 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1381 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1382 # go into the directory.  The pthreads emulation is built in the threads
1383 # subdirectory and copied.
1384 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1385   errno.c exit.c cal.c ctrl_c.c \
1386   raise.h raise.c sysdep.c types.h aux-io.c init.c \
1387   final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c \
1388   $(EXTRA_LIBGNAT_SRCS)
1389
1390 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
1391   raise.o sysdep.o aux-io.o init.o cal.o final.o \
1392   tracebak.o expect.o mkdir.o socket.o $(EXTRA_LIBGNAT_OBJS)
1393
1394 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1395 #  the library installation will change and there will be a
1396 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1397 #  from ADA_INCLUDE_SRCS.
1398
1399 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1400 # the following include file:
1401
1402 include $(fsrcdir)/Makefile.rtl
1403
1404 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1405   g-trasym.o memtrack.o
1406
1407 # Files which are suitable in no run time/hi integrity mode
1408
1409 COMPILABLE_HIE_SOURCES= \
1410  system.ads   \
1411  ada.ads      \
1412  gnat.ads     \
1413  g-souinf.ads \
1414  interfac.ads \
1415  i-c.ads      \
1416  s-stoele.ads \
1417  s-stoele.adb \
1418  s-maccod.ads \
1419  s-unstyp.ads \
1420  s-fatflt.ads \
1421  s-fatlfl.ads \
1422  s-fatllf.ads \
1423  s-fatsfl.ads \
1424  s-secsta.ads \
1425  s-secsta.adb \
1426  a-tags.ads   \
1427  a-tags.adb  \
1428  a-except.ads \
1429  a-except.adb $(EXTRA_HIE_SOURCES)
1430
1431 NON_COMPILABLE_HIE_SOURCES= \
1432  a-unccon.ads \
1433  a-uncdea.ads \
1434  s-fatgen.adb \
1435  s-fatgen.ads \
1436  unchconv.ads \
1437  s-atacco.ads \
1438  s-atacco.adb \
1439  unchdeal.ads
1440
1441
1442 HIE_SOURCES = $(NON_COMPILABLE_HIE_SOURCES) $(COMPILABLE_HIE_SOURCES)
1443
1444 # Object to generate for the HI run time
1445
1446 HIE_OBJS =  \
1447  system.o   \
1448  ada.o      \
1449  a-except.o \
1450  gnat.o     \
1451  g-souinf.o \
1452  interfac.o \
1453  i-c.o      \
1454  s-stoele.o \
1455  s-maccod.o \
1456  s-unstyp.o \
1457  s-fatflt.o \
1458  s-fatlfl.o \
1459  s-fatllf.o \
1460  s-secsta.o \
1461  a-tags.o $(EXTRA_HIE_OBJS)
1462
1463 # Files which are needed in ravenscar mode
1464
1465 COMPILABLE_RAVEN_SOURCES = \
1466 $(COMPILABLE_HIE_SOURCES) \
1467  s-parame.ads \
1468  s-parame.adb \
1469  s-purexc.ads \
1470  s-osinte.ads \
1471  s-osinte.adb \
1472  s-tasinf.ads \
1473  s-tasinf.adb \
1474  s-taspri.ads \
1475  s-taprop.ads \
1476  s-taprop.adb \
1477  s-taskin.ads \
1478  s-taskin.adb \
1479  s-interr.ads \
1480  s-interr.adb \
1481  a-interr.ads \
1482  a-interr.adb \
1483  a-intnam.ads \
1484  a-reatim.ads \
1485  a-reatim.adb \
1486  a-retide.ads \
1487  a-retide.adb \
1488  s-taprob.ads \
1489  s-taprob.adb \
1490  s-tposen.ads \
1491  s-tposen.adb \
1492  s-tasres.ads \
1493  s-tarest.ads \
1494  s-tarest.adb \
1495  a-sytaco.ads \
1496  a-sytaco.adb \
1497  a-taside.ads \
1498  a-taside.adb $(EXTRA_RAVEN_SOURCES)
1499
1500 NON_COMPILABLE_RAVEN_SOURCES= $(NON_COMPILABLE_HIE_SOURCES)
1501
1502 RAVEN_SOURCES = $(NON_COMPILABLE_RAVEN_SOURCES) $(COMPILABLE_RAVEN_SOURCES)
1503
1504 # Objects to generate for the ravenscar run time
1505
1506 RAVEN_OBJS = \
1507  $(HIE_OBJS) \
1508  s-parame.o  \
1509  s-purexc.o  \
1510  s-osinte.o  \
1511  s-tasinf.o  \
1512  s-taspri.o  \
1513  s-taprop.o  \
1514  s-taskin.o  \
1515  s-interr.o  \
1516  a-interr.o  \
1517  a-intnam.o  \
1518  a-reatim.o  \
1519  a-retide.o  \
1520  s-taprob.o  \
1521  s-tposen.o  \
1522  s-tasres.o  \
1523  s-tarest.o  \
1524  a-sytaco.o \
1525  a-taside.o $(EXTRA_RAVEN_OBJS)
1526
1527
1528 # Files which are needed for the cert level B runtime
1529
1530 COMPILABLE_CERT_LEVEL_B_SOURCES = \
1531 $(COMPILABLE_HIE_SOURCES) \
1532  a-except.adb \
1533  a-except.ads \
1534  a-exctra.ads \
1535  a-exctra.adb \
1536  s-init.adb   \
1537  s-init.ads   \
1538  s-memory.adb \
1539  s-memory.ads \
1540  s-osinte.ads \
1541  s-soflin.adb \
1542  s-soflin.ads \
1543  s-stalib.adb \
1544  s-stalib.ads \
1545  s-assert.adb \
1546  s-assert.ads \
1547  s-exnint.adb \
1548  s-exnint.ads \
1549  s-strops.adb \
1550  s-strops.ads \
1551  s-thread.adb \
1552  s-thread.ads \
1553  s-traceb.adb \
1554  s-traceb.ads \
1555  s-traent.ads \
1556  s-traent.adb \
1557  g-debuti.ads \
1558  g-debuti.adb \
1559  g-io.adb     \
1560  g-io.ads     \
1561  $(EXTRA_CERT_LEVEL_B_SOURCES)
1562
1563 NON_COMPILABLE_CERT_LEVEL_B_SOURCES= \
1564  a-elchha.ads \
1565  a-elchha.adb \
1566  a-elchha.adb.full \
1567  a-excach.adb \
1568  $(NON_COMPILABLE_HIE_SOURCES)
1569
1570 CERT_LEVEL_B_SOURCES = \
1571 $(NON_COMPILABLE_CERT_LEVEL_B_SOURCES) \
1572 $(COMPILABLE_CERT_LEVEL_B_SOURCES)
1573
1574 # Objects to generate for the cert level B run time
1575
1576 CERT_LEVEL_B_OBJS = \
1577  $(HIE_OBJS) \
1578  a-except.o  \
1579  s-init.o    \
1580  s-memory.o  \
1581  s-soflin.o  \
1582  s-stalib.o  \
1583  s-thrini.o  \
1584  s-traceb.o  \
1585  s-assert.o  \
1586  s-exnint.o  \
1587  s-strops.o  \
1588  s-thread.o  \
1589  g-debuti.o  \
1590  g-io.o      \
1591  $(EXTRA_CERT_LEVEL_B_OBJS)
1592
1593 # C files for the cert level B run time (without the .c extension)
1594
1595 CERT_LEVEL_B_C_FILES = \
1596 2raise \
1597 $(EXTRA_CERT_LEVEL_B_C_FILES)
1598
1599 # Default run time files
1600
1601 ADA_INCLUDE_SRCS =\
1602  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1603  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1604  sequenio.ads system.ads Makefile.adalib Makefile.prolog Makefile.generic \
1605  memtrack.adb \
1606  a-*.adb a-*.ads g-*.ad? i-*.ad? \
1607  s-[a-o]*.adb s-[p-z]*.adb \
1608  s-[a-o]*.ads s-[p-z]*.ads
1609
1610 LIBGNAT=../rts/libgnat.a 
1611 TOOLS_FLAGS_TO_PASS=            \
1612         "CC=$(CC)"              \
1613         "CFLAGS=$(CFLAGS)"      \
1614         "LDFLAGS=$(LDFLAGS)"    \
1615         "ADAFLAGS=$(ADAFLAGS)"  \
1616         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
1617         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
1618         "libsubdir=$(libsubdir)"        \
1619         "exeext=$(exeext)"      \
1620         "fsrcdir=$(fsrcdir)"    \
1621         "srcdir=$(fsrcdir)"     \
1622         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
1623         "GNATMAKE=$(GNATMAKE)"  \
1624         "GNATLINK=$(GNATLINK)"  \
1625         "GNATBIND=$(GNATBIND)"
1626
1627 # Build directory for the tools. Let's copy the target-dependent
1628 # sources using the same mechanism as for gnatlib. The other sources are 
1629 # accessed using the vpath directive below
1630
1631 ../stamp-tools:
1632         -$(RM) tools/*
1633         -$(RMDIR) tools
1634         -$(MKDIR) tools
1635         -(cd tools; $(LN_S) ../sdefault.adb .)
1636         -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
1637                   $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\
1638                   $(LN_S) $(fsrcdir)/$(word 2,$(subst <, ,$(PAIR))) \
1639                         tools/$(word 1,$(subst <, ,$(PAIR)));)
1640         touch ../stamp-tools
1641
1642 # when compiling the tools, the runtime has to be first on the path so that
1643 # it hides the runtime files lying with the rest of the sources
1644 ifeq ($(TOOLSCASE),native)
1645   vpath %.ads ../rts ../
1646   vpath %.adb ../rts ../
1647   vpath %.c   ../rts ../
1648   vpath %.h   ../rts ../
1649 endif
1650
1651 # in the cross tools case, everything is compiled with the native 
1652 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1653 ifeq ($(TOOLSCASE),cross)
1654   vpath %.ads ../
1655   vpath %.adb ../
1656   vpath %.c   ../
1657   vpath %.h   ../
1658 endif
1659
1660 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap 
1661 # reasons: gnatmake should be built with a recent compiler, a recent compiler
1662 # may not generate ALI files compatible with an old gnatmake so it is important
1663 # to be able to build gnatmake without a version of gnatmake around. Once 
1664 # everything has been compiled once, gnatmake can be recompiled with itself 
1665 # (see target gnattools1-re) 
1666 gnattools1: ../stamp-tools ../stamp-gnatlib
1667         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1668           TOOLSCASE=native \
1669           ../../gnatmake$(exeext) ../../gnatlink$(exeext) ../../gnatbl$(exeext)
1670
1671 # gnatmake/link can be built with recent gnatmake/link if they are available.
1672 # This is especially convenient for building cross tools or for rebuilding
1673 # the tools when the original bootstrap has already be done.
1674 gnattools1-re: ../stamp-tools
1675         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1676           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
1677
1678 # these tools are built with gnatmake & are common to native and cross
1679 gnattools2: ../stamp-tools
1680         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1681           TOOLSCASE=native \
1682           ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
1683           ../../gnatls$(exeext) ../../gnatprep$(exeext) \
1684           ../../gnatxref$(exeext) \
1685           ../../gnatfind$(exeext) ../../gnatname$(exeext) \
1686           ../../gnatclean$(exeext) \
1687           ../../gprcmd$(exeext)   ../../gpr2make$(exeext)
1688
1689 # These tools are only built for the native version.
1690 gnattools3: ../stamp-tools
1691 #       $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1692 #         TOOLSCASE=native top_builddir=../../.. \
1693 #         ../../gnatmem$(exeext) $(EXTRA_GNATTOOLS)
1694
1695 # those tools are only built for the cross version
1696 gnattools4: ../stamp-tools
1697         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1698           TOOLSCASE=cross top_buildir=../../.. \
1699            ../../vxaddr2line$(exeext)
1700
1701 ../../gnatchop$(exeext): ../stamp-tools
1702         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1703         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1704         $(GNATLINK) -v gnatchop -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1705                 $(TOOLS_LIBS)
1706
1707 ../../gnat$(exeext): ../stamp-tools
1708         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1709         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1710         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1711
1712 ../../gnatkr$(exeext): ../stamp-tools
1713         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1714         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1715         $(GNATLINK) -v gnatkr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1716
1717 ../../gnatls$(exeext): ../stamp-tools
1718         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1719         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1720         $(GNATLINK) -v gnatls -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1721
1722 ../../gnatname$(exeext): ../stamp-tools
1723         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1724         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1725         $(GNATLINK) -v gnatname -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1726                     $(TOOLS_LIBS)
1727
1728 ../../gpr2make$(exeext): ../stamp-tools
1729         $(GNATMAKE) -c $(ADA_INCLUDES) gpr2make --GCC="$(CC) $(ALL_ADAFLAGS)"
1730         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gpr2make 
1731         $(GNATLINK) -v gpr2make -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1732                     $(TOOLS_LIBS)
1733
1734 ../../gnatprep$(exeext): ../stamp-tools
1735         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1736         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1737         $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1738                     $(TOOLS_LIBS)
1739
1740 ../../gnatxref$(exeext): ../stamp-tools
1741         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1742         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1743         $(GNATLINK) -v gnatxref -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1744                     $(TOOLS_LIBS)
1745
1746 ../../gnatfind$(exeext): ../stamp-tools
1747         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1748         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1749         $(GNATLINK) -v gnatfind -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1750                     $(TOOLS_LIBS)
1751
1752 ../../gnatclean$(exeext): ../stamp-tools
1753         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1754         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1755         $(GNATLINK) -v gnatclean -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1756                     $(TOOLS_LIBS)
1757
1758 ../../gnatsym$(exeext): ../stamp-tools
1759         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1760         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1761         $(GNATLINK) -v gnatsym -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1762                     $(TOOLS_LIBS)
1763
1764 ../../gnatmem$(exeext): ../stamp-tools gmem.o $(SYMDEPS)
1765 ifeq ($(GMEM_LIB),gmemlib)
1766            $(GNATMAKE) -c $(ADA_INCLUDES) gnatmem --GCC="$(CC) $(ALL_ADAFLAGS)"
1767            $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmem 
1768            $(GNATLINK) -v gnatmem -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1769                     gmem.o $(SYMLIB) $(TOOLS_LIBS)
1770 endif 
1771
1772 ../../gnatdll$(exeext): ../stamp-tools
1773         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1774         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1775         $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1776                 $(TOOLS_LIBS)
1777
1778 ../../gprcmd$(exeext): ../stamp-tools
1779         $(GNATMAKE) -c $(ADA_INCLUDES) gprcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1780         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprcmd 
1781         $(GNATLINK) -v gprcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1782
1783 ../../vxaddr2line$(exeext): ../stamp-tools
1784         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1785         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1786         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(CLIB)
1787
1788 gnatmake-re: ../stamp-tools
1789         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1790         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1791         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1792         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1793                 --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1794
1795 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1796 # with the former version of gnatlink itself which cannot override itself.
1797 gnatlink-re: ../stamp-tools link.o
1798         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1799         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1800         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1801                     --GCC="$(CC) $(ADA_INCLUDES)" link.o $(TOOLS_LIBS)
1802         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1803   
1804 # Needs to be built with CC=gcc
1805 # Since the RTL should be built with the latest compiler, remove the
1806 #  stamp target in the parent directory whenever gnat1 is rebuilt
1807
1808 # Likewise for the tools
1809 ../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
1810         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1811               $(TOOLS_LIBS)
1812
1813 ../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
1814         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1815               $(TOOLS_LIBS)
1816
1817 ../../gnatbl$(exeext): gnatbl.o
1818         $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1819
1820 gnatbl.o: gnatbl.c adaint.h
1821         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
1822
1823 ../stamp-gnatlib:
1824         @if [ ! -f stamp-gnatlib ] ; \
1825         then \
1826           $(ECHO) You must first build the GNAT library: make gnatlib; \
1827           false; \
1828         else \
1829           true; \
1830         fi
1831
1832 install-gnatlib: ../stamp-gnatlib
1833 #       Create the directory before deleting it, in case the directory is
1834 #       a list of directories (as it may be on VMS). This ensures we are
1835 #       deleting the right one.
1836         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1837         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1838         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1839         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1840         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1841         $(RMDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1842         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1843         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1844         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1845         -$(INSTALL_DATA) rts/Makefile.prolog $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1846         -$(INSTALL_DATA) rts/Makefile.generic $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1847         for file in rts/*.ali; do \
1848             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1849         done
1850         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1851         -for file in rts/*$(arext);do \
1852             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1853         done
1854 #     Install the shared libraries, if any, using $(INSTALL) instead
1855 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1856 #     for shared libraries on some targets, e.g. on HP-UX where the x
1857 #     permission is required.
1858 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
1859         -for file in rts/lib*$(soext);do \
1860             $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1861         done
1862 else
1863         -for file in rts/lib*-*$(soext);do \
1864             $(INSTALL) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1865         done
1866 endif
1867         if [ -f rts/libgnat-*$(soext) ]; then \
1868            (cd $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1869             $(LN_S) libgnat-*$(soext) libgnat$(soext) && \
1870             $(LN_S) libgnarl-*$(soext) libgnarl$(soext)) \
1871         fi
1872 # This copy must be done preserving the date on the original file.
1873         for file in rts/*.adb rts/*.ads; do \
1874             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1875         done
1876         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1877         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1878
1879 ../stamp-gnatlib2:
1880         $(RM) rts/s-*.ali
1881         $(RM) rts/s-*$(objext)
1882         $(RM) rts/a-*.ali
1883         $(RM) rts/a-*$(objext)
1884         $(RM) rts/*.ali
1885         $(RM) rts/*$(objext)
1886         $(RM) rts/*$(arext)
1887         $(RM) rts/*$(soext)
1888         touch ../stamp-gnatlib2
1889         $(RM) ../stamp-gnatlib
1890
1891 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1892 #       successive target commands. Although the Gnu make documentation
1893 #       implies this is true on all systems, I suspect it may not be, So care
1894 #       has been taken to allow a sed script to look for ";)" and substitue
1895 #       for ";" the appropriate character in the range of lines below
1896 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1897
1898 # GNULLI Begin ###########################################################
1899
1900 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1901         $(RMDIR) rts
1902         $(MKDIR) rts
1903         $(CHMOD) u+w rts
1904 # Copy target independent sources
1905         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1906           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1907 # Remove files to be replaced by target dependent sources
1908         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1909                         rts/$(word 1,$(subst <, ,$(PAIR))))
1910 # Copy new target dependent sources
1911         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1912                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1913                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1914         $(RM) ../stamp-gnatlib
1915         touch ../stamp-gnatlib1
1916
1917 # GNULLI End #############################################################
1918
1919 # Don't use semicolon separated shell commands that involve list expansions.
1920 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1921 # line lengths in excess of 256 characters.
1922 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1923 # is guaranteed to overflow the buffer.
1924
1925 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1926         $(MAKE) -C rts CC="../../xgcc -B../../" \
1927                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1928                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1929                 srcdir=$(fsrcdir) \
1930                 -f ../Makefile $(LIBGNAT_OBJS)
1931         $(MAKE) -C rts CC="../../xgcc -B../../" \
1932                 ADA_INCLUDES="" \
1933                 CFLAGS="$(GNATLIBCFLAGS)" \
1934                 ADAFLAGS="$(GNATLIBFLAGS)" \
1935                 srcdir=$(fsrcdir) \
1936                 -f ../Makefile \
1937                 $(GNATRTL_OBJS)
1938         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1939         $(AR) $(AR_FLAGS) rts/libgnat$(arext) \
1940            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1941         ifneq ($(PREFIX_OBJS),)
1942                 $(AR) $(AR_FLAGS) rts/libgccprefix$(arext) $(PREFIX_OBJS);
1943         endif
1944         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnat$(arext); else true; fi
1945         $(AR) $(AR_FLAGS) rts/libgnarl$(arext) \
1946            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1947         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnarl$(arext); else true; fi
1948         ifeq ($(GMEM_LIB),gmemlib)
1949                 $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o;
1950         endif
1951         $(CHMOD) a-wx rts/*.ali
1952         touch ../stamp-gnatlib
1953
1954 HIE_NONE_TARGET_PAIRS=\
1955  a-except.ads<1aexcept.ads \
1956  a-except.adb<1aexcept.adb \
1957  a-tags.ads<1atags.ads \
1958  a-tags.adb<1atags.adb \
1959  s-secsta.ads<1ssecsta.ads \
1960  s-secsta.adb<1ssecsta.adb \
1961  i-c.ads<1ic.ads $(EXTRA_HIE_NONE_TARGET_PAIRS)
1962
1963 # This target needs RTS_NAME, RTS_SRCS, RTS_TARGET_PAIRS to be set properly
1964 # it creates a rts with the proper structure and the right target 
1965 # dependant srcs
1966 prepare-rts:
1967         $(RMDIR) rts-$(RTS_NAME)
1968         $(MKDIR) rts-$(RTS_NAME)
1969         $(CHMOD) u+w rts-$(RTS_NAME)
1970         $(MKDIR) rts-$(RTS_NAME)/adalib
1971         $(MKDIR) rts-$(RTS_NAME)/adainclude
1972         $(CHMOD) u+w rts-$(RTS_NAME)/*
1973 # Generate the project file
1974         $(ECHO) "project $(RTS_NAME) is" > rts-$(RTS_NAME)/$(RTS_NAME).gpr
1975         $(ECHO) "   for Source_Dirs use (\"adainclude\");" \
1976                 >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
1977         $(ECHO) "   for Object_Dir use \"adalib\";" \
1978                 >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
1979         $(ECHO) "   for Source_List_File use " \
1980                 >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1981         $(ECHO) "      \"rts-$(RTS_NAME)_source_list.txt\";" \
1982                 >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1983         $(ECHO) "   package Builder is" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1984         $(ECHO) "     for Default_Switches (\"Ada\") use (\"-a\");" \
1985                  >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1986         $(ECHO) "  end Builder;" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1987         $(ECHO) "  package Compiler is" >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
1988         $(ECHO) "     for Default_Switches (\"Ada\") use (\"-nostdinc\");" \
1989                  >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1990         $(ECHO) "  end Compiler;" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1991         $(ECHO) "end $(RTS_NAME);" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1992
1993         $(foreach f, $(COMPILABLE_SOURCES), \
1994                 $(ECHO) $(f) >> \
1995                         rts-$(RTS_NAME)/rts-$(RTS_NAME)_source_list.txt ;) true
1996 # Copy target independent sources
1997         $(foreach f,$(RTS_SRCS), \
1998           $(CP) $(fsrcpfx)$(f) rts-$(RTS_NAME)/adainclude/ ;) true
1999 # Remove files to be replaced by target dependent sources
2000         $(RM) $(foreach PAIR,$(RTS_TARGET_PAIRS), \
2001                  rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR))))
2002 # Copy new target dependent sources
2003         $(foreach PAIR,$(RTS_TARGET_PAIRS), \
2004             $(CP) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
2005                     rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR)));)
2006
2007 install-rts: force
2008         $(CP) -r rts-$(RTS_NAME) $(DESTDIR)$(libsubdir)/
2009
2010 rts-zfp: force
2011         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
2012            RTS_NAME=zfp RTS_SRCS="$(HIE_SOURCES)" \
2013            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
2014            COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" 
2015         -$(GNATMAKE) -Prts-zfp/zfp.gpr --GCC="../../../xgcc -B../../../"
2016         $(RM) rts-zfp/adalib/*.o
2017         $(CHMOD) a-wx rts-zfp/adalib/*.ali
2018
2019 rts-cert: force
2020 # First compile the Ada files ...
2021         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
2022            RTS_NAME=cert RTS_SRCS="$(CERT_LEVEL_B_SOURCES)" \
2023            RTS_TARGET_PAIRS="$(CERT_LEVEL_B_TARGET_PAIRS)" \
2024            COMPILABLE_SOURCES="$(COMPILABLE_CERT_LEVEL_B_SOURCES)"
2025         $(GNATMAKE) -Prts-cert/cert.gpr --GCC="../../../xgcc -B../../../"
2026 # ... then the C files. This section will eventually be removed.
2027         $(foreach f,$(CERT_LEVEL_B_C_FILES), \
2028           $(CP) $(fsrcpfx)$(f).c rts-cert/adainclude/ ;)
2029         cd rts-cert/adalib ; \
2030         $(foreach f,$(CERT_LEVEL_B_C_FILES), \
2031         ../../../$(GCC_FOR_TARGET) -B../../../ $(TARGET_LIBGCC2_CFLAGS) \
2032         $(ALL_CFLAGS) $(GNATLIBCFLAGS_FOR_C) -c ../adainclude/$(f).c \
2033         -I../adainclude $(INCLUDES_FOR_SUBDIR) -I../../../ ;) \
2034 # ... Finally, generate the libs:
2035         cd rts-cert/adalib ; \
2036         ../../../xgcc -B../../../ *.o -o libgnat ; \
2037         $(RM) *.o ; \
2038         $(MV) libgnat libgnat.o ; \
2039         $(AR) $(ARFLAGS) libgnat.a libgnat.o ; \
2040         $(foreach f,$(CERT_LEVEL_B_EXTRA_OBJECT_FILES), \
2041         ../../../xgcc -c -B../../../ $(GNATLIBFLAGS) ../adainclude/$(f) \
2042         -I../adainclude; \
2043         $(AR) $(ARFLAGS) libgnat.a $(subst .adb,.o,$(f))) ; \
2044         $(CHMOD) a-wx *.ali *.o *.a ; \
2045
2046 rts-none: force
2047         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
2048            RTS_NAME=none RTS_SRCS="$(HIE_SOURCES)" \
2049            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
2050            COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" 
2051         -$(GNATMAKE) -Prts-none/none.gpr --GCC="../../../xgcc -B../../../"
2052         $(RM) rts-none/adalib/*.o
2053         $(CHMOD) a-wx rts-none/adalib/*.ali
2054
2055 rts-ravenscar: force
2056         $(MAKE)  $(FLAGS_TO_PASS) prepare-rts \
2057            RTS_NAME=ravenscar RTS_SRCS="$(RAVEN_SOURCES)" \
2058            RTS_TARGET_PAIRS="$(HIE_RAVEN_TARGET_PAIRS)" \
2059            COMPILABLE_SOURCES="$(COMPILABLE_RAVEN_SOURCES)" 
2060         -$(GNATMAKE) -Prts-ravenscar/ravenscar.gpr \
2061            --GCC="../../../xgcc -B../../../"
2062         $(CHMOD) a-wx rts-ravenscar/adalib/*.ali
2063
2064 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2065 gnatlib-shared-default:
2066         $(MAKE) $(FLAGS_TO_PASS) \
2067              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2068              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2069              THREAD_KIND="$(THREAD_KIND)" \
2070              gnatlib
2071         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
2072         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2073                 -o libgnat-$(LIBRARY_VERSION)$(soext) \
2074                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2075                 $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) $(MISCLIB) -lm
2076         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2077                 -o libgnarl-$(LIBRARY_VERSION)$(soext) \
2078                 $(GNATRTL_TASKING_OBJS) \
2079                 $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) $(THREADSLIB)
2080         cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
2081         cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext)
2082
2083 gnatlib-shared-dual:
2084         $(MAKE) $(FLAGS_TO_PASS) \
2085              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2086              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2087              THREAD_KIND="$(THREAD_KIND)" \
2088              gnatlib-shared-default
2089         $(MV) rts/libgna*$(soext) .
2090         $(RM) ../stamp-gnatlib2
2091         $(MAKE) $(FLAGS_TO_PASS) \
2092              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2093              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2094              THREAD_KIND="$(THREAD_KIND)" \
2095              gnatlib
2096         $(MV) libgna*$(soext) rts
2097
2098 # Note that on Win32 the auto-import does not work for DLL, so on the
2099 # platform we have a specific setup. The libgnat.dll contains only
2100 # non-tasking objects and libgnarl.dll contains tasking and non-tasking
2101 # objects. A tasking program must be linked with libgnarl.dll only.
2102 gnatlib-shared-win32:
2103         $(MAKE) $(FLAGS_TO_PASS) \
2104              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2105              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2106              THREAD_KIND="$(THREAD_KIND)" \
2107              gnatlib
2108         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
2109         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2110                 -o libgnat-$(LIBRARY_VERSION)$(soext) \
2111                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2112                 $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2113         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2114                 -o libgnarl-$(LIBRARY_VERSION)$(soext) \
2115                 $(GNATRTL_TASKING_OBJS) \
2116                 $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) \
2117                 $(THREADSLIB) -Wl,libgnat-$(LIBRARY_VERSION)$(soext)
2118         cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
2119         cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext)
2120
2121 gnatlib-shared-vms:
2122         $(MAKE) $(FLAGS_TO_PASS) \
2123              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2124              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2125              THREAD_KIND="$(THREAD_KIND)" \
2126              gnatlib
2127         $(RM) rts/libgnat*$(soext) rts/libgnarl*$(soext)
2128         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
2129         objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
2130         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
2131         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
2132         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
2133            -o libgnat_s$(soext) libgnat.a \
2134            sys\$$library:trace.exe \
2135            --for-linker=/noinform \
2136            --for-linker=SYMVEC_$$$$.opt \
2137            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2138         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
2139         objdump --syms $(GNATRTL_TASKING_OBJS) | \
2140         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
2141         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
2142         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
2143            -o libgnarl_s$(soext) \
2144            libgnarl.a libgnat_s$(soext) \
2145            sys\$$library:trace.exe \
2146            --for-linker=/noinform \
2147            --for-linker=SYMVEC_$$$$.opt \
2148            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2149
2150 gnatlib-shared:
2151         $(MAKE) $(FLAGS_TO_PASS) \
2152              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2153              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2154              THREAD_KIND="$(THREAD_KIND)" \
2155              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2156              $(GNATLIB_SHARED)
2157
2158 gnatlib-sjlj: ../stamp-gnatlib1
2159         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
2160         $(MV) rts/s.ads rts/system.ads
2161         $(MAKE) $(FLAGS_TO_PASS) \
2162              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2163              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2164              THREAD_KIND="$(THREAD_KIND)" \
2165              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2166
2167 # .s files for cross-building
2168 gnat-cross: force
2169         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2170
2171 # Compiling object files from source files.
2172
2173 # Note that dependencies on obstack.h are not written
2174 # because that file is not part of GCC.
2175 # Dependencies on gvarargs.h are not written
2176 # because all that file does, when not compiling with GCC,
2177 # is include the system varargs.h.
2178
2179 b_gnatl.c : $(GNATLINK_OBJS)
2180         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2181 b_gnatl.o : b_gnatl.c
2182
2183 b_gnatm.c : $(GNATMAKE_OBJS)
2184         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2185 b_gnatm.o : b_gnatm.c
2186
2187 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2188 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2189 ADA_SHARE_MAKE_DIR = $(prefix)/share/make
2190
2191 # force no sibling call optimization on s-traceb.o so the number of stack
2192 # frames to be skipped when computing a call chain is not modified by
2193 # optimization. However we can do that only when building the runtime
2194 # (not the compiler) because the -fno-optimize-sibling-calls exists
2195 # only in GCC 3.
2196
2197 ifneq (,$(findstring xgcc,$(CC)))
2198 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
2199 else
2200 NO_SIBLING_ADAFLAGS=
2201 endif
2202
2203 s-traceb.o  : s-traceb.adb
2204         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2205               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
2206               $< $(OUTPUT_OPTION)
2207
2208 adadecode.o : adadecode.c adadecode.h
2209 aux-io.o  : aux-io.c
2210 argv.o    : argv.c
2211 cal.o     : cal.c
2212 deftarg.o  : deftarg.c
2213 errno.o   : errno.c
2214 exit.o    : raise.h exit.c
2215 expect.o  : expect.c
2216 final.o   : raise.h final.c
2217 gmem.o    : gmem.c
2218 link.o    : link.c
2219 mkdir.o   : mkdir.c
2220 socket.o  : socket.c
2221 sysdep.o  : sysdep.c
2222
2223 cio.o     : cio.c 
2224         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2225                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2226
2227 init.o    : init.c ada.h types.h raise.h
2228         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2229                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2230
2231 raise.o   : raise.c raise.h
2232         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2233                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2234
2235 # Need to keep the frame pointer in this file to pop the stack properly on
2236 # some targets.
2237 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c
2238         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2239               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2240
2241 # In GNU Make, ignore whether `stage*' exists.
2242 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2243 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2244
2245 force:
2246
2247 # Gnatlbr is only used on VMS
2248
2249 ../../gnatlbr$(exeext): ../../prefix.o
2250         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2251         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2252         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
2253                 $(TOOLS_LIBS)