OSDN Git Service

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