OSDN Git Service

2006-02-13 Arnaud Charlet <charlet@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   a-sytaco.ads<1asytaco.ads \
486   a-sytaco.adb<1asytaco.adb \
487   g-io.adb<g-io-vxworks-ppc-cert.adb \
488   g-io.ads<g-io-vxworks-ppc-cert.ads \
489   s-inmaop.adb<s-inmaop-posix.adb \
490   s-interr.adb<s-interr-vxworks.adb \
491   s-intman.ads<s-intman-vxworks.ads \
492   s-intman.adb<s-intman-vxworks.adb \
493   s-osinte.adb<s-osinte-vxworks.adb \
494   s-osinte.ads<s-osinte-vxworks.ads \
495   s-osprim.adb<s-osprim-vxworks.adb \
496   s-parame.ads<s-parame-ae653.ads \
497   s-parame.adb<s-parame-vxworks.adb \
498   s-taprop.adb<s-taprop-vxworks.adb \
499   s-taspri.ads<s-taspri-vxworks.ads \
500   s-tpopsp.adb<s-tpopsp-vxworks.adb \
501   s-vxwork.ads<s-vxwork-ppc.ads \
502   g-soccon.ads<g-soccon-vxworks.ads \
503   g-socthi.ads<g-socthi-vxworks.ads \
504   g-socthi.adb<g-socthi-vxworks.adb \
505   system.ads<system-vxworks-ppc-vthread.ads
506
507   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
508
509   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
510   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
511
512   # Extra pairs for the vthreads runtime
513   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
514     LIBGNAT_TARGET_PAIRS += \
515     s-thread.adb<s-thread-ae653.adb
516     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
517   endif
518
519   ifeq ($(strip $(filter-out yes,$(TRACE))),)
520     LIBGNAT_TARGET_PAIRS += \
521     s-traces.adb<s-traces-default.adb \
522     s-trafor.adb<s-trafor-default.adb \
523     s-trafor.ads<s-trafor-default.ads \
524     s-tratas.adb<s-tratas-default.adb \
525     s-tfsetr.adb<s-tfsetr-vxworks.adb
526   endif
527 endif
528
529 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
530   LIBGNAT_TARGET_PAIRS = \
531   a-intnam.ads<a-intnam-vxworks.ads \
532   a-numaux.ads<a-numaux-vxworks.ads \
533   s-inmaop.adb<s-inmaop-posix.adb \
534   s-interr.adb<s-interr-vxworks.adb \
535   s-intman.ads<s-intman-vxworks.ads \
536   s-intman.adb<s-intman-vxworks.adb \
537   s-osinte.adb<s-osinte-vxworks.adb \
538   s-osinte.ads<s-osinte-vxworks.ads \
539   s-osprim.adb<s-osprim-vxworks.adb \
540   s-parame.ads<s-parame-vxworks.ads \
541   s-parame.adb<s-parame-vxworks.adb \
542   s-stchop.adb<s-stchop-vxworks.adb \
543   s-taprop.adb<s-taprop-vxworks.adb \
544   s-taspri.ads<s-taspri-vxworks.ads \
545   s-tpopsp.adb<s-tpopsp-vxworks.adb \
546   s-vxwork.ads<s-vxwork-sparcv9.ads \
547   g-soccon.ads<g-soccon-vxworks.ads \
548   g-socthi.ads<g-socthi-vxworks.ads \
549   g-socthi.adb<g-socthi-vxworks.adb \
550   system.ads<system-vxworks-sparcv9.ads   \
551
552   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
553
554   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
555   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
556 endif
557
558 ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
559   LIBGNAT_TARGET_PAIRS = \
560   a-intnam.ads<a-intnam-vxworks.ads \
561   i-vxwork.ads<i-vxwork-x86.ads \
562   s-inmaop.adb<s-inmaop-posix.adb \
563   s-interr.adb<s-interr-vxworks.adb \
564   s-intman.ads<s-intman-vxworks.ads \
565   s-intman.adb<s-intman-vxworks.adb \
566   a-numaux.adb<a-numaux-x86.adb \
567   a-numaux.ads<a-numaux-x86.ads \
568   s-osinte.ads<s-osinte-vxworks.ads \
569   s-osprim.adb<s-osprim-vxworks.adb \
570   s-parame.ads<s-parame-vxworks.ads \
571   s-parame.adb<s-parame-vxworks.adb \
572   s-stchop.adb<s-stchop-vxworks.adb \
573   s-taprop.adb<s-taprop-vxworks.adb \
574   s-taspri.ads<s-taspri-vxworks.ads \
575   s-vxwork.ads<s-vxwork-x86.ads \
576   g-soccon.ads<g-soccon-vxworks.ads \
577   g-socthi.ads<g-socthi-vxworks.ads \
578   g-socthi.adb<g-socthi-vxworks.adb
579
580   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
581
582   ifeq ($(strip $(filter-out yes,$(TRACE))),)
583     LIBGNAT_TARGET_PAIRS += \
584     s-traces.adb<s-traces-default.adb \
585     s-trafor.adb<s-trafor-default.adb \
586     s-trafor.ads<s-trafor-default.ads \
587     s-tratas.adb<s-tratas-default.adb \
588     s-tfsetr.adb<s-tfsetr-vxworks.adb
589   endif
590
591   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
592     LIBGNAT_TARGET_PAIRS += \
593     s-osinte.adb<s-osinte-vxworks-rtp.adb \
594     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
595     system.ads<system-vxworks-x86-rtp.ads
596
597     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
598   else
599     LIBGNAT_TARGET_PAIRS += \
600     s-osinte.adb<s-osinte-vxworks.adb \
601     s-tpopsp.adb<s-tpopsp-vxworks.adb \
602     system.ads<system-vxworks-x86.ads
603
604     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
605   endif
606
607   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
608 endif
609
610 ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
611   LIBGNAT_TARGET_PAIRS = \
612   a-intnam.ads<a-intnam-vxworks.ads \
613   a-numaux.ads<a-numaux-vxworks.ads \
614   s-inmaop.adb<s-inmaop-posix.adb \
615   s-interr.adb<s-interr-vxworks.adb \
616   s-intman.ads<s-intman-vxworks.ads \
617   s-intman.adb<s-intman-vxworks.adb \
618   s-osinte.adb<s-osinte-vxworks.adb \
619   s-osinte.ads<s-osinte-vxworks.ads \
620   s-osprim.adb<s-osprim-vxworks.adb \
621   s-parame.ads<s-parame-vxworks.ads \
622   s-parame.adb<s-parame-vxworks.adb \
623   s-stchop.adb<s-stchop-vxworks.adb \
624   s-taprop.adb<s-taprop-vxworks.adb \
625   s-taspri.ads<s-taspri-vxworks.ads \
626   s-tpopsp.adb<s-tpopsp-vxworks.adb \
627   s-vxwork.ads<s-vxwork-arm.ads \
628   g-soccon.ads<g-soccon-vxworks.ads \
629   g-socthi.ads<g-socthi-vxworks.ads \
630   g-socthi.adb<g-socthi-vxworks.adb \
631   system.ads<system-vxworks-arm.ads
632
633   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
634
635   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
636   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
637 endif
638
639 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
640   LIBGNAT_TARGET_PAIRS = \
641   a-intnam.ads<a-intnam-vxworks.ads \
642   a-numaux.ads<a-numaux-vxworks.ads \
643   s-inmaop.adb<s-inmaop-posix.adb \
644   s-interr.adb<s-interr-vxworks.adb \
645   s-intman.ads<s-intman-vxworks.ads \
646   s-intman.adb<s-intman-vxworks.adb \
647   s-osinte.adb<s-osinte-vxworks.adb \
648   s-osinte.ads<s-osinte-vxworks.ads \
649   s-osprim.adb<s-osprim-vxworks.adb \
650   s-parame.ads<s-parame-vxworks.ads \
651   s-parame.adb<s-parame-vxworks.adb \
652   s-stchop.adb<s-stchop-vxworks.adb \
653   s-taprop.adb<s-taprop-vxworks.adb \
654   s-taspri.ads<s-taspri-vxworks.ads \
655   s-tpopsp.adb<s-tpopsp-vxworks.adb \
656   s-vxwork.ads<s-vxwork-mips.ads \
657   g-soccon.ads<g-soccon-vxworks.ads \
658   g-socthi.ads<g-socthi-vxworks.ads \
659   g-socthi.adb<g-socthi-vxworks.adb \
660   system.ads<system-vxworks-mips.ads
661
662   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
663
664   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
665   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
666 endif
667
668 ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
669   LIBGNAT_TARGET_PAIRS_32 = \
670   a-intnam.ads<a-intnam-solaris.ads \
671   s-inmaop.adb<s-inmaop-posix.adb \
672   s-intman.adb<s-intman-solaris.adb \
673   s-osinte.adb<s-osinte-solaris.adb \
674   s-osinte.ads<s-osinte-solaris.ads \
675   s-osprim.adb<s-osprim-solaris.adb \
676   s-taprop.adb<s-taprop-solaris.adb \
677   s-tasinf.adb<s-tasinf-solaris.adb \
678   s-tasinf.ads<s-tasinf-solaris.ads \
679   s-taspri.ads<s-taspri-solaris.ads \
680   s-tpopsp.adb<s-tpopsp-solaris.adb \
681   g-soccon.ads<g-soccon-solaris.ads \
682   g-soliop.ads<g-soliop-solaris.ads \
683   system.ads<system-solaris-sparc.ads
684
685   LIBGNAT_TARGET_PAIRS_64 = \
686   a-intnam.ads<a-intnam-solaris.ads \
687   s-inmaop.adb<s-inmaop-posix.adb \
688   s-intman.adb<s-intman-solaris.adb \
689   s-osinte.adb<s-osinte-solaris.adb \
690   s-osinte.ads<s-osinte-solaris.ads \
691   s-osprim.adb<s-osprim-solaris.adb \
692   s-taprop.adb<s-taprop-solaris.adb \
693   s-tasinf.adb<s-tasinf-solaris.adb \
694   s-tasinf.ads<s-tasinf-solaris.ads \
695   s-taspri.ads<s-taspri-solaris.ads \
696   s-tpopsp.adb<s-tpopsp-solaris.adb \
697   g-soccon.ads<g-soccon-solaris-64.ads \
698   g-soliop.ads<g-soliop-solaris.ads \
699   system.ads<system-solaris-sparcv9.ads
700
701   ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
702     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
703   else
704     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
705   endif
706   
707   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
708
709   EH_MECHANISM=-gcc
710   THREADSLIB = -lposix4 -lthread
711   MISCLIB = -lposix4 -lnsl -lsocket
712   SO_OPTS = -Wl,-h,
713   GNATLIB_SHARED = gnatlib-shared-dual
714   GMEM_LIB = gmemlib
715   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
716   LIBRARY_VERSION := $(LIB_VERSION)
717
718   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
719     LIBGNAT_TARGET_PAIRS = \
720     a-intnam.ads<a-intnam-solaris.ads \
721     s-inmaop.adb<s-inmaop-posix.adb \
722     s-intman.adb<s-intman-posix.adb \
723     s-osinte.adb<s-osinte-posix.adb \
724     s-osinte.ads<s-osinte-solaris-posix.ads \
725     s-osprim.adb<s-osprim-solaris.adb \
726     s-taprop.adb<s-taprop-posix.adb \
727     s-taspri.ads<s-taspri-posix.ads \
728     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
729     g-soccon.ads<g-soccon-solaris.ads \
730     g-soliop.ads<g-soliop-solaris.ads \
731     system.ads<system-solaris-sparc.ads
732
733     THREADSLIB = -lposix4 -lpthread
734   endif
735
736   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
737     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
738   endif
739 endif
740
741 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
742   LIBGNAT_TARGET_PAIRS = \
743   a-numaux.adb<a-numaux-x86.adb \
744   a-numaux.ads<a-numaux-x86.ads \
745   a-intnam.ads<a-intnam-solaris.ads \
746   s-inmaop.adb<s-inmaop-posix.adb \
747   s-intman.adb<s-intman-solaris.adb \
748   s-osinte.adb<s-osinte-solaris.adb \
749   s-osinte.ads<s-osinte-solaris.ads \
750   s-osprim.adb<s-osprim-solaris.adb \
751   s-taprop.adb<s-taprop-solaris.adb \
752   s-tasinf.adb<s-tasinf-solaris.adb \
753   s-tasinf.ads<s-tasinf-solaris.ads \
754   s-taspri.ads<s-taspri-solaris.ads \
755   s-tpopsp.adb<s-tpopsp-solaris.adb \
756   g-soccon.ads<g-soccon-solaris.ads \
757   g-soliop.ads<g-soliop-solaris.ads \
758   system.ads<system-solaris-x86.ads
759
760   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
761
762   THREADSLIB = -lposix4 -lthread
763   MISCLIB = -lposix4 -lnsl -lsocket
764   SO_OPTS = -Wl,-h,
765   GNATLIB_SHARED = gnatlib-shared-dual
766   GMEM_LIB = gmemlib
767   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
768   LIBRARY_VERSION := $(LIB_VERSION)
769 endif
770
771 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
772   LIBGNAT_TARGET_PAIRS = \
773   a-intnam.ads<a-intnam-linux.ads \
774   a-numaux.adb<a-numaux-x86.adb \
775   a-numaux.ads<a-numaux-x86.ads \
776   g-soccon.ads<g-soccon-linux-x86.ads \
777   s-inmaop.adb<s-inmaop-posix.adb \
778   s-intman.adb<s-intman-posix.adb \
779   s-osinte.adb<s-osinte-posix.adb \
780   s-osinte.ads<s-osinte-linux.ads \
781   s-osprim.adb<s-osprim-posix.adb \
782   s-taprop.adb<s-taprop-linux.adb \
783   s-taspri.ads<s-taspri-posix.ads \
784   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
785   system.ads<system-linux-x86.ads
786
787   TOOLS_TARGET_PAIRS =  \
788     mlib-tgt.adb<mlib-tgt-linux.adb \
789     indepsw.adb<indepsw-gnu.adb
790
791   EH_MECHANISM=-gcc
792   THREADSLIB = -lpthread
793   GNATLIB_SHARED = gnatlib-shared-dual
794   GMEM_LIB = gmemlib
795   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
796   LIBRARY_VERSION := $(LIB_VERSION)
797 endif
798
799 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
800   LIBGNAT_TARGET_PAIRS = \
801   a-intnam.ads<a-intnam-freebsd.ads \
802   a-numaux.adb<a-numaux-x86.adb \
803   a-numaux.ads<a-numaux-x86.ads \
804   g-soccon.ads<g-soccon-freebsd.ads \
805   s-inmaop.adb<s-inmaop-posix.adb \
806   s-intman.adb<s-intman-posix.adb \
807   s-osinte.adb<s-osinte-freebsd.adb \
808   s-osinte.ads<s-osinte-freebsd.ads \
809   s-osprim.adb<s-osprim-posix.adb \
810   s-taprop.adb<s-taprop-posix.adb \
811   s-taspri.ads<s-taspri-posix.ads \
812   s-tpopsp.adb<s-tpopsp-posix.adb \
813   system.ads<system-freebsd-x86.ads
814
815   TOOLS_TARGET_PAIRS = \
816   mlib-tgt.adb<mlib-tgt-linux.adb
817   GNATLIB_SHARED = gnatlib-shared-dual
818
819   THREADSLIB= -lc_r
820   GMEM_LIB = gmemlib
821   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
822   LIBRARY_VERSION := $(LIB_VERSION)
823 endif
824
825 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
826   ifeq ($(strip $(filter-out s390x,$(arch))),)
827     LIBGNAT_TARGET_PAIRS = \
828     a-intnam.ads<a-intnam-linux.ads \
829     s-inmaop.adb<s-inmaop-posix.adb \
830     s-intman.adb<s-intman-posix.adb \
831     s-osinte.adb<s-osinte-posix.adb \
832     s-osinte.ads<s-osinte-linux.ads \
833     s-osprim.adb<s-osprim-posix.adb \
834     s-taprop.adb<s-taprop-linux.adb \
835     s-taspri.ads<s-taspri-posix.ads \
836     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
837     system.ads<system-linux-s390x.ads
838   else
839     LIBGNAT_TARGET_PAIRS = \
840     a-intnam.ads<a-intnam-linux.ads \
841     s-inmaop.adb<s-inmaop-posix.adb \
842     s-intman.adb<s-intman-posix.adb \
843     s-osinte.adb<s-osinte-posix.adb \
844     s-osinte.ads<s-osinte-linux.ads \
845     s-osprim.adb<s-osprim-posix.adb \
846     s-taprop.adb<s-taprop-linux.adb \
847     s-taspri.ads<s-taspri-posix.ads \
848     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
849     system.ads<system-linux-s390.ads
850   endif
851
852   TOOLS_TARGET_PAIRS =  \
853     mlib-tgt.adb<mlib-tgt-linux.adb
854
855   EH_MECHANISM=-gcc
856   THREADSLIB = -lpthread
857   GNATLIB_SHARED = gnatlib-shared-dual
858   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
859   LIBRARY_VERSION := $(LIB_VERSION)
860 endif
861
862 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
863   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
864     LIBGNAT_TARGET_PAIRS = \
865     a-intnam.ads<a-intnam-irix.ads \
866     s-inmaop.adb<s-inmaop-posix.adb \
867     s-intman.adb<s-intman-irix.adb \
868     s-mastop.adb<s-mastop-irix.adb \
869     s-osinte.adb<s-osinte-irix.adb \
870     s-osinte.ads<s-osinte-irix.ads \
871     s-osprim.adb<s-osprim-posix.adb \
872     s-proinf.adb<s-proinf-irix-athread.adb \
873     s-proinf.ads<s-proinf-irix-athread.ads \
874     s-taprop.adb<s-taprop-irix.adb \
875     s-tasinf.ads<s-tasinf-irix.ads \
876     s-taspri.ads<s-taspri-posix.ads \
877     s-tpopsp.adb<s-tpopsp-posix.adb \
878     s-traceb.adb<s-traceb-mastop.adb \
879     g-soccon.ads<g-soccon-irix.ads \
880     system.ads<system-irix-n32.ads
881
882     THREADSLIB = -lpthread
883     GNATLIB_SHARED = gnatlib-shared-default
884
885   else
886     LIBGNAT_TARGET_PAIRS += \
887     s-mastop.adb<s-mastop-irix.adb \
888     s-osprim.adb<s-osprim-posix.adb \
889     s-traceb.adb<s-traceb-mastop.adb \
890     g-soccon.ads<g-soccon-irix.ads \
891     system.ads<system-irix-o32.ads
892   endif
893
894   EH_MECHANISM=-gcc
895   TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-irix.adb
896   TGT_LIB = -lexc
897   MISCLIB = -lexc
898   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
899   LIBRARY_VERSION := $(LIB_VERSION)
900 endif
901
902 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
903   LIBGNAT_TARGET_PAIRS = \
904   a-excpol.adb<a-excpol-abort.adb \
905   a-intnam.ads<a-intnam-hpux.ads \
906   s-inmaop.adb<s-inmaop-posix.adb \
907   s-interr.adb<s-interr-sigaction.adb \
908   s-intman.adb<s-intman-posix.adb \
909   s-osinte.adb<s-osinte-hpux-dce.adb \
910   s-osinte.ads<s-osinte-hpux-dce.ads \
911   s-parame.ads<s-parame-hpux.ads \
912   s-osprim.adb<s-osprim-posix.adb \
913   s-taprop.adb<s-taprop-hpux-dce.adb \
914   s-taspri.ads<s-taspri-hpux-dce.ads \
915   s-tpopsp.adb<s-tpopsp-posix.adb \
916   g-soccon.ads<g-soccon-hpux.ads \
917   system.ads<system-hpux.ads
918
919   EH_MECHANISM=-gcc
920   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
921 endif
922
923 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
924   LIBGNAT_TARGET_PAIRS = \
925   a-intnam.ads<a-intnam-hpux.ads \
926   s-inmaop.adb<s-inmaop-posix.adb \
927   s-intman.adb<s-intman-posix.adb \
928   s-osinte.adb<s-osinte-posix.adb \
929   s-osinte.ads<s-osinte-hpux.ads \
930   s-parame.ads<s-parame-hpux.ads \
931   s-osprim.adb<s-osprim-posix.adb \
932   s-traceb.adb<s-traceb-hpux.adb \
933   s-taprop.adb<s-taprop-posix.adb \
934   s-taspri.ads<s-taspri-posix.ads \
935   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
936   g-soccon.ads<g-soccon-hpux.ads \
937   system.ads<system-hpux.ads
938
939   TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-hpux.adb
940   EH_MECHANISM=-gcc
941   TGT_LIB = /usr/lib/libcl.a
942   THREADSLIB = -lpthread
943   GMEM_LIB = gmemlib
944   soext = .sl
945   SO_OPTS = -Wl,+h,
946   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
947   GNATLIB_SHARED = gnatlib-shared-dual
948   LIBRARY_VERSION := $(LIB_VERSION)
949 endif
950
951 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
952   LIBGNAT_TARGET_PAIRS = \
953   a-intnam.ads<a-intnam-aix.ads \
954   s-inmaop.adb<s-inmaop-posix.adb \
955   s-intman.adb<s-intman-posix.adb \
956   s-osinte.adb<s-osinte-aix.adb \
957   s-osinte.ads<s-osinte-aix.ads \
958   s-osprim.adb<s-osprim-posix.adb \
959   s-taprop.adb<s-taprop-posix.adb \
960   s-taspri.ads<s-taspri-posix.ads \
961   s-tpopsp.adb<s-tpopsp-posix.adb \
962   g-soccon.ads<g-soccon-aix.ads \
963   system.ads<system-aix.ads
964
965   THREADSLIB = -lpthreads
966   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
967
968   TOOLS_TARGET_PAIRS = \
969   mlib-tgt.adb<mlib-tgt-aix.adb \
970   indepsw.adb<indepsw-aix.adb
971
972   GMEM_LIB = gmemlib
973 endif
974
975 ifeq ($(strip $(filter-out lynxos,$(osys))),)
976   TOOLS_TARGET_PAIRS = \
977   mlib-tgt.adb<mlib-tgt-lynxos.adb \
978   indepsw.adb<indepsw-gnu.adb
979
980   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
981     LIBGNAT_TARGET_PAIRS = \
982     a-numaux.adb<a-numaux-x86.adb \
983     a-numaux.ads<a-numaux-x86.ads \
984     a-intnam.ads<a-intnam-lynxos.ads \
985     s-inmaop.adb<s-inmaop-posix.adb \
986     s-intman.adb<s-intman-posix.adb \
987     s-osinte.adb<s-osinte-lynxos.adb \
988     s-osinte.ads<s-osinte-lynxos.ads \
989     s-osprim.adb<s-osprim-posix.adb \
990     s-taprop.adb<s-taprop-lynxos.adb \
991     s-taspri.ads<s-taspri-lynxos.ads \
992     s-tpopsp.adb<s-tpopsp-lynxos.adb \
993     system.ads<system-lynxos-x86.ads
994
995     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
996
997   else
998     LIBGNAT_TARGET_PAIRS = \
999     a-intnam.ads<a-intnam-lynxos.ads \
1000     s-inmaop.adb<s-inmaop-posix.adb \
1001     s-intman.adb<s-intman-posix.adb \
1002     s-osinte.adb<s-osinte-lynxos.adb \
1003     s-osinte.ads<s-osinte-lynxos.ads \
1004     s-osprim.adb<s-osprim-posix.adb \
1005     s-taprop.adb<s-taprop-lynxos.adb \
1006     s-taspri.ads<s-taspri-lynxos.ads \
1007     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1008     system.ads<system-lynxos-ppc.ads
1009   endif
1010 endif
1011
1012 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1013   LIBGNAT_TARGET_PAIRS = \
1014   a-intnam.ads<a-intnam-rtems.ads \
1015   s-inmaop.adb<s-inmaop-posix.adb \
1016   s-intman.adb<s-intman-posix.adb \
1017   s-osinte.adb<s-osinte-rtems.adb \
1018   s-osinte.ads<s-osinte-rtems.ads \
1019   s-osprim.adb<s-osprim-posix.adb \
1020   s-parame.adb<s-parame-rtems.adb \
1021   s-taprop.adb<s-taprop-posix.adb \
1022   s-taspri.ads<s-taspri-posix.ads \
1023   s-auxdec.ads<s-auxdec-empty.ads \
1024   s-auxdec.adb<s-auxdec-empty.adb \
1025   s-tpopsp.adb<s-tpopsp-rtems.adb
1026 endif
1027
1028 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1029   LIBGNAT_TARGET_PAIRS = \
1030   a-intnam.ads<a-intnam-tru64.ads \
1031   s-inmaop.adb<s-inmaop-posix.adb \
1032   s-intman.adb<s-intman-posix.adb \
1033   s-mastop.adb<s-mastop-tru64.adb \
1034   s-osinte.adb<s-osinte-tru64.adb \
1035   s-osinte.ads<s-osinte-tru64.ads \
1036   s-osprim.adb<s-osprim-unix.adb \
1037   s-taprop.adb<s-taprop-tru64.adb \
1038   s-tasinf.ads<s-tasinf-tru64.ads \
1039   s-taspri.ads<s-taspri-tru64.ads \
1040   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1041   s-traceb.adb<s-traceb-mastop.adb \
1042   g-soccon.ads<g-soccon-tru64.ads \
1043   system.ads<system-tru64.ads
1044
1045   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-tru64.adb
1046
1047   EH_MECHANISM=-gcc
1048   GMEM_LIB=gmemlib
1049   THREADSLIB = -lpthread -lmach -lexc -lrt
1050   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1051   GNATLIB_SHARED = gnatlib-shared-default
1052   LIBRARY_VERSION := $(LIB_VERSION)
1053 endif
1054
1055 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
1056
1057 soext  = .exe
1058 hyphen = _
1059 LN = cp -p
1060 LN_S = cp -p
1061
1062 .SUFFIXES: .sym
1063
1064 .o.sym: 
1065         @ gnu:[bin]vmssymvec $<
1066 endif
1067
1068 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1069 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1070   LIBGNAT_TARGET_PAIRS_AUX1 = \
1071   g-enblsp.adb<g-enblsp-vms-ia64.adb \
1072   g-trasym.adb<g-trasym-vms-ia64.adb \
1073   s-auxdec.ads<s-auxdec-vms_64.ads \
1074   s-crtl.ads<s-crtl-vms64.ads \
1075   s-osinte.adb<s-osinte-vms-ia64.adb \
1076   s-osinte.ads<s-osinte-vms-ia64.ads \
1077   s-vaflop.adb<s-vaflop-vms-ia64.adb \
1078   system.ads<system-vms_64.ads
1079
1080   LIBGNAT_TARGET_PAIRS_AUX2 = \
1081   s-parame.ads<s-parame-vms-ia64.ads
1082 else
1083 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1084   LIBGNAT_TARGET_PAIRS_AUX1 = \
1085   g-enblsp.adb<g-enblsp-vms-alpha.adb \
1086   g-trasym.adb<g-trasym-vms-alpha.adb \
1087   s-asthan.adb<s-asthan-vms-alpha.adb \
1088   s-auxdec.ads<s-auxdec-vms_64.ads \
1089   s-crtl.ads<s-crtl-vms64.ads \
1090   s-osinte.adb<s-osinte-vms.adb \
1091   s-osinte.ads<s-osinte-vms.ads \
1092   s-vaflop.adb<s-vaflop-vms-alpha.adb \
1093   system.ads<system-vms_64.ads
1094
1095 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1096   LIBGNAT_TARGET_PAIRS_AUX2 = \
1097   s-parame.ads<s-parame-vms-restrict.ads
1098 else
1099   LIBGNAT_TARGET_PAIRS_AUX2 = \
1100   s-parame.ads<s-parame-vms-alpha.ads
1101 endif
1102 endif
1103 endif
1104
1105   LIBGNAT_TARGET_PAIRS = \
1106   a-caldel.adb<a-caldel-vms.adb \
1107   a-calend.adb<a-calend-vms.adb \
1108   a-calend.ads<a-calend-vms.ads \
1109   a-dirval.adb<a-dirval-vms.adb \
1110   a-excpol.adb<a-excpol-abort.adb \
1111   a-intnam.ads<a-intnam-vms.ads \
1112   a-numaux.ads<a-numaux-vms.ads \
1113   g-expect.adb<g-expect-vms.adb \
1114   g-soccon.ads<g-soccon-vms.ads \
1115   g-socthi.ads<g-socthi-vms.ads \
1116   g-socthi.adb<g-socthi-vms.adb \
1117   i-cstrea.adb<i-cstrea-vms.adb \
1118   s-inmaop.adb<s-inmaop-vms.adb \
1119   s-interr.adb<s-interr-vms.adb \
1120   s-intman.adb<s-intman-vms.adb \
1121   s-intman.ads<s-intman-vms.ads \
1122   s-osprim.adb<s-osprim-vms.adb \
1123   s-osprim.ads<s-osprim-vms.ads \
1124   s-taprop.adb<s-taprop-vms.adb \
1125   s-taspri.ads<s-taspri-vms.ads \
1126   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1127   s-tpopde.adb<s-tpopde-vms.adb \
1128   s-tpopde.ads<s-tpopde-vms.ads \
1129   s-traent.adb<s-traent-vms.adb \
1130   s-traent.ads<s-traent-vms.ads \
1131   $(LIBGNAT_TARGET_PAIRS_AUX1) \
1132   $(LIBGNAT_TARGET_PAIRS_AUX2)
1133
1134 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1135   TOOLS_TARGET_PAIRS= \
1136   mlib-tgt.adb<mlib-tgt-vms-ia64.adb \
1137   symbols.adb<symbols-vms.adb \
1138   symbols-processing.adb<symbols-processing-vms-ia64.adb
1139 else
1140   TOOLS_TARGET_PAIRS= \
1141   mlib-tgt.adb<mlib-tgt-vms-alpha.adb \
1142   symbols.adb<symbols-vms.adb \
1143   symbols-processing.adb<symbols-processing-vms-alpha.adb
1144 endif
1145
1146
1147   GMEM_LIB = gmemlib
1148   EH_MECHANISM=-gcc
1149   GNATLIB_SHARED=gnatlib-shared-vms
1150 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1151   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1152   EXTRA_LIBGNAT_OBJS=vmshandler.o
1153 endif
1154   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1155   EXTRA_GNATTOOLS = \
1156      ../../gnatlbr$(exeext)  \
1157      ../../gnatsym$(exeext)  \
1158      ../../vms_help$(exeext) \
1159      ../../gnat.hlp
1160   # This command transforms (YYYYMMDD) into YY,MMDD
1161   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
1162   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1163   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1164 endif
1165
1166 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1167   LIBGNAT_TARGET_PAIRS = \
1168   a-calend.adb<a-calend-mingw.adb \
1169   a-dirval.adb<a-dirval-mingw.adb \
1170   a-excpol.adb<a-excpol-abort.adb \
1171   a-intnam.ads<a-intnam-mingw.ads \
1172   a-numaux.adb<a-numaux-x86.adb \
1173   a-numaux.ads<a-numaux-x86.ads \
1174   s-gloloc.adb<s-gloloc-mingw.adb \
1175   s-inmaop.adb<s-inmaop-dummy.adb \
1176   s-interr.adb<s-interr-sigaction.adb \
1177   s-intman.adb<s-intman-mingw.adb \
1178   s-memory.adb<s-memory-mingw.adb \
1179   s-osinte.ads<s-osinte-mingw.ads \
1180   s-osprim.adb<s-osprim-mingw.adb \
1181   s-taprop.adb<s-taprop-mingw.adb \
1182   s-taspri.ads<s-taspri-mingw.ads \
1183   g-socthi.ads<g-socthi-mingw.ads \
1184   g-socthi.adb<g-socthi-mingw.adb \
1185   g-soccon.ads<g-soccon-mingw.ads \
1186   g-soliop.ads<g-soliop-mingw.ads \
1187   system.ads<system-mingw.ads
1188
1189   TOOLS_TARGET_PAIRS= \
1190   mlib-tgt.adb<mlib-tgt-mingw.adb \
1191   indepsw.adb<indepsw-mingw.adb
1192
1193   MISCLIB = -lwsock32
1194   GMEM_LIB = gmemlib
1195   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1196   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1197   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1198   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1199   soext = .dll
1200 # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT auto-import
1201 # support for array/record will be done.
1202   GNATLIB_SHARED = gnatlib-shared-win32
1203   LIBRARY_VERSION := $(LIB_VERSION)
1204 endif
1205
1206 ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
1207   LIBGNAT_TARGET_PAIRS = \
1208   a-intnam.ads<a-intnam-linux.ads \
1209   g-soccon.ads<g-soccon-linux-ppc.ads \
1210   s-inmaop.adb<s-inmaop-posix.adb \
1211   s-intman.adb<s-intman-posix.adb \
1212   s-osinte.adb<s-osinte-posix.adb \
1213   s-osinte.ads<s-osinte-linux.ads \
1214   s-osprim.adb<s-osprim-posix.adb \
1215   s-taprop.adb<s-taprop-linux.adb \
1216   s-taspri.ads<s-taspri-posix.ads \
1217   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1218   system.ads<system-linux-ppc.ads
1219
1220   TOOLS_TARGET_PAIRS =  \
1221     mlib-tgt.adb<mlib-tgt-linux.adb \
1222     indepsw.adb<indepsw-gnu.adb
1223
1224   EH_MECHANISM=-gcc
1225   THREADSLIB = -lpthread
1226   GNATLIB_SHARED = gnatlib-shared-dual
1227   GMEM_LIB = gmemlib
1228   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1229   LIBRARY_VERSION := $(LIB_VERSION)
1230 endif
1231
1232 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
1233   LIBGNAT_TARGET_PAIRS = \
1234   a-intnam.ads<a-intnam-linux.ads \
1235   s-inmaop.adb<s-inmaop-posix.adb \
1236   s-intman.adb<s-intman-posix.adb \
1237   s-osinte.adb<s-osinte-posix.adb \
1238   s-osinte.ads<s-osinte-linux.ads \
1239   s-osprim.adb<s-osprim-posix.adb \
1240   s-taprop.adb<s-taprop-linux.adb \
1241   s-taspri.ads<s-taspri-posix.ads \
1242   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1243   system.ads<system-linux-sparc.ads
1244
1245   TOOLS_TARGET_PAIRS =  \
1246     mlib-tgt.adb<mlib-tgt-linux.adb \
1247     indepsw.adb<indepsw-gnu.adb
1248
1249   EH_MECHANISM=-gcc
1250   THREADSLIB = -lpthread
1251   GNATLIB_SHARED = gnatlib-shared-dual
1252   GMEM_LIB = gmemlib
1253   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1254   LIBRARY_VERSION := $(LIB_VERSION)
1255 endif
1256
1257 ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
1258   LIBGNAT_TARGET_PAIRS = \
1259   a-intnam.ads<a-intnam-linux.ads \
1260   s-inmaop.adb<s-inmaop-posix.adb \
1261   s-intman.adb<s-intman-posix.adb \
1262   s-osinte.adb<s-osinte-posix.adb \
1263   s-osinte.ads<s-osinte-linux-hppa.ads \
1264   s-osprim.adb<s-osprim-posix.adb \
1265   s-taprop.adb<s-taprop-linux.adb \
1266   s-taspri.ads<s-taspri-posix.ads \
1267   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1268   system.ads<system-linux-hppa.ads
1269
1270   TOOLS_TARGET_PAIRS =  \
1271     mlib-tgt.adb<mlib-tgt-linux.adb \
1272     indepsw.adb<indepsw-gnu.adb
1273
1274   EH_MECHANISM=-gcc
1275   THREADSLIB = -lpthread
1276   GNATLIB_SHARED = gnatlib-shared-dual
1277   GMEM_LIB = gmemlib
1278   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1279   LIBRARY_VERSION := $(LIB_VERSION)
1280 endif
1281
1282 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1283   LIBGNAT_TARGET_PAIRS = \
1284   a-intnam.ads<a-intnam-linux.ads \
1285   a-numaux.ads<a-numaux-libc-x86.ads \
1286   g-soccon.ads<g-soccon-linux-64.ads \
1287   s-inmaop.adb<s-inmaop-posix.adb \
1288   s-intman.adb<s-intman-posix.adb \
1289   s-osinte.ads<s-osinte-linux.ads \
1290   s-osinte.adb<s-osinte-posix.adb \
1291   s-osprim.adb<s-osprim-posix.adb \
1292   s-taprop.adb<s-taprop-linux.adb \
1293   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1294   s-taspri.ads<s-taspri-posix.ads \
1295   system.ads<system-linux-ia64.ads
1296
1297   TOOLS_TARGET_PAIRS =  \
1298     mlib-tgt.adb<mlib-tgt-linux.adb \
1299     indepsw.adb<indepsw-gnu.adb
1300
1301   EH_MECHANISM=-gcc
1302   MISCLIB=
1303   THREADSLIB=-lpthread
1304   GNATLIB_SHARED=gnatlib-shared-dual
1305   GMEM_LIB = gmemlib
1306   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1307   LIBRARY_VERSION := $(LIB_VERSION)
1308 endif
1309
1310 ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
1311   LIBGNAT_TARGET_PAIRS = \
1312   a-intnam.ads<a-intnam-linux.ads \
1313   s-inmaop.adb<s-inmaop-posix.adb \
1314   s-intman.adb<s-intman-posix.adb \
1315   s-osinte.ads<s-osinte-linux-alpha.ads \
1316   s-osinte.adb<s-osinte-posix.adb \
1317   s-osprim.adb<s-osprim-posix.adb \
1318   s-taprop.adb<s-taprop-linux.adb \
1319   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1320   s-taspri.ads<s-taspri-posix.ads \
1321   system.ads<system-linux-alpha.ads
1322
1323   TOOLS_TARGET_PAIRS =  \
1324     mlib-tgt.adb<mlib-tgt-linux.adb \
1325     indepsw.adb<indepsw-gnu.adb
1326
1327   EH_MECHANISM=-gcc
1328   MISCLIB=
1329   THREADSLIB=-lpthread
1330   GNATLIB_SHARED=gnatlib-shared-dual
1331   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1332   LIBRARY_VERSION := $(LIB_VERSION)
1333 endif
1334
1335 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1336   LIBGNAT_TARGET_PAIRS = \
1337   a-intnam.ads<a-intnam-linux.ads \
1338   a-numaux.adb<a-numaux-x86.adb \
1339   a-numaux.ads<a-numaux-x86.ads \
1340   g-soccon.ads<g-soccon-linux-64.ads \
1341   s-inmaop.adb<s-inmaop-posix.adb \
1342   s-intman.adb<s-intman-posix.adb \
1343   s-osinte.ads<s-osinte-linux.ads \
1344   s-osinte.adb<s-osinte-posix.adb \
1345   s-osprim.adb<s-osprim-posix.adb \
1346   s-taprop.adb<s-taprop-linux.adb \
1347   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1348   s-taspri.ads<s-taspri-posix.ads \
1349   system.ads<system-linux-x86_64.ads
1350
1351   TOOLS_TARGET_PAIRS =  \
1352     mlib-tgt.adb<mlib-tgt-linux.adb \
1353     indepsw.adb<indepsw-gnu.adb
1354
1355   EH_MECHANISM=-gcc
1356   THREADSLIB=-lpthread
1357   GNATLIB_SHARED=gnatlib-shared-dual
1358   GMEM_LIB = gmemlib
1359   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1360   LIBRARY_VERSION := $(LIB_VERSION)
1361 endif
1362
1363 ifeq ($(strip $(filter-out powerpc darwin%,$(arch) $(osys))),)
1364   LIBGNAT_TARGET_PAIRS = \
1365   a-intnam.ads<a-intnam-darwin.ads \
1366   s-inmaop.adb<s-inmaop-posix.adb \
1367   s-intman.adb<s-intman-posix.adb \
1368   s-osinte.adb<s-osinte-darwin.adb \
1369   s-osinte.ads<s-osinte-darwin.ads \
1370   s-osprim.adb<s-osprim-posix.adb \
1371   s-taprop.adb<s-taprop-posix.adb \
1372   s-taspri.ads<s-taspri-posix.ads \
1373   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1374   g-soccon.ads<g-soccon-darwin.ads \
1375   a-numaux.ads<a-numaux-darwin.ads \
1376   a-numaux.adb<a-numaux-darwin.adb \
1377   system.ads<system-darwin-ppc.ads
1378
1379   TOOLS_TARGET_PAIRS =  \
1380     mlib-tgt.adb<mlib-tgt-darwin.adb
1381
1382   EH_MECHANISM=-gcc
1383   GNATLIB_SHARED = gnatlib-shared-darwin
1384   SO_OPTS = -Wl,-flat_namespace -shared-libgcc
1385   RANLIB = ranlib -c
1386   GMEM_LIB = gmemlib
1387   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1388   LIBRARY_VERSION := $(LIB_VERSION)
1389   soext = .dylib
1390 endif
1391
1392 ifneq ($(EH_MECHANISM),)
1393   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
1394   EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
1395   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
1396 endif
1397
1398 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
1399 # explicitely already. The base files (a-except.ad?) are used only for building
1400 # the compiler and other basic tools.
1401 # These base versions lack Ada 2005 additions which would cause bootstrap
1402 # problems if included in the compiler and other basic tools.
1403
1404 ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
1405   LIBGNAT_TARGET_PAIRS += \
1406     a-except.ads<a-except-2005.ads \
1407     a-except.adb<a-except-2005.adb
1408 endif
1409
1410 # The runtime library for gnat comprises two directories.  One contains the
1411 # Ada source files that the compiler (gnat1) needs -- these files are listed
1412 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1413 # corresponding .ali files for the parts written in Ada, libgnat.a for
1414 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1415 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1416 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1417 # go into the directory.  The pthreads emulation is built in the threads
1418 # subdirectory and copied.
1419 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1420   errno.c exit.c cal.c ctrl_c.c env.c env.h \
1421   raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
1422   final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
1423   socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
1424
1425 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
1426   raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o \
1427   final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
1428
1429 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1430 #  the library installation will change and there will be a
1431 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1432 #  from ADA_INCLUDE_SRCS.
1433
1434 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1435 # the following include file:
1436
1437 include $(fsrcdir)/Makefile.rtl
1438
1439 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1440   g-trasym.o memtrack.o
1441
1442 # Default run time files
1443
1444 ADA_INCLUDE_SRCS =\
1445  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1446  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1447  sequenio.ads system.ads memtrack.adb \
1448  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
1449  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads  
1450
1451 LIBGNAT=../rts/libgnat.a 
1452 GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
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
1473 ../../gnatchop$(exeext): 
1474         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1475         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1476         $(GNATLINK) -v gnatchop -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1477
1478 ../../gnat$(exeext): 
1479         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1480         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1481         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1482
1483 ../../gnatkr$(exeext): 
1484         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1485         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1486         $(GNATLINK) -v gnatkr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1487
1488 ../../gnatls$(exeext): 
1489         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1490         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1491         $(GNATLINK) -v gnatls -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1492
1493 ../../gnatname$(exeext): 
1494         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1495         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1496         $(GNATLINK) -v gnatname -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1497
1498 ../../gprmake$(exeext): 
1499         $(GNATMAKE) -c $(ADA_INCLUDES) gprmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1500         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprmake
1501         $(GNATLINK) -v gprmake -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1502
1503 ../../gnatprep$(exeext): 
1504         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1505         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1506         $(GNATLINK) -v gnatprep -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1507
1508 ../../gnatxref$(exeext): 
1509         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1510         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1511         $(GNATLINK) -v gnatxref -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1512
1513 ../../gnatfind$(exeext): 
1514         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1515         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1516         $(GNATLINK) -v gnatfind -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1517
1518 ../../gnatclean$(exeext): 
1519         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1520         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1521         $(GNATLINK) -v gnatclean -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1522
1523 ../../gnatsym$(exeext): 
1524         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1525         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1526         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1527
1528 ../../gnatdll$(exeext): 
1529         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1530         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1531         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1532
1533 ../../vxaddr2line$(exeext): targext.o
1534         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1535         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1536         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
1537
1538 gnatmake-re:  link.o targext.o
1539         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1540         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1541         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1542         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1543                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1544
1545 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1546 # with the former version of gnatlink itself which cannot override itself.
1547 gnatlink-re:  link.o targext.o
1548         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1549         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1550         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1551                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1552         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1553   
1554 # Needs to be built with CC=gcc
1555 # Since the RTL should be built with the latest compiler, remove the
1556 #  stamp target in the parent directory whenever gnat1 is rebuilt
1557
1558 # Likewise for the tools
1559 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
1560         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1561                     $(TOOLS_LIBS)
1562
1563 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
1564         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1565                     $(TOOLS_LIBS)
1566
1567 ../../gnatbl$(exeext): gnatbl.o
1568         $(GCC_LINK) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1569
1570 gnatbl.o: gnatbl.c adaint.h
1571         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
1572
1573 ../stamp-gnatlib:
1574         @if [ ! -f stamp-gnatlib ] ; \
1575         then \
1576           $(ECHO) You must first build the GNAT library: make gnatlib; \
1577           false; \
1578         else \
1579           true; \
1580         fi
1581
1582 install-gnatlib: ../stamp-gnatlib
1583 #       Create the directory before deleting it, in case the directory is
1584 #       a list of directories (as it may be on VMS). This ensures we are
1585 #       deleting the right one.
1586         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1587         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1588         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1589         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1590         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1591         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1592         for file in rts/*.ali; do \
1593             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1594         done
1595         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1596         -cd rts; for file in *$(arext);do \
1597             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1598             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
1599         done
1600         -$(foreach file, $(EXTRA_ADALIB_FILES), \
1601             $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1602         ) true
1603 #     Install the shared libraries, if any, using $(INSTALL) instead
1604 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1605 #     for shared libraries on some targets, e.g. on HP-UX where the x
1606 #     permission is required.
1607         for file in gnat gnarl; do \
1608            if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
1609               $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1610                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1611            fi; \
1612            if [ -f rts/lib$${file}$(soext) ]; then \
1613               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1614               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
1615            fi; \
1616         done
1617 # This copy must be done preserving the date on the original file.
1618         for file in rts/*.adb rts/*.ads; do \
1619             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1620         done
1621         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1622         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1623
1624 ../stamp-gnatlib2:
1625         $(RM) rts/s-*.ali
1626         $(RM) rts/s-*$(objext)
1627         $(RM) rts/a-*.ali
1628         $(RM) rts/a-*$(objext)
1629         $(RM) rts/*.ali
1630         $(RM) rts/*$(objext)
1631         $(RM) rts/*$(arext)
1632         $(RM) rts/*$(soext)
1633         touch ../stamp-gnatlib2
1634         $(RM) ../stamp-gnatlib
1635
1636 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1637 #       successive target commands. Although the Gnu make documentation
1638 #       implies this is true on all systems, I suspect it may not be, So care
1639 #       has been taken to allow a sed script to look for ";)" and substitue
1640 #       for ";" the appropriate character in the range of lines below
1641 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1642
1643 # GNULLI Begin ###########################################################
1644
1645 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1646         $(RMDIR) rts
1647         $(MKDIR) rts
1648         $(CHMOD) u+w rts
1649 # Copy target independent sources
1650         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1651           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1652 # Remove files to be replaced by target dependent sources
1653         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1654                         rts/$(word 1,$(subst <, ,$(PAIR))))
1655         $(RM) rts/*-*-*.ads rts/*-*-*.adb
1656 # Copy new target dependent sources
1657         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1658                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1659                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1660         $(RM) ../stamp-gnatlib
1661         touch ../stamp-gnatlib1
1662
1663 # GNULLI End #############################################################
1664
1665 # Don't use semicolon separated shell commands that involve list expansions.
1666 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1667 # line lengths in excess of 256 characters.
1668 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1669 # is guaranteed to overflow the buffer.
1670
1671 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1672         $(MAKE) -C rts \
1673                 CC="`echo \"$(GCC_FOR_TARGET)\" \
1674                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
1675                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1676                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1677                 srcdir=$(fsrcdir) \
1678                 -f ../Makefile $(LIBGNAT_OBJS)
1679         $(MAKE) -C rts \
1680                 CC="`echo \"$(GCC_FOR_TARGET)\" \
1681                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
1682                 ADA_INCLUDES="" \
1683                 CFLAGS="$(GNATLIBCFLAGS)" \
1684                 ADAFLAGS="$(GNATLIBFLAGS)" \
1685                 srcdir=$(fsrcdir) \
1686                 -f ../Makefile \
1687                 $(GNATRTL_OBJS)
1688         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1689         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
1690            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1691         ifneq ($(PREFIX_OBJS),)
1692                 $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
1693                   $(PREFIX_OBJS);
1694                 $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
1695         endif
1696         $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
1697         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
1698            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1699         $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
1700         ifeq ($(GMEM_LIB),gmemlib)
1701                 $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
1702                   rts/memtrack.o
1703                 $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
1704         endif
1705         $(CHMOD) a-wx rts/*.ali
1706         touch ../stamp-gnatlib
1707
1708 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
1709 gnatlib-shared-default:
1710         $(MAKE) $(FLAGS_TO_PASS) \
1711              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1712              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1713              THREAD_KIND="$(THREAD_KIND)" \
1714              gnatlib
1715         $(RM) rts/libgna*$(soext)
1716         cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
1717                 $(TARGET_LIBGCC2_CFLAGS) \
1718                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1719                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1720                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1721                 $(MISCLIB) -lm
1722         cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
1723                 $(TARGET_LIBGCC2_CFLAGS) \
1724                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1725                 $(GNATRTL_TASKING_OBJS) \
1726                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1727                 $(THREADSLIB)
1728         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1729                 libgnat$(soext)
1730         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1731                 libgnarl$(soext)
1732
1733 gnatlib-shared-dual:
1734         $(MAKE) $(FLAGS_TO_PASS) \
1735              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1736              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1737              THREAD_KIND="$(THREAD_KIND)" \
1738              gnatlib-shared-default
1739         $(MV) rts/libgna*$(soext) .
1740         $(RM) ../stamp-gnatlib2
1741         $(MAKE) $(FLAGS_TO_PASS) \
1742              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1743              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1744              THREAD_KIND="$(THREAD_KIND)" \
1745              gnatlib
1746         $(MV) libgna*$(soext) rts
1747
1748 gnatlib-shared-dual-win32:
1749         $(MAKE) $(FLAGS_TO_PASS) \
1750              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1751              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1752              THREAD_KIND="$(THREAD_KIND)" \
1753              gnatlib-shared-win32
1754         $(MV) rts/libgna*$(soext) .
1755         $(RM) ../stamp-gnatlib2
1756         $(MAKE) $(FLAGS_TO_PASS) \
1757              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1758              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1759              THREAD_KIND="$(THREAD_KIND)" \
1760              gnatlib
1761         $(MV) libgna*$(soext) rts
1762
1763 # ??? we need to add the option to support auto-import of arrays/records to
1764 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
1765 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
1766 # Windows.
1767 gnatlib-shared-win32:
1768         $(MAKE) $(FLAGS_TO_PASS) \
1769              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1770              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1771              THREAD_KIND="$(THREAD_KIND)" \
1772              gnatlib
1773         $(RM) rts/libgna*$(soext)
1774         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1775                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1776                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1777                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
1778         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1779                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1780                 $(GNATRTL_TASKING_OBJS) \
1781                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1782                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
1783
1784 gnatlib-shared-darwin:
1785         $(MAKE) $(FLAGS_TO_PASS) \
1786              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1787              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
1788                             -fno-common" \
1789              THREAD_KIND="$(THREAD_KIND)" \
1790              gnatlib
1791         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
1792         cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
1793                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1794                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1795                 $(SO_OPTS) \
1796                 $(MISCLIB) -lm
1797         cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
1798                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1799                 $(GNATRTL_TASKING_OBJS) \
1800                 $(SO_OPTS) \
1801                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
1802         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1803                 libgnat$(soext)
1804         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1805                 libgnarl$(soext)
1806
1807 gnatlib-shared-vms:
1808         $(MAKE) $(FLAGS_TO_PASS) \
1809              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1810              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1811              THREAD_KIND="$(THREAD_KIND)" \
1812              gnatlib
1813         $(RM) rts/libgna*$(soext)
1814         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1815         objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
1816         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1817         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1818         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1819            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
1820            sys\$$library:trace.exe \
1821            --for-linker=/noinform \
1822            --for-linker=SYMVEC_$$$$.opt \
1823            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1824         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1825         objdump --syms $(GNATRTL_TASKING_OBJS) | \
1826         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1827         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1828         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1829            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1830            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1831            sys\$$library:trace.exe \
1832            --for-linker=/noinform \
1833            --for-linker=SYMVEC_$$$$.opt \
1834            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1835
1836 gnatlib-shared:
1837         $(MAKE) $(FLAGS_TO_PASS) \
1838              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1839              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1840              THREAD_KIND="$(THREAD_KIND)" \
1841              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
1842              $(GNATLIB_SHARED)
1843
1844 gnatlib-sjlj:
1845         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
1846         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
1847         $(MV) rts/s.ads rts/system.ads
1848         $(MAKE) $(FLAGS_TO_PASS) \
1849              EH_MECHANISM="" \
1850              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1851              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1852              THREAD_KIND="$(THREAD_KIND)" \
1853              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
1854
1855 gnatlib-zcx:
1856         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
1857         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' rts/system.ads > rts/s.ads
1858         $(MV) rts/s.ads rts/system.ads
1859         $(MAKE) $(FLAGS_TO_PASS) \
1860              EH_MECHANISM="-gcc" \
1861              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1862              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1863              THREAD_KIND="$(THREAD_KIND)" \
1864              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
1865
1866 # .s files for cross-building
1867 gnat-cross: force
1868         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
1869
1870 # Compiling object files from source files.
1871
1872 # Note that dependencies on obstack.h are not written
1873 # because that file is not part of GCC.
1874 # Dependencies on gvarargs.h are not written
1875 # because all that file does, when not compiling with GCC,
1876 # is include the system varargs.h.
1877
1878 b_gnatl.c : $(GNATLINK_OBJS)
1879         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
1880 b_gnatl.o : b_gnatl.c
1881
1882 b_gnatm.c : $(GNATMAKE_OBJS)
1883         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
1884 b_gnatm.o : b_gnatm.c
1885
1886 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
1887 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
1888
1889 # force no sibling call optimization on s-traceb.o so the number of stack
1890 # frames to be skipped when computing a call chain is not modified by
1891 # optimization. However we can do that only when building the runtime
1892 # (not the compiler) because the -fno-optimize-sibling-calls exists
1893 # only in GCC 3.
1894
1895 ifneq (,$(findstring xgcc,$(CC)))
1896 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
1897 else
1898 NO_SIBLING_ADAFLAGS=
1899 endif
1900
1901 s-traceb.o  : s-traceb.adb
1902         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
1903               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
1904       $< $(OUTPUT_OPTION)
1905
1906 # force debugging information on s-tasdeb.o so that it is always
1907 # possible to set conditional breakpoints on tasks.
1908
1909 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
1910         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
1911               $< $(OUTPUT_OPTION)
1912
1913 # force debugging information on a-except.o so that it is always
1914 # possible to set conditional breakpoints on exceptions.
1915 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
1916
1917 a-except.o  : a-except.adb a-except.ads
1918         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
1919               $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
1920
1921 # force debugging information on s-assert.o so that it is always
1922 # possible to set breakpoint on assert failures.
1923
1924 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
1925         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
1926               $< $(OUTPUT_OPTION)
1927
1928 adadecode.o : adadecode.c adadecode.h
1929 aux-io.o  : aux-io.c
1930 argv.o    : argv.c
1931 cal.o     : cal.c
1932 deftarg.o : deftarg.c
1933 errno.o   : errno.c
1934 exit.o    : adaint.h exit.c
1935 expect.o  : expect.c
1936 final.o   : final.c
1937 gmem.o    : gmem.c
1938 link.o    : link.c
1939 mkdir.o   : mkdir.c
1940 socket.o  : socket.c gsocket.h
1941 sysdep.o  : sysdep.c
1942 raise-gcc.o : raise-gcc.c raise.h
1943 raise.o   : raise.c raise.h
1944
1945 gen-soccon: gen-soccon.c gsocket.h
1946         $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1947                 -UIN_GCC -DTARGET=\"$(target_alias)\" \
1948                 $< $(OUTPUT_OPTION)
1949
1950 cio.o     : cio.c
1951         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1952                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1953
1954 init.o    : init.c adaint.h raise.h
1955         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1956                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1957
1958 initialize.o : initialize.c raise.h
1959         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1960                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1961
1962 targext.o : targext.c
1963         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
1964                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
1965                 $< $(OUTPUT_OPTION)
1966
1967 # No optimization to compile this file as optimizations (-O1 or above) breaks
1968 # the SEH handling on Windows. The reasons are not clear.
1969 seh_init.o : seh_init.c raise.h
1970         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
1971                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
1972
1973 # Need to keep the frame pointer in this file to pop the stack properly on
1974 # some targets.
1975 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
1976         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
1977               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
1978
1979 # In GNU Make, ignore whether `stage*' exists.
1980 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
1981 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
1982
1983 force:
1984
1985 # Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS
1986
1987 ../../gnatlbr$(exeext): ../../prefix.o
1988         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
1989         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
1990         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1991
1992 ../../vms_help$(exeext):
1993         $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)"
1994         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help
1995         $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1996
1997 ../../gnat.hlp: ../../vms_help$(exeext)
1998         ../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \
1999                                 $(fsrcdir)/vms_data.ads ../../gnat.hlp