OSDN Git Service

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