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