OSDN Git Service

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