OSDN Git Service

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