OSDN Git Service

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