OSDN Git Service

2004-02-02 Vincent Celier <celier@gnat.com>
[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
920     THREADSLIB =
921   endif
922
923   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5gml-tgt.adb
924   TGT_LIB = -lexc
925   MISCLIB = -lexc
926   SO_OPTS = -Wl,-all,-set_version,sgi1.0,-update_registry,../so_locations,-soname,
927   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
928   LIBRARY_VERSION := $(LIB_VERSION)
929 endif
930
931 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
932   LIBGNAT_TARGET_PAIRS = \
933   a-excpol.adb<4wexcpol.adb \
934   a-intnam.ads<4hintnam.ads \
935   s-inmaop.adb<7sinmaop.adb \
936   s-interr.adb<5ginterr.adb \
937   s-intman.adb<7sintman.adb \
938   s-osinte.adb<5hosinte.adb \
939   s-osinte.ads<5hosinte.ads \
940   s-parame.ads<5hparame.ads \
941   s-osprim.adb<7sosprim.adb \
942   s-taprop.adb<5htaprop.adb \
943   s-taspri.ads<5htaspri.ads \
944   s-tpopsp.adb<7stpopsp.adb \
945   g-soccon.ads<3hsoccon.ads \
946   system.ads<5hsystem.ads
947
948   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
949 endif
950
951 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
952   LIBGNAT_TARGET_PAIRS = \
953   a-intnam.ads<4hintnam.ads \
954   s-inmaop.adb<7sinmaop.adb \
955   s-intman.adb<7sintman.adb \
956   s-osinte.adb<5iosinte.adb \
957   s-osinte.ads<53osinte.ads \
958   s-parame.ads<5hparame.ads \
959   s-osprim.adb<7sosprim.adb \
960   s-traceb.adb<5htraceb.adb \
961   s-taprop.adb<7staprop.adb \
962   s-taspri.ads<7staspri.ads \
963   s-tpopsp.adb<5atpopsp.adb \
964   g-soccon.ads<3hsoccon.ads \
965   system.ads<5hsystem.ads
966
967   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5hml-tgt.adb
968   TGT_LIB = /usr/lib/libcl.a
969   THREADSLIB = -lpthread
970   SYMLIB = $(ADDR2LINE_SYMLIB)
971   GMEM_LIB = gmemlib
972   soext = .sl
973   SO_OPTS = -Wl,+h,
974   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
975   GNATLIB_SHARED = gnatlib-shared-dual
976   LIBRARY_VERSION := $(LIB_VERSION)
977
978   ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),)
979     LIBGNAT_TARGET_PAIRS = \
980     a-excpol.adb<4wexcpol.adb \
981     a-intnam.ads<4hintnam.ads \
982     s-inmaop.adb<7sinmaop.adb \
983     s-interr.adb<5ginterr.adb \
984     s-intman.adb<7sintman.adb \
985     s-osinte.adb<5hosinte.adb \
986     s-osinte.ads<5hosinte.ads \
987     s-parame.ads<5hparame.ads \
988     s-osprim.adb<7sosprim.adb \
989     s-taprop.adb<5htaprop.adb \
990     s-taspri.ads<5htaspri.ads \
991     s-tpopsp.adb<7stpopsp.adb \
992     g-soccon.ads<3hsoccon.ads \
993     system.ads<5hsystem.ads
994
995     TGT_LIB =
996     THREADSLIB = -lcma
997   endif
998 endif
999
1000 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1001   LIBGNAT_TARGET_PAIRS = \
1002   a-intnam.ads<4cintnam.ads \
1003   s-inmaop.adb<7sinmaop.adb \
1004   s-intman.adb<7sintman.adb \
1005   s-osinte.adb<5bosinte.adb \
1006   s-osinte.ads<5bosinte.ads \
1007   s-osprim.adb<7sosprim.adb \
1008   s-taprop.adb<7staprop.adb \
1009   s-taspri.ads<7staspri.ads \
1010   s-tpopsp.adb<7stpopsp.adb \
1011   g-soccon.ads<3bsoccon.ads \
1012   system.ads<5bsystem.ads
1013
1014   THREADSLIB = -lpthreads
1015   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1016
1017   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
1018     LIBGNAT_TARGET_PAIRS = \
1019     a-intnam.ads<4cintnam.ads \
1020     s-inmaop.adb<7sinmaop.adb \
1021     s-intman.adb<7sintman.adb \
1022     s-osinte.adb<7sosinte.adb \
1023     s-osinte.ads<5cosinte.ads \
1024     s-osprim.adb<7sosprim.adb \
1025     s-taprop.adb<7staprop.adb \
1026     s-taspri.ads<7staspri.ads \
1027     s-tpopsp.adb<7stpopsp.adb \
1028     g-soccon.ads<3bsoccon.ads \
1029     system.ads<5bsystem.ads
1030
1031     THREADSLIB = -lgthreads -lmalloc
1032   endif
1033
1034   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5bml-tgt.adb
1035   GMEM_LIB = gmemlib
1036   SYMLIB = $(ADDR2LINE_SYMLIB)
1037
1038 endif
1039
1040 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1041   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1042     LIBGNAT_TARGET_PAIRS = \
1043     a-numaux.adb<86numaux.adb \
1044     a-numaux.ads<86numaux.ads \
1045     a-intnam.ads<42intnam.ads \
1046     s-mastop.adb<5omastop.adb \
1047     s-inmaop.adb<7sinmaop.adb \
1048     s-intman.adb<7sintman.adb \
1049     s-osinte.adb<56osinte.adb \
1050     s-osinte.ads<56osinte.ads \
1051     s-osprim.adb<7sosprim.adb \
1052     s-taprop.adb<56taprop.adb \
1053     s-taspri.ads<56taspri.ads \
1054     s-tpopsp.adb<56tpopsp.adb \
1055     system.ads<58system.ads
1056
1057     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1058
1059   else
1060     LIBGNAT_TARGET_PAIRS = \
1061     a-intnam.ads<42intnam.ads \
1062     s-inmaop.adb<7sinmaop.adb \
1063     s-intman.adb<7sintman.adb \
1064     s-osinte.adb<52osinte.adb \
1065     s-osinte.ads<52osinte.ads \
1066     s-osprim.adb<7sosprim.adb \
1067     s-taprop.adb<7staprop.adb \
1068     s-taspri.ads<7staspri.ads \
1069     s-tpopsp.adb<7stpopsp.adb \
1070     system.ads<57system.ads
1071
1072     ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
1073       LIBGNAT_TARGET_PAIRS = \
1074       a-intnam.ads<42intnam.ads \
1075       s-inmaop.adb<7sinmaop.adb \
1076       s-intman.adb<7sintman.adb \
1077       s-osinte.adb<56osinte.adb \
1078       s-osinte.ads<56osinte.ads \
1079       s-osprim.adb<7sosprim.adb \
1080       s-taprop.adb<56taprop.adb \
1081       s-taspri.ads<56taspri.ads \
1082       s-tpopsp.adb<56tpopsp.adb \
1083       system.ads<57system.ads
1084     endif
1085
1086   endif
1087 endif
1088
1089 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1090   LIBGNAT_TARGET_PAIRS = \
1091   a-intnam.ads<4rintnam.ads \
1092   s-inmaop.adb<7sinmaop.adb \
1093   s-intman.adb<7sintman.adb \
1094   s-osinte.adb<5rosinte.adb \
1095   s-osinte.ads<5rosinte.ads \
1096   s-osprim.adb<7sosprim.adb \
1097   s-parame.adb<5rparame.adb \
1098   s-taprop.adb<7staprop.adb \
1099   s-taspri.ads<7staspri.ads \
1100   s-tpopsp.adb<5rtpopsp.adb
1101 endif
1102
1103 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1104   LIBGNAT_TARGET_PAIRS = \
1105   a-intnam.ads<4aintnam.ads \
1106   s-inmaop.adb<7sinmaop.adb \
1107   s-intman.adb<7sintman.adb \
1108   s-mastop.adb<5amastop.adb \
1109   s-osinte.adb<5aosinte.adb \
1110   s-osinte.ads<5aosinte.ads \
1111   s-osprim.adb<5posprim.adb \
1112   s-taprop.adb<5ataprop.adb \
1113   s-tasinf.ads<5atasinf.ads \
1114   s-taspri.ads<5ataspri.ads \
1115   s-tpopsp.adb<5atpopsp.adb \
1116   s-traceb.adb<7straceb.adb \
1117   g-soccon.ads<3asoccon.ads \
1118   system.ads<5asystem.ads
1119
1120   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5aml-tgt.adb
1121
1122   GMEM_LIB=gmemlib
1123   SYMLIB = $(ADDR2LINE_SYMLIB)
1124   THREADSLIB = -lpthread -lmach -lexc -lrt
1125   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1126   GNATLIB_SHARED = gnatlib-shared-default
1127   LIBRARY_VERSION := $(LIB_VERSION)
1128 endif
1129
1130 ifeq ($(strip $(filter-out alpha% ia64 dec vms% openvms% alphavms%,$(host))),)
1131
1132 soext  = .exe
1133 hyphen = _
1134
1135 .SUFFIXES: .sym
1136
1137 .o.sym: 
1138         @ gnu:[bin]vmssymvec $<
1139 endif
1140
1141 ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1142
1143 ifeq ($(strip $(filter-out ia64% hp vms% openvms%,$(targ))),)
1144   LIBGNAT_TARGET_PAIRS_AUX = \
1145   s-osinte.adb<5xosinte.adb \
1146   s-osinte.ads<5xosinte.ads \
1147   s-parame.ads<5vparame.ads
1148 else
1149 ifeq ($(strip $(filter-out alpha64% dec hp vms% openvms% alphavms%,$(targ))),)
1150   LIBGNAT_TARGET_PAIRS_AUX = \
1151   s-osinte.adb<5vosinte.adb \
1152   s-osinte.ads<5vosinte.ads \
1153   s-parame.ads<5vparame.ads
1154 else
1155 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1156   LIBGNAT_TARGET_PAIRS_AUX = \
1157   s-osinte.adb<5vosinte.adb \
1158   s-osinte.ads<5vosinte.ads \
1159   s-parame.ads<5xparame.ads
1160 else
1161   LIBGNAT_TARGET_PAIRS_AUX = \
1162   s-osinte.adb<5vosinte.adb \
1163   s-osinte.ads<5vosinte.ads \
1164   s-parame.ads<5vparame.ads
1165 endif
1166 endif
1167 endif
1168
1169   LIBGNAT_TARGET_PAIRS = \
1170   a-caldel.adb<4vcaldel.adb \
1171   a-calend.adb<4vcalend.adb \
1172   a-calend.ads<4vcalend.ads \
1173   a-excpol.adb<4wexcpol.adb \
1174   a-intnam.ads<4vintnam.ads \
1175   a-numaux.ads<4vnumaux.ads \
1176   g-expect.adb<3vexpect.adb \
1177   g-soccon.ads<3vsoccon.ads \
1178   g-socthi.ads<3vsocthi.ads \
1179   g-socthi.adb<3vsocthi.adb \
1180   g-trasym.adb<3vtrasym.adb \
1181   i-cstrea.adb<6vcstrea.adb \
1182   i-cpp.adb<6vcpp.adb \
1183   interfac.ads<6vinterf.ads \
1184   s-asthan.adb<5vasthan.adb \
1185   s-crtl.ads<5vcrtl.ads \
1186   s-inmaop.adb<5vinmaop.adb \
1187   s-interr.adb<5vinterr.adb \
1188   s-intman.adb<5vintman.adb \
1189   s-intman.ads<5vintman.ads \
1190   s-osprim.adb<5vosprim.adb \
1191   s-osprim.ads<5vosprim.ads \
1192   s-taprop.adb<5vtaprop.adb \
1193   s-taspri.ads<5vtaspri.ads \
1194   s-tpopsp.adb<7stpopsp.adb \
1195   s-tpopde.adb<5vtpopde.adb \
1196   s-tpopde.ads<5vtpopde.ads \
1197   s-traent.adb<5vtraent.adb \
1198   s-traent.ads<5vtraent.ads \
1199   s-vaflop.adb<5vvaflop.adb \
1200   system.ads<5xsystem.ads   \
1201   $(LIBGNAT_TARGET_PAIRS_AUX)
1202
1203   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5vml-tgt.adb
1204
1205   GNATLIB_SHARED=gnatlib-shared-vms
1206   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1207   EXTRA_LIBGNAT_OBJS=vmshandler.o
1208   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1209   EXTRA_GNATTOOLS = \
1210      ../../gnatlbr$(exeext) \
1211      ,,/../gnatsym$(exeext)
1212   # This command transforms (YYYYMMDD) into YY,MMDD
1213   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
1214   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1215   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1216 endif
1217
1218 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1219   LIBGNAT_TARGET_PAIRS = \
1220   a-calend.adb<4wcalend.adb \
1221   a-excpol.adb<4wexcpol.adb \
1222   a-intnam.ads<4wintnam.ads \
1223   a-numaux.adb<86numaux.adb \
1224   a-numaux.ads<86numaux.ads \
1225   s-gloloc.adb<5wgloloc.adb \
1226   s-inmaop.adb<5ninmaop.adb \
1227   s-interr.adb<5ginterr.adb \
1228   s-intman.adb<5wintman.adb \
1229   s-mastop.adb<5omastop.adb \
1230   s-memory.adb<5wmemory.adb \
1231   s-osinte.ads<5wosinte.ads \
1232   s-osprim.adb<5wosprim.adb \
1233   s-taprop.adb<5wtaprop.adb \
1234   s-taspri.ads<5wtaspri.ads \
1235   g-socthi.ads<3wsocthi.ads \
1236   g-socthi.adb<3wsocthi.adb \
1237   g-soccon.ads<3wsoccon.ads \
1238   g-soliop.ads<3wsoliop.ads \
1239   system.ads<5wsystem.ads
1240
1241   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5wml-tgt.adb
1242   MISCLIB = -lwsock32
1243   SYMLIB = $(ADDR2LINE_SYMLIB)
1244   GMEM_LIB = gmemlib
1245   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1246   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1247   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1248   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1249   soext = .dll
1250 # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT auto-import
1251 # support for array/record will be done.
1252   GNATLIB_SHARED = gnatlib-shared-win32
1253   LIBRARY_VERSION := $(LIB_VERSION)
1254 endif
1255
1256 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1257   LIBGNAT_TARGET_PAIRS = \
1258   a-intnam.ads<4lintnam.ads \
1259   s-inmaop.adb<7sinmaop.adb \
1260   s-intman.adb<7sintman.adb \
1261   s-osinte.ads<5iosinte.ads \
1262   s-osinte.adb<5iosinte.adb \
1263   s-osprim.adb<7sosprim.adb \
1264   s-taprop.adb<5itaprop.adb \
1265   s-tpopsp.adb<5atpopsp.adb \
1266   s-taspri.ads<5itaspri.ads \
1267   system.ads<55system.ads
1268
1269   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
1270   MISCLIB=
1271   THREADSLIB=-lpthread
1272   GNATLIB_SHARED=gnatlib-shared-dual
1273   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1274   LIBRARY_VERSION := $(LIB_VERSION)
1275 endif
1276
1277 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1278   LIBGNAT_TARGET_PAIRS = \
1279   a-intnam.ads<4lintnam.ads \
1280   a-numaux.adb<86numaux.adb \
1281   a-numaux.ads<86numaux.ads \
1282   s-inmaop.adb<7sinmaop.adb \
1283   s-intman.adb<7sintman.adb \
1284   s-osinte.ads<5iosinte.ads \
1285   s-osinte.adb<5iosinte.adb \
1286   s-osprim.adb<7sosprim.adb \
1287   s-taprop.adb<5itaprop.adb \
1288   s-tpopsp.adb<5atpopsp.adb \
1289   s-taspri.ads<5itaspri.ads \
1290   system.ads<5nsystem.ads
1291
1292   TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
1293   SYMLIB = $(ADDR2LINE_SYMLIB)
1294   THREADSLIB=-lpthread
1295   GNATLIB_SHARED=gnatlib-shared-dual
1296   GMEM_LIB = gmemlib
1297   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1298   LIBRARY_VERSION := $(LIB_VERSION)
1299
1300 endif
1301
1302 # The runtime library for gnat comprises two directories.  One contains the
1303 # Ada source files that the compiler (gnat1) needs -- these files are listed
1304 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1305 # corresponding .ali files for the parts written in Ada, libgnat.a for
1306 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1307 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1308 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1309 # go into the directory.  The pthreads emulation is built in the threads
1310 # subdirectory and copied.
1311 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1312   errno.c exit.c cal.c ctrl_c.c \
1313   raise.h raise.c sysdep.c types.h aux-io.c init.c \
1314   final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c \
1315   $(EXTRA_LIBGNAT_SRCS)
1316
1317 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
1318   raise.o sysdep.o aux-io.o init.o cal.o final.o \
1319   tracebak.o expect.o mkdir.o socket.o $(EXTRA_LIBGNAT_OBJS)
1320
1321 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1322 #  the library installation will change and there will be a
1323 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1324 #  from ADA_INCLUDE_SRCS.
1325
1326 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1327 # the following include file:
1328
1329 include $(fsrcdir)/Makefile.rtl
1330
1331 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1332   g-trasym.o memtrack.o
1333
1334 # Files which are suitable in no run time/hi integrity mode
1335
1336 COMPILABLE_HIE_SOURCES= \
1337  system.ads   \
1338  ada.ads      \
1339  gnat.ads     \
1340  g-souinf.ads \
1341  interfac.ads \
1342  i-c.ads      \
1343  s-stoele.ads \
1344  s-stoele.adb \
1345  s-maccod.ads \
1346  s-unstyp.ads \
1347  s-fatflt.ads \
1348  s-fatlfl.ads \
1349  s-fatllf.ads \
1350  s-fatsfl.ads \
1351  s-secsta.ads \
1352  s-secsta.adb \
1353  a-tags.ads   \
1354  a-tags.adb  \
1355  a-except.ads \
1356  a-except.adb $(EXTRA_HIE_SOURCES)
1357
1358 NON_COMPILABLE_HIE_SOURCES= \
1359  a-unccon.ads \
1360  a-uncdea.ads \
1361  s-fatgen.adb \
1362  s-fatgen.ads \
1363  unchconv.ads \
1364  s-atacco.ads \
1365  s-atacco.adb \
1366  unchdeal.ads
1367
1368
1369 HIE_SOURCES = $(NON_COMPILABLE_HIE_SOURCES) $(COMPILABLE_HIE_SOURCES)
1370
1371 # Object to generate for the HI run time
1372
1373 HIE_OBJS =  \
1374  system.o   \
1375  ada.o      \
1376  a-except.o \
1377  gnat.o     \
1378  g-souinf.o \
1379  interfac.o \
1380  i-c.o      \
1381  s-stoele.o \
1382  s-maccod.o \
1383  s-unstyp.o \
1384  s-fatflt.o \
1385  s-fatlfl.o \
1386  s-fatllf.o \
1387  s-secsta.o \
1388  a-tags.o $(EXTRA_HIE_OBJS)
1389
1390 # Files which are needed in ravenscar mode
1391
1392 COMPILABLE_RAVEN_SOURCES = \
1393 $(COMPILABLE_HIE_SOURCES) \
1394  s-parame.ads \
1395  s-parame.adb \
1396  s-purexc.ads \
1397  s-osinte.ads \
1398  s-osinte.adb \
1399  s-tasinf.ads \
1400  s-tasinf.adb \
1401  s-taspri.ads \
1402  s-taprop.ads \
1403  s-taprop.adb \
1404  s-taskin.ads \
1405  s-taskin.adb \
1406  s-interr.ads \
1407  s-interr.adb \
1408  a-interr.ads \
1409  a-interr.adb \
1410  a-intnam.ads \
1411  a-reatim.ads \
1412  a-reatim.adb \
1413  a-retide.ads \
1414  a-retide.adb \
1415  s-taprob.ads \
1416  s-taprob.adb \
1417  s-tposen.ads \
1418  s-tposen.adb \
1419  s-tasres.ads \
1420  s-tarest.ads \
1421  s-tarest.adb \
1422  a-sytaco.ads \
1423  a-sytaco.adb \
1424  a-taside.ads \
1425  a-taside.adb $(EXTRA_RAVEN_SOURCES)
1426
1427 NON_COMPILABLE_RAVEN_SOURCES= $(NON_COMPILABLE_HIE_SOURCES)
1428
1429 RAVEN_SOURCES = $(NON_COMPILABLE_RAVEN_SOURCES) $(COMPILABLE_RAVEN_SOURCES)
1430
1431 # Objects to generate for the ravenscar run time
1432
1433 RAVEN_OBJS = \
1434  $(HIE_OBJS) \
1435  s-parame.o  \
1436  s-purexc.o  \
1437  s-osinte.o  \
1438  s-tasinf.o  \
1439  s-taspri.o  \
1440  s-taprop.o  \
1441  s-taskin.o  \
1442  s-interr.o  \
1443  a-interr.o  \
1444  a-intnam.o  \
1445  a-reatim.o  \
1446  a-retide.o  \
1447  s-taprob.o  \
1448  s-tposen.o  \
1449  s-tasres.o  \
1450  s-tarest.o  \
1451  a-sytaco.o \
1452  a-taside.o $(EXTRA_RAVEN_OBJS)
1453
1454 # Default run time files
1455
1456 ADA_INCLUDE_SRCS =\
1457  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1458  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1459  sequenio.ads system.ads Makefile.prolog Makefile.generic \
1460  memtrack.adb \
1461  a-*.adb a-*.ads g-*.ad? i-*.ad? \
1462  s-[a-o]*.adb s-[p-z]*.adb \
1463  s-[a-o]*.ads s-[p-z]*.ads
1464
1465 LIBGNAT=../rts/libgnat.a 
1466 TOOLS_FLAGS_TO_PASS=            \
1467         "CC=$(CC)"              \
1468         "CFLAGS=$(CFLAGS)"      \
1469         "LDFLAGS=$(LDFLAGS)"    \
1470         "ADAFLAGS=$(ADAFLAGS)"  \
1471         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
1472         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
1473         "libsubdir=$(libsubdir)"        \
1474         "exeext=$(exeext)"      \
1475         "fsrcdir=$(fsrcdir)"    \
1476         "srcdir=$(fsrcdir)"     \
1477         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
1478         "GNATMAKE=$(GNATMAKE)"  \
1479         "GNATLINK=$(GNATLINK)"  \
1480         "GNATBIND=$(GNATBIND)"
1481
1482 # Build directory for the tools. Let's copy the target-dependent
1483 # sources using the same mechanism as for gnatlib. The other sources are 
1484 # accessed using the vpath directive below
1485
1486 ../stamp-tools:
1487         -$(RM) tools/*
1488         -$(RMDIR) tools
1489         -$(MKDIR) tools
1490         -(cd tools; $(LN_S) ../sdefault.adb .)
1491         -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
1492                   $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\
1493                   $(LN_S) $(fsrcdir)/$(word 2,$(subst <, ,$(PAIR))) \
1494                         tools/$(word 1,$(subst <, ,$(PAIR)));)
1495         touch ../stamp-tools
1496
1497 # when compiling the tools, the runtime has to be first on the path so that
1498 # it hides the runtime files lying with the rest of the sources
1499 ifeq ($(TOOLSCASE),native)
1500   vpath %.ads ../rts ../
1501   vpath %.adb ../rts ../
1502   vpath %.c   ../rts ../
1503   vpath %.h   ../rts ../
1504 endif
1505
1506 # in the cross tools case, everything is compiled with the native 
1507 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1508 ifeq ($(TOOLSCASE),cross)
1509   vpath %.ads ../
1510   vpath %.adb ../
1511   vpath %.c   ../
1512   vpath %.h   ../
1513 endif
1514
1515 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap 
1516 # reasons: gnatmake should be built with a recent compiler, a recent compiler
1517 # may not generate ALI files compatible with an old gnatmake so it is important
1518 # to be able to build gnatmake without a version of gnatmake around. Once 
1519 # everything has been compiled once, gnatmake can be recompiled with itself 
1520 # (see target gnattools1-re) 
1521 gnattools1: ../stamp-tools ../stamp-gnatlib
1522         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1523           TOOLSCASE=native \
1524           ../../gnatmake$(exeext) ../../gnatlink$(exeext) ../../gnatbl$(exeext)
1525
1526 # gnatmake/link can be built with recent gnatmake/link if they are available.
1527 # This is especially convenient for building cross tools or for rebuilding
1528 # the tools when the original bootstrap has already be done.
1529 gnattools1-re: ../stamp-tools
1530         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1531           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
1532
1533 # these tools are built with gnatmake & are common to native and cross
1534 gnattools2: ../stamp-tools
1535         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1536           TOOLSCASE=native \
1537           ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
1538           ../../gnatls$(exeext) ../../gnatprep$(exeext) \
1539           ../../gnatxref$(exeext) \
1540           ../../gnatfind$(exeext) ../../gnatname$(exeext) \
1541           ../../gnatclean$(exeext) \
1542           ../../gprcmd$(exeext)   ../../gpr2make$(exeext)
1543
1544 # These tools are only built for the native version.
1545 gnattools3: ../stamp-tools
1546 #       $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1547 #         TOOLSCASE=native top_builddir=../../.. \
1548 #         ../../gnatmem$(exeext) $(EXTRA_GNATTOOLS)
1549
1550 # those tools are only built for the cross version
1551 gnattools4: ../stamp-tools
1552         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1553           TOOLSCASE=cross top_buildir=../../.. \
1554            ../../vxaddr2line$(exeext)
1555
1556 ../../gnatchop$(exeext): ../stamp-tools
1557         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1558         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1559         $(GNATLINK) -v gnatchop -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1560                 $(TOOLS_LIBS)
1561
1562 ../../gnat$(exeext): ../stamp-tools
1563         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1564         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1565         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1566
1567 ../../gnatkr$(exeext): ../stamp-tools
1568         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1569         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1570         $(GNATLINK) -v gnatkr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1571
1572 ../../gnatls$(exeext): ../stamp-tools
1573         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1574         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1575         $(GNATLINK) -v gnatls -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1576
1577 ../../gnatname$(exeext): ../stamp-tools
1578         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1579         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1580         $(GNATLINK) -v gnatname -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1581                     $(TOOLS_LIBS)
1582
1583 ../../gpr2make$(exeext): ../stamp-tools
1584         $(GNATMAKE) -c $(ADA_INCLUDES) gpr2make --GCC="$(CC) $(ALL_ADAFLAGS)"
1585         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gpr2make 
1586         $(GNATLINK) -v gpr2make -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1587                     $(TOOLS_LIBS)
1588
1589 ../../gnatprep$(exeext): ../stamp-tools
1590         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1591         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1592         $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1593                     $(TOOLS_LIBS)
1594
1595 ../../gnatxref$(exeext): ../stamp-tools
1596         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1597         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1598         $(GNATLINK) -v gnatxref -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1599                     $(TOOLS_LIBS)
1600
1601 ../../gnatfind$(exeext): ../stamp-tools
1602         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1603         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1604         $(GNATLINK) -v gnatfind -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1605                     $(TOOLS_LIBS)
1606
1607 ../../gnatclean$(exeext): ../stamp-tools
1608         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1609         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1610         $(GNATLINK) -v gnatclean -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1611                     $(TOOLS_LIBS)
1612
1613 ../../gnatsym$(exeext): ../stamp-tools
1614         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1615         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1616         $(GNATLINK) -v gnatsym -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1617                     $(TOOLS_LIBS)
1618
1619 ../../gnatmem$(exeext): ../stamp-tools gmem.o $(SYMDEPS)
1620 ifeq ($(GMEM_LIB),gmemlib)
1621            $(GNATMAKE) -c $(ADA_INCLUDES) gnatmem --GCC="$(CC) $(ALL_ADAFLAGS)"
1622            $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmem 
1623            $(GNATLINK) -v gnatmem -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1624                     gmem.o $(SYMLIB) $(TOOLS_LIBS)
1625 endif 
1626
1627 ../../gnatdll$(exeext): ../stamp-tools
1628         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1629         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1630         $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1631                 $(TOOLS_LIBS)
1632
1633 ../../gprcmd$(exeext): ../stamp-tools
1634         $(GNATMAKE) -c $(ADA_INCLUDES) gprcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1635         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprcmd 
1636         $(GNATLINK) -v gprcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1637
1638 ../../vxaddr2line$(exeext): ../stamp-tools
1639         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1640         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1641         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(CLIB)
1642
1643 gnatmake-re: ../stamp-tools
1644         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1645         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1646         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1647         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1648                 --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1649
1650 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1651 # with the former version of gnatlink itself which cannot override itself.
1652 gnatlink-re: ../stamp-tools link.o
1653         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1654         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1655         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1656                     --GCC="$(CC) $(ADA_INCLUDES)" link.o $(TOOLS_LIBS)
1657         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1658   
1659 # Needs to be built with CC=gcc
1660 # Since the RTL should be built with the latest compiler, remove the
1661 #  stamp target in the parent directory whenever gnat1 is rebuilt
1662
1663 # Likewise for the tools
1664 ../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
1665         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1666               $(TOOLS_LIBS)
1667
1668 ../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
1669         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1670               $(TOOLS_LIBS)
1671
1672 ../../gnatbl$(exeext): gnatbl.o
1673         $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1674
1675 gnatbl.o: gnatbl.c adaint.h
1676         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
1677
1678 ../stamp-gnatlib:
1679         @if [ ! -f stamp-gnatlib ] ; \
1680         then \
1681           $(ECHO) You must first build the GNAT library: make gnatlib; \
1682           false; \
1683         else \
1684           true; \
1685         fi
1686
1687 install-gnatlib: ../stamp-gnatlib
1688 #       Create the directory before deleting it, in case the directory is
1689 #       a list of directories (as it may be on VMS). This ensures we are
1690 #       deleting the right one.
1691         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1692         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1693         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1694         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1695         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1696         $(RMDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1697         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1698         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1699         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1700         -$(INSTALL_DATA) rts/Makefile.prolog $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1701         -$(INSTALL_DATA) rts/Makefile.generic $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1702         for file in rts/*.ali; do \
1703             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1704         done
1705         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1706         -for file in rts/*$(arext);do \
1707             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1708         done
1709 #     Install the shared libraries, if any, using $(INSTALL) instead
1710 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1711 #     for shared libraries on some targets, e.g. on HP-UX where the x
1712 #     permission is required.
1713         for file in gnat gnarl; do \
1714            if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
1715               $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1716                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1717            fi; \
1718            if [ -f rts/lib$${file}$(soext) ]; then \
1719               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1720               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
1721            fi; \
1722         done
1723 # This copy must be done preserving the date on the original file.
1724         for file in rts/*.adb rts/*.ads; do \
1725             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1726         done
1727         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1728         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1729
1730 ../stamp-gnatlib2:
1731         $(RM) rts/s-*.ali
1732         $(RM) rts/s-*$(objext)
1733         $(RM) rts/a-*.ali
1734         $(RM) rts/a-*$(objext)
1735         $(RM) rts/*.ali
1736         $(RM) rts/*$(objext)
1737         $(RM) rts/*$(arext)
1738         $(RM) rts/*$(soext)
1739         touch ../stamp-gnatlib2
1740         $(RM) ../stamp-gnatlib
1741
1742 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1743 #       successive target commands. Although the Gnu make documentation
1744 #       implies this is true on all systems, I suspect it may not be, So care
1745 #       has been taken to allow a sed script to look for ";)" and substitue
1746 #       for ";" the appropriate character in the range of lines below
1747 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1748
1749 # GNULLI Begin ###########################################################
1750
1751 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1752         $(RMDIR) rts
1753         $(MKDIR) rts
1754         $(CHMOD) u+w rts
1755 # Copy target independent sources
1756         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1757           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1758 # Remove files to be replaced by target dependent sources
1759         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1760                         rts/$(word 1,$(subst <, ,$(PAIR))))
1761 # Copy new target dependent sources
1762         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1763                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1764                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1765         $(RM) ../stamp-gnatlib
1766         touch ../stamp-gnatlib1
1767
1768 # GNULLI End #############################################################
1769
1770 # Don't use semicolon separated shell commands that involve list expansions.
1771 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1772 # line lengths in excess of 256 characters.
1773 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1774 # is guaranteed to overflow the buffer.
1775
1776 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1777         $(MAKE) -C rts CC="../../xgcc -B../../" \
1778                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1779                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1780                 srcdir=$(fsrcdir) \
1781                 -f ../Makefile $(LIBGNAT_OBJS)
1782         $(MAKE) -C rts CC="../../xgcc -B../../" \
1783                 ADA_INCLUDES="" \
1784                 CFLAGS="$(GNATLIBCFLAGS)" \
1785                 ADAFLAGS="$(GNATLIBFLAGS)" \
1786                 srcdir=$(fsrcdir) \
1787                 -f ../Makefile \
1788                 $(GNATRTL_OBJS)
1789         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1790         $(AR) $(AR_FLAGS) rts/libgnat$(arext) \
1791            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1792         ifneq ($(PREFIX_OBJS),)
1793                 $(AR) $(AR_FLAGS) rts/libgccprefix$(arext) $(PREFIX_OBJS);
1794         endif
1795         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnat$(arext); else true; fi
1796         $(AR) $(AR_FLAGS) rts/libgnarl$(arext) \
1797            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1798         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnarl$(arext); else true; fi
1799         ifeq ($(GMEM_LIB),gmemlib)
1800                 $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o;
1801         endif
1802         $(CHMOD) a-wx rts/*.ali
1803         touch ../stamp-gnatlib
1804
1805 HIE_NONE_TARGET_PAIRS=\
1806  a-except.ads<1aexcept.ads \
1807  a-except.adb<1aexcept.adb \
1808  a-tags.ads<1atags.ads \
1809  a-tags.adb<1atags.adb \
1810  s-secsta.ads<1ssecsta.ads \
1811  s-secsta.adb<1ssecsta.adb \
1812  i-c.ads<1ic.ads $(EXTRA_HIE_NONE_TARGET_PAIRS)
1813
1814 # This target needs RTS_NAME, RTS_SRCS, RTS_TARGET_PAIRS to be set properly
1815 # it creates a rts with the proper structure and the right target 
1816 # dependant srcs
1817 prepare-rts:
1818         $(RMDIR) rts-$(RTS_NAME)
1819         $(MKDIR) rts-$(RTS_NAME)
1820         $(CHMOD) u+w rts-$(RTS_NAME)
1821         $(MKDIR) rts-$(RTS_NAME)/adalib
1822         $(MKDIR) rts-$(RTS_NAME)/adainclude
1823         $(CHMOD) u+w rts-$(RTS_NAME)/*
1824 # Generate the project file
1825         $(ECHO) "project $(RTS_NAME) is" > rts-$(RTS_NAME)/$(RTS_NAME).gpr
1826         $(ECHO) "   for Source_Dirs use (\"adainclude\");" \
1827                 >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
1828         $(ECHO) "   for Object_Dir use \"adalib\";" \
1829                 >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
1830         $(ECHO) "   for Source_List_File use " \
1831                 >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1832         $(ECHO) "      \"rts-$(RTS_NAME)_source_list.txt\";" \
1833                 >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1834         $(ECHO) "   package Builder is" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1835         $(ECHO) "     for Default_Switches (\"Ada\") use (\"-a\");" \
1836                  >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1837         $(ECHO) "  end Builder;" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1838         $(ECHO) "  package Compiler is" >> rts-$(RTS_NAME)/$(RTS_NAME).gpr
1839         $(ECHO) "     for Default_Switches (\"Ada\") use (\"-nostdinc\");" \
1840                  >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1841         $(ECHO) "  end Compiler;" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1842         $(ECHO) "end $(RTS_NAME);" >>rts-$(RTS_NAME)/$(RTS_NAME).gpr
1843
1844         $(foreach f, $(COMPILABLE_SOURCES), \
1845                 $(ECHO) $(f) >> \
1846                         rts-$(RTS_NAME)/rts-$(RTS_NAME)_source_list.txt ;) true
1847 # Copy target independent sources
1848         $(foreach f,$(RTS_SRCS), \
1849           $(CP) $(fsrcpfx)$(f) rts-$(RTS_NAME)/adainclude/ ;) true
1850 # Remove files to be replaced by target dependent sources
1851         $(RM) $(foreach PAIR,$(RTS_TARGET_PAIRS), \
1852                  rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR))))
1853 # Copy new target dependent sources
1854         $(foreach PAIR,$(RTS_TARGET_PAIRS), \
1855             $(CP) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1856                     rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR)));)
1857
1858 install-rts: force
1859         $(CP) -r rts-$(RTS_NAME) $(DESTDIR)$(libsubdir)/
1860
1861 rts-zfp: force
1862         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
1863            RTS_NAME=zfp RTS_SRCS="$(HIE_SOURCES)" \
1864            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
1865            COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" 
1866         -$(GNATMAKE) -Prts-zfp/zfp.gpr --GCC="../../../xgcc -B../../../"
1867         cd rts-zfp/adalib/ ; $(AR) r libgnat.a *.o
1868         $(RM) rts-zfp/adalib/*.o
1869         $(CHMOD) a-wx rts-zfp/adalib/*.ali
1870         $(CHMOD) a-wx rts-zfp/adalib/libgnat.a
1871
1872 rts-none: force
1873         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
1874            RTS_NAME=none RTS_SRCS="$(HIE_SOURCES)" \
1875            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
1876            COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)" 
1877         -$(GNATMAKE) -Prts-none/none.gpr --GCC="../../../xgcc -B../../../"
1878         $(RM) rts-none/adalib/*.o
1879         $(CHMOD) a-wx rts-none/adalib/*.ali
1880
1881 rts-ravenscar: force
1882         $(MAKE)  $(FLAGS_TO_PASS) prepare-rts \
1883            RTS_NAME=ravenscar RTS_SRCS="$(RAVEN_SOURCES)" \
1884            RTS_TARGET_PAIRS="$(HIE_RAVEN_TARGET_PAIRS)" \
1885            COMPILABLE_SOURCES="$(COMPILABLE_RAVEN_SOURCES)" 
1886         -$(GNATMAKE) -Prts-ravenscar/ravenscar.gpr \
1887            --GCC="../../../xgcc -B../../../"
1888         cd rts-ravenscar/adalib/ ; $(AR) r libgnat.a *.o
1889         $(RM) rts-ravenscar/adalib/*.o
1890         $(CHMOD) a-wx rts-ravenscar/adalib/*.ali
1891         $(CHMOD) a-wx rts-ravenscar/adalib/libgnat.a
1892
1893 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
1894 gnatlib-shared-default:
1895         $(MAKE) $(FLAGS_TO_PASS) \
1896              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1897              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1898              THREAD_KIND="$(THREAD_KIND)" \
1899              gnatlib
1900         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
1901         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1902                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1903                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1904                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1905                 $(MISCLIB) -lm
1906         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1907                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1908                 $(GNATRTL_TASKING_OBJS) \
1909                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1910                 $(THREADSLIB)
1911         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1912                 libgnat$(soext)
1913         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1914                 libgnarl$(soext)
1915
1916 gnatlib-shared-dual:
1917         $(MAKE) $(FLAGS_TO_PASS) \
1918              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1919              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1920              THREAD_KIND="$(THREAD_KIND)" \
1921              gnatlib-shared-default
1922         $(MV) rts/libgna*$(soext) .
1923         $(RM) ../stamp-gnatlib2
1924         $(MAKE) $(FLAGS_TO_PASS) \
1925              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1926              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1927              THREAD_KIND="$(THREAD_KIND)" \
1928              gnatlib
1929         $(MV) libgna*$(soext) rts
1930
1931 gnatlib-shared-dual-win32:
1932         $(MAKE) $(FLAGS_TO_PASS) \
1933              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1934              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1935              THREAD_KIND="$(THREAD_KIND)" \
1936              gnatlib-shared-win32
1937         $(MV) rts/libgna*$(soext) .
1938         $(RM) ../stamp-gnatlib2
1939         $(MAKE) $(FLAGS_TO_PASS) \
1940              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1941              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1942              THREAD_KIND="$(THREAD_KIND)" \
1943              gnatlib
1944         $(MV) libgna*$(soext) rts
1945
1946 # ??? we need to add the option to support auto-import of arrays/records to
1947 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
1948 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
1949 # Windows.
1950 gnatlib-shared-win32:
1951         $(MAKE) $(FLAGS_TO_PASS) \
1952              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1953              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1954              THREAD_KIND="$(THREAD_KIND)" \
1955              gnatlib
1956         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
1957         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1958                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1959                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1960                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
1961         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1962                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1963                 $(GNATRTL_TASKING_OBJS) \
1964                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1965                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
1966
1967 gnatlib-shared-vms:
1968         $(MAKE) $(FLAGS_TO_PASS) \
1969              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1970              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1971              THREAD_KIND="$(THREAD_KIND)" \
1972              gnatlib
1973         $(RM) rts/libgnat*$(soext) rts/libgnarl*$(soext)
1974         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1975         objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
1976         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1977         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1978         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1979            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
1980            sys\$$library:trace.exe \
1981            --for-linker=/noinform \
1982            --for-linker=SYMVEC_$$$$.opt \
1983            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1984         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1985         objdump --syms $(GNATRTL_TASKING_OBJS) | \
1986         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1987         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1988         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1989            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1990            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1991            sys\$$library:trace.exe \
1992            --for-linker=/noinform \
1993            --for-linker=SYMVEC_$$$$.opt \
1994            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1995
1996 gnatlib-shared:
1997         $(MAKE) $(FLAGS_TO_PASS) \
1998              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1999              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2000              THREAD_KIND="$(THREAD_KIND)" \
2001              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2002              $(GNATLIB_SHARED)
2003
2004 gnatlib-sjlj: ../stamp-gnatlib1
2005         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
2006         $(MV) rts/s.ads rts/system.ads
2007         $(MAKE) $(FLAGS_TO_PASS) \
2008              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2009              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2010              THREAD_KIND="$(THREAD_KIND)" \
2011              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2012
2013 # .s files for cross-building
2014 gnat-cross: force
2015         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2016
2017 # Compiling object files from source files.
2018
2019 # Note that dependencies on obstack.h are not written
2020 # because that file is not part of GCC.
2021 # Dependencies on gvarargs.h are not written
2022 # because all that file does, when not compiling with GCC,
2023 # is include the system varargs.h.
2024
2025 b_gnatl.c : $(GNATLINK_OBJS)
2026         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2027 b_gnatl.o : b_gnatl.c
2028
2029 b_gnatm.c : $(GNATMAKE_OBJS)
2030         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2031 b_gnatm.o : b_gnatm.c
2032
2033 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2034 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2035 ADA_SHARE_MAKE_DIR = $(prefix)/share/gnat
2036
2037 # force no sibling call optimization on s-traceb.o so the number of stack
2038 # frames to be skipped when computing a call chain is not modified by
2039 # optimization. However we can do that only when building the runtime
2040 # (not the compiler) because the -fno-optimize-sibling-calls exists
2041 # only in GCC 3.
2042
2043 ifneq (,$(findstring xgcc,$(CC)))
2044 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
2045 else
2046 NO_SIBLING_ADAFLAGS=
2047 endif
2048
2049 s-traceb.o  : s-traceb.adb
2050         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2051               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
2052               $< $(OUTPUT_OPTION)
2053
2054 adadecode.o : adadecode.c adadecode.h
2055 aux-io.o  : aux-io.c
2056 argv.o    : argv.c
2057 cal.o     : cal.c
2058 deftarg.o  : deftarg.c
2059 errno.o   : errno.c
2060 exit.o    : raise.h exit.c
2061 expect.o  : expect.c
2062 final.o   : raise.h final.c
2063 gmem.o    : gmem.c
2064 link.o    : link.c
2065 mkdir.o   : mkdir.c
2066 socket.o  : socket.c
2067 sysdep.o  : sysdep.c
2068
2069 cio.o     : cio.c 
2070         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2071                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2072
2073 init.o    : init.c ada.h types.h raise.h
2074         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2075                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2076
2077 raise.o   : raise.c raise.h
2078         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2079                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2080
2081 # Need to keep the frame pointer in this file to pop the stack properly on
2082 # some targets.
2083 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c
2084         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2085               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2086
2087 # In GNU Make, ignore whether `stage*' exists.
2088 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2089 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2090
2091 force:
2092
2093 # Gnatlbr is only used on VMS
2094
2095 ../../gnatlbr$(exeext): ../../prefix.o
2096         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2097         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2098         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
2099                 $(TOOLS_LIBS)