OSDN Git Service

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