OSDN Git Service

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