OSDN Git Service

2008-04-08 Hristian Kirtchev <kirtchev@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / Makefile.in
1 # Makefile for GNU Ada Compiler (GNAT).
2 #   Copyright (C) 1994-2008 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 3, 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 COPYING3.  If not see
18 #<http://www.gnu.org/licenses/>.
19
20 # The makefile built from this file lives in the language subdirectory.
21 # Its purpose is to provide support for:
22 #
23 # 1) recursion where necessary, and only then (building .o's), and
24 # 2) building and debugging cc1 from the language subdirectory, and
25 # 3) nothing else.
26 #
27 # The parent makefile handles all other chores, with help from the
28 # language makefile fragment, of course.
29 #
30 # The targets for external use are:
31 # all, TAGS, ???mostlyclean, ???clean.
32
33 # This makefile will only work with Gnu make.
34 # The rules are written assuming a minimum subset of tools are available:
35 #
36 # Required:
37 #      MAKE:    Only Gnu make will work.
38 #      MV:      Must accept (at least) one, maybe wildcard, source argument,
39 #               a file or directory destination, and support creation/
40 #               modification date preservation.  Gnu mv -f works.
41 #      RM:      Must accept an arbitrary number of space separated file
42 #               arguments, or one wildcard argument. Gnu rm works.
43 #      RMDIR:   Must delete a directory and all its contents. Gnu rm -rf works.
44 #      ECHO:    Must support command line redirection. Any Unix-like
45 #               shell will typically provide this, otherwise a custom version
46 #               is trivial to write.
47 #      AR:      Gnu ar works.
48 #      MKDIR:   Gnu mkdir works.
49 #      CHMOD:   Gnu chmod works.
50 #      true:    Does nothing and returns a normal successful return code.
51 #      pwd:     Prints the current directory on stdout.
52 #      cd:      Change directory.
53 #
54 # Optional:
55 #      BISON:   Gnu bison works.
56 #      FLEX:    Gnu flex works.
57 #      Other miscellaneous tools for obscure targets.
58
59 # Tell GNU make 3.79 not to run this directory in parallel.
60 # Not all of the required dependencies are present.
61 .NOTPARALLEL:
62
63 # Suppress smart makes who think they know how to automake Yacc files
64 .y.c:
65
66 # Variables that exist for you to override.
67 # See below for how to change them for certain systems.
68
69 # Various ways of specifying flags for compilations:  
70 # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
71 # BOOT_CFLAGS is the value of CFLAGS to pass
72 # to the stage2 and stage3 compilations
73 # XCFLAGS is used for most compilations but not when using the GCC just built.
74 XCFLAGS =
75 CFLAGS = -g
76 BOOT_CFLAGS = -O $(CFLAGS)
77 # These exists to be overridden by the x-* and t-* files, respectively.
78 X_CFLAGS =
79 T_CFLAGS =
80
81 X_CPPFLAGS =
82 T_CPPFLAGS =
83
84 X_ADA_CFLAGS =
85 T_ADA_CFLAGS =
86
87 X_ADAFLAGS =
88 T_ADAFLAGS =
89
90 CC = cc
91 BISON = bison
92 BISONFLAGS =
93 ECHO = echo
94 LEX = flex
95 LEXFLAGS =
96 CHMOD = chmod
97 LN = ln
98 LN_S = ln -s
99 CP = cp -p
100 MV = mv -f
101 RM = rm -f
102 RMDIR = rm -rf
103 MKDIR = mkdir -p
104 AR = ar
105 AR_FLAGS = rc
106 LS = ls
107 RANLIB = @RANLIB@
108 RANLIB_FLAGS = @ranlib_flags@
109
110 SHELL = @SHELL@
111 PWD_COMMAND = $${PWDCMD-pwd}
112 # How to copy preserving the date
113 INSTALL_DATA_DATE = cp -p
114 MAKEINFO = makeinfo
115 TEXI2DVI = texi2dvi
116 TEXI2PDF = texi2pdf
117 GNATBIND_FLAGS = -static -x
118 ADA_CFLAGS =
119 ADAFLAGS = -W -Wall -gnatpg -gnata
120 SOME_ADAFLAGS =-gnata
121 FORCE_DEBUG_ADAFLAGS = -g
122 GNATLIBFLAGS = -gnatpg -nostdinc
123 GNATLIBCFLAGS = -g -O2
124 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
125         -DIN_RTS
126 ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
127 ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
128         $(ADAFLAGS)
129 MOST_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
130         $(SOME_ADAFLAGS)
131 THREAD_KIND = native
132 THREADSLIB =
133 GMEM_LIB =
134 MISCLIB =
135 SYMDEPS = $(LIBINTL_DEP)
136 OUTPUT_OPTION = @OUTPUT_OPTION@
137
138 objext = .o
139 exeext =
140 arext  = .a
141 soext  = .so
142 shext  =
143 hyphen = -
144
145 # Define this as & to perform parallel make on a Sequent.
146 # Note that this has some bugs, and it seems currently necessary 
147 # to compile all the gen* files first by hand to avoid erroneous results.
148 P =
149
150 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
151 # It omits XCFLAGS, and specifies -B./.
152 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
153 GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
154
155 # Tools to use when building a cross-compiler.
156 # These are used because `configure' appends `cross-make'
157 # to the makefile when making a cross-compiler.
158
159 # We don't use cross-make.  Instead we use the tools from the build tree,
160 # if they are available.
161 # program_transform_name and objdir are set by configure.in.
162 program_transform_name =
163 objdir = .
164
165 target_alias=@target_alias@
166 target=@target@
167 xmake_file = @xmake_file@
168 tmake_file = @tmake_file@
169 host_canonical=@host@
170 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
171 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
172
173 # Directory where sources are, from where we are.
174 srcdir = @srcdir@
175 VPATH = $(srcdir)
176
177 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
178 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
179 fcurdir := $(shell ${PWD_COMMAND})
180 fcurpfx := $(shell ${PWD_COMMAND})/
181
182 # Top build directory, relative to here.
183 top_builddir = ../..
184
185 # Internationalization library.
186 LIBINTL = @LIBINTL@
187 LIBINTL_DEP = @LIBINTL_DEP@
188
189 # Any system libraries needed just for GNAT.
190 SYSLIBS = @GNAT_LIBEXC@
191
192 # List of extra object files linked in with various programs.
193 EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o
194
195 # List of target dependent sources, overridden below as necessary
196 TARGET_ADA_SRCS =
197
198 # Type of tools build we are doing; default is not compiling tools.
199 TOOLSCASE =
200
201 # End of variables for you to override.
202
203 all: all.indirect
204
205 # This tells GNU Make version 3 not to put all variables in the environment.
206 .NOEXPORT:
207
208 # tmake_file and xmake_file expand to lists with entries of the form
209 # $(srcdir)/config/...  but here $(srcdir) is the ada subdirectory so we
210 # need to adjust the paths.  There can't be spaces in the subst arguments
211 # or we get spurious spaces in the actual list of files to include.
212
213 # target overrides
214 ifneq ($(tmake_file),)
215 include $(subst /config,/../config,$(tmake_file))
216 endif
217
218 # host overrides
219 ifneq ($(xmake_file),)
220 include $(subst /config,/../config,$(xmake_file))
221 endif
222 \f
223 # Now figure out from those variables how to compile and link.
224
225 all.indirect: Makefile ../gnat1$(exeext)
226
227 # IN_GCC distinguishes between code compiled into GCC itself and other
228 # programs built during a bootstrap.
229 # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
230 # compiler which does not use the native libraries and headers.
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 \
310  mlib-tgt-specific.o mlib-utl.o 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.ads<s-stchop-limit.ads \
404   s-stchop.adb<s-stchop-vxworks.adb \
405   s-taprop.adb<s-taprop-vxworks.adb \
406   s-taspri.ads<s-taspri-vxworks.ads \
407   s-tpopsp.adb<s-tpopsp-vxworks.adb \
408   s-vxwork.ads<s-vxwork-m68k.ads \
409   g-soccon.ads<g-soccon-vxworks.ads \
410   g-socthi.ads<g-socthi-vxworks.ads \
411   g-socthi.adb<g-socthi-vxworks.adb \
412   g-stsifd.adb<g-stsifd-sockets.adb \
413   g-sttsne.adb<g-sttsne-vxworks.adb \
414   g-sttsne.ads<g-sttsne-locking.ads \
415   system.ads<system-vxworks-m68k.ads
416
417   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
418
419   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
420   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
421
422   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
423   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
424
425   ifeq ($(strip $(filter-out yes,$(TRACE))),)
426     LIBGNAT_TARGET_PAIRS += \
427     s-traces.adb<s-traces-default.adb \
428     s-tratas.adb<s-tratas-default.adb \
429     s-trafor.adb<s-trafor-default.adb \
430     s-trafor.ads<s-trafor-default.ads \
431     s-tfsetr.adb<s-tfsetr-vxworks.adb 
432   endif
433 endif
434
435 ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
436   LIBGNAT_TARGET_PAIRS = \
437   a-intnam.ads<a-intnam-vxworks.ads \
438   a-numaux.ads<a-numaux-vxworks.ads \
439   s-inmaop.adb<s-inmaop-posix.adb \
440   s-intman.ads<s-intman-vxworks.ads \
441   s-intman.adb<s-intman-vxworks.adb \
442   s-osprim.adb<s-osprim-vxworks.adb \
443   s-parame.ads<s-parame-vxworks.ads \
444   s-parame.adb<s-parame-vxworks.adb \
445   s-stchop.ads<s-stchop-limit.ads \
446   s-stchop.adb<s-stchop-vxworks.adb \
447   s-taprop.adb<s-taprop-vxworks.adb \
448   s-taspri.ads<s-taspri-vxworks.ads \
449   s-vxwork.ads<s-vxwork-ppc.ads \
450   g-soccon.ads<g-soccon-vxworks.ads \
451   g-socthi.ads<g-socthi-vxworks.ads \
452   g-socthi.adb<g-socthi-vxworks.adb \
453   g-stsifd.adb<g-stsifd-sockets.adb \
454   g-sttsne.adb<g-sttsne-vxworks.adb \
455   g-sttsne.ads<g-sttsne-locking.ads
456
457   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
458
459   ifeq ($(strip $(filter-out yes,$(TRACE))),)
460     LIBGNAT_TARGET_PAIRS += \
461     s-traces.adb<s-traces-default.adb \
462     s-trafor.adb<s-trafor-default.adb \
463     s-trafor.ads<s-trafor-default.ads \
464     s-tratas.adb<s-tratas-default.adb \
465     s-tfsetr.adb<s-tfsetr-vxworks.adb 
466   endif
467
468   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
469     LIBGNAT_TARGET_PAIRS += \
470     s-osinte.adb<s-osinte-vxworks-rtp.adb \
471     s-osinte.ads<s-osinte-vxworks6.ads \
472     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
473     system.ads<system-vxworks-ppc-rtp.ads
474
475     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
476   else
477     LIBGNAT_TARGET_PAIRS += \
478     s-interr.adb<s-interr-vxworks.adb \
479     s-tpopsp.adb<s-tpopsp-vxworks.adb \
480     system.ads<system-vxworks-ppc.ads
481
482     ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
483       LIBGNAT_TARGET_PAIRS += \
484       s-osinte.ads<s-osinte-vxworks6.ads \
485       s-osinte.adb<s-osinte-vxworks-kernel.adb
486     else
487       LIBGNAT_TARGET_PAIRS += \
488       s-osinte.ads<s-osinte-vxworks.ads \
489       s-osinte.adb<s-osinte-vxworks.adb
490     endif
491
492     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
493   endif
494
495   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
496
497   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
498   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
499 endif
500
501 # vxworksae / vxworks 653
502 ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
503   # target pairs for kernel + vthreads runtime
504   LIBGNAT_TARGET_PAIRS = \
505   a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
506   a-intnam.ads<a-intnam-vxworks.ads \
507   a-numaux.ads<a-numaux-vxworks.ads \
508   g-io.adb<g-io-vxworks-ppc-cert.adb \
509   g-io.ads<g-io-vxworks-ppc-cert.ads \
510   s-inmaop.adb<s-inmaop-posix.adb \
511   s-interr.adb<s-interr-vxworks.adb \
512   s-intman.ads<s-intman-vxworks.ads \
513   s-intman.adb<s-intman-vxworks.adb \
514   s-osinte.adb<s-osinte-vxworks.adb \
515   s-osinte.ads<s-osinte-vxworks.ads \
516   s-osprim.adb<s-osprim-vxworks.adb \
517   s-parame.ads<s-parame-ae653.ads \
518   s-parame.adb<s-parame-vxworks.adb \
519   s-taprop.adb<s-taprop-vxworks.adb \
520   s-taspri.ads<s-taspri-vxworks.ads \
521   s-tpopsp.adb<s-tpopsp-vxworks.adb \
522   s-vxwork.ads<s-vxwork-ppc.ads \
523   g-soccon.ads<g-soccon-vxworks.ads \
524   g-socthi.ads<g-socthi-vxworks.ads \
525   g-socthi.adb<g-socthi-vxworks.adb \
526   g-stsifd.adb<g-stsifd-sockets.adb \
527   g-sttsne.adb<g-sttsne-vxworks.adb \
528   g-sttsne.ads<g-sttsne-locking.ads \
529   system.ads<system-vxworks-ppc-vthread.ads
530
531   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
532
533   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
534   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
535
536   # Extra pairs for the vthreads runtime
537   ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
538     LIBGNAT_TARGET_PAIRS += \
539     s-thread.adb<s-thread-ae653.adb
540     EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
541   endif
542
543   ifeq ($(strip $(filter-out yes,$(TRACE))),)
544     LIBGNAT_TARGET_PAIRS += \
545     s-traces.adb<s-traces-default.adb \
546     s-trafor.adb<s-trafor-default.adb \
547     s-trafor.ads<s-trafor-default.ads \
548     s-tratas.adb<s-tratas-default.adb \
549     s-tfsetr.adb<s-tfsetr-vxworks.adb
550   endif
551 endif
552
553 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
554   LIBGNAT_TARGET_PAIRS = \
555   a-intnam.ads<a-intnam-vxworks.ads \
556   a-numaux.ads<a-numaux-vxworks.ads \
557   s-inmaop.adb<s-inmaop-posix.adb \
558   s-interr.adb<s-interr-vxworks.adb \
559   s-intman.ads<s-intman-vxworks.ads \
560   s-intman.adb<s-intman-vxworks.adb \
561   s-osinte.adb<s-osinte-vxworks.adb \
562   s-osinte.ads<s-osinte-vxworks.ads \
563   s-osprim.adb<s-osprim-vxworks.adb \
564   s-parame.ads<s-parame-vxworks.ads \
565   s-parame.adb<s-parame-vxworks.adb \
566   s-stchop.ads<s-stchop-limit.ads \
567   s-stchop.adb<s-stchop-vxworks.adb \
568   s-taprop.adb<s-taprop-vxworks.adb \
569   s-taspri.ads<s-taspri-vxworks.ads \
570   s-tpopsp.adb<s-tpopsp-vxworks.adb \
571   s-vxwork.ads<s-vxwork-sparcv9.ads \
572   g-soccon.ads<g-soccon-vxworks.ads \
573   g-socthi.ads<g-socthi-vxworks.ads \
574   g-socthi.adb<g-socthi-vxworks.adb \
575   g-stsifd.adb<g-stsifd-sockets.adb \
576   g-sttsne.adb<g-sttsne-vxworks.adb \
577   g-sttsne.ads<g-sttsne-locking.ads \
578   system.ads<system-vxworks-sparcv9.ads   \
579
580   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
581
582   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
583   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
584
585   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
586   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
587 endif
588
589 ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
590   LIBGNAT_TARGET_PAIRS = \
591   a-intnam.ads<a-intnam-vxworks.ads \
592   i-vxwork.ads<i-vxwork-x86.ads \
593   s-inmaop.adb<s-inmaop-posix.adb \
594   s-intman.ads<s-intman-vxworks.ads \
595   s-intman.adb<s-intman-vxworks.adb \
596   a-numaux.adb<a-numaux-x86.adb \
597   a-numaux.ads<a-numaux-x86.ads \
598   s-osprim.adb<s-osprim-vxworks.adb \
599   s-parame.ads<s-parame-vxworks.ads \
600   s-parame.adb<s-parame-vxworks.adb \
601   s-stchop.ads<s-stchop-limit.ads \
602   s-stchop.adb<s-stchop-vxworks.adb \
603   s-taprop.adb<s-taprop-vxworks.adb \
604   s-taspri.ads<s-taspri-vxworks.ads \
605   s-vxwork.ads<s-vxwork-x86.ads \
606   g-bytswa.adb<g-bytswa-x86.adb \
607   g-soccon.ads<g-soccon-vxworks.ads \
608   g-socthi.ads<g-socthi-vxworks.ads \
609   g-socthi.adb<g-socthi-vxworks.adb \
610   g-stsifd.adb<g-stsifd-sockets.adb \
611   g-sttsne.adb<g-sttsne-vxworks.adb \
612   g-sttsne.ads<g-sttsne-locking.ads
613
614   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
615
616   ifeq ($(strip $(filter-out yes,$(TRACE))),)
617     LIBGNAT_TARGET_PAIRS += \
618     s-traces.adb<s-traces-default.adb \
619     s-trafor.adb<s-trafor-default.adb \
620     s-trafor.ads<s-trafor-default.ads \
621     s-tratas.adb<s-tratas-default.adb \
622     s-tfsetr.adb<s-tfsetr-vxworks.adb
623   endif
624
625   ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
626     LIBGNAT_TARGET_PAIRS += \
627     s-osinte.adb<s-osinte-vxworks-rtp.adb \
628     s-osinte.ads<s-osinte-vxworks6.ads \
629     s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
630     system.ads<system-vxworks-x86-rtp.ads
631
632     EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
633   else
634     LIBGNAT_TARGET_PAIRS += \
635     s-interr.adb<s-interr-vxworks.adb \
636     s-tpopsp.adb<s-tpopsp-vxworks.adb \
637     system.ads<system-vxworks-x86.ads
638
639     ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
640       LIBGNAT_TARGET_PAIRS += \
641       s-osinte.ads<s-osinte-vxworks6.ads \
642       s-osinte.adb<s-osinte-vxworks-kernel.adb
643     else
644       LIBGNAT_TARGET_PAIRS += \
645       s-osinte.ads<s-osinte-vxworks.ads \
646       s-osinte.adb<s-osinte-vxworks.adb
647     endif
648
649     EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
650   endif
651
652   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
653
654   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
655   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
656 endif
657
658 ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
659   LIBGNAT_TARGET_PAIRS = \
660   a-intnam.ads<a-intnam-vxworks.ads \
661   a-numaux.ads<a-numaux-vxworks.ads \
662   s-inmaop.adb<s-inmaop-posix.adb \
663   s-interr.adb<s-interr-vxworks.adb \
664   s-intman.ads<s-intman-vxworks.ads \
665   s-intman.adb<s-intman-vxworks.adb \
666   s-osinte.adb<s-osinte-vxworks.adb \
667   s-osinte.ads<s-osinte-vxworks.ads \
668   s-osprim.adb<s-osprim-vxworks.adb \
669   s-parame.ads<s-parame-vxworks.ads \
670   s-parame.adb<s-parame-vxworks.adb \
671   s-stchop.ads<s-stchop-limit.ads \
672   s-stchop.adb<s-stchop-vxworks.adb \
673   s-taprop.adb<s-taprop-vxworks.adb \
674   s-taspri.ads<s-taspri-vxworks.ads \
675   s-tpopsp.adb<s-tpopsp-vxworks.adb \
676   s-vxwork.ads<s-vxwork-arm.ads \
677   g-soccon.ads<g-soccon-vxworks.ads \
678   g-socthi.ads<g-socthi-vxworks.ads \
679   g-socthi.adb<g-socthi-vxworks.adb \
680   g-stsifd.adb<g-stsifd-sockets.adb \
681   g-sttsne.adb<g-sttsne-vxworks.adb \
682   g-sttsne.ads<g-sttsne-locking.ads \
683   system.ads<system-vxworks-arm.ads
684
685   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
686
687   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
688   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
689
690   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
691   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
692 endif
693
694 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
695   LIBGNAT_TARGET_PAIRS = \
696   a-intnam.ads<a-intnam-vxworks.ads \
697   a-numaux.ads<a-numaux-vxworks.ads \
698   s-inmaop.adb<s-inmaop-posix.adb \
699   s-interr.adb<s-interr-vxworks.adb \
700   s-intman.ads<s-intman-vxworks.ads \
701   s-intman.adb<s-intman-vxworks.adb \
702   s-osinte.adb<s-osinte-vxworks.adb \
703   s-osinte.ads<s-osinte-vxworks.ads \
704   s-osprim.adb<s-osprim-vxworks.adb \
705   s-parame.ads<s-parame-vxworks.ads \
706   s-parame.adb<s-parame-vxworks.adb \
707   s-stchop.ads<s-stchop-limit.ads \
708   s-stchop.adb<s-stchop-vxworks.adb \
709   s-taprop.adb<s-taprop-vxworks.adb \
710   s-taspri.ads<s-taspri-vxworks.ads \
711   s-tpopsp.adb<s-tpopsp-vxworks.adb \
712   s-vxwork.ads<s-vxwork-mips.ads \
713   g-soccon.ads<g-soccon-vxworks.ads \
714   g-socthi.ads<g-socthi-vxworks.ads \
715   g-socthi.adb<g-socthi-vxworks.adb \
716   g-stsifd.adb<g-stsifd-sockets.adb \
717   g-sttsne.adb<g-sttsne-vxworks.adb \
718   g-sttsne.ads<g-sttsne-locking.ads \
719   system.ads<system-vxworks-mips.ads
720
721   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
722
723   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
724   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
725
726   EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
727   EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
728 endif
729
730 ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
731   LIBGNAT_TARGET_PAIRS_32 = \
732   a-intnam.ads<a-intnam-solaris.ads \
733   s-inmaop.adb<s-inmaop-posix.adb \
734   s-intman.adb<s-intman-solaris.adb \
735   s-osinte.adb<s-osinte-solaris.adb \
736   s-osinte.ads<s-osinte-solaris.ads \
737   s-osprim.adb<s-osprim-solaris.adb \
738   s-taprop.adb<s-taprop-solaris.adb \
739   s-tasinf.adb<s-tasinf-solaris.adb \
740   s-tasinf.ads<s-tasinf-solaris.ads \
741   s-taspri.ads<s-taspri-solaris.ads \
742   s-tpopsp.adb<s-tpopsp-solaris.adb \
743   g-soccon.ads<g-soccon-solaris.ads \
744   g-soliop.ads<g-soliop-solaris.ads \
745   system.ads<system-solaris-sparc.ads
746
747   LIBGNAT_TARGET_PAIRS_64 = \
748   a-intnam.ads<a-intnam-solaris.ads \
749   s-inmaop.adb<s-inmaop-posix.adb \
750   s-intman.adb<s-intman-solaris.adb \
751   s-osinte.adb<s-osinte-solaris.adb \
752   s-osinte.ads<s-osinte-solaris.ads \
753   s-osprim.adb<s-osprim-solaris.adb \
754   s-taprop.adb<s-taprop-solaris.adb \
755   s-tasinf.adb<s-tasinf-solaris.adb \
756   s-tasinf.ads<s-tasinf-solaris.ads \
757   s-taspri.ads<s-taspri-solaris.ads \
758   s-tpopsp.adb<s-tpopsp-solaris.adb \
759   g-soccon.ads<g-soccon-solaris-64.ads \
760   g-soliop.ads<g-soliop-solaris.ads \
761   system.ads<system-solaris-sparcv9.ads
762
763   ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
764     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
765   else
766     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
767   endif
768   
769   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
770
771   EH_MECHANISM=-gcc
772   THREADSLIB = -lposix4 -lthread
773   MISCLIB = -lposix4 -lnsl -lsocket
774   SO_OPTS = -Wl,-h,
775   GNATLIB_SHARED = gnatlib-shared-dual
776   GMEM_LIB = gmemlib
777   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
778   LIBRARY_VERSION := $(LIB_VERSION)
779
780   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
781     LIBGNAT_TARGET_PAIRS = \
782     a-intnam.ads<a-intnam-solaris.ads \
783     s-inmaop.adb<s-inmaop-posix.adb \
784     s-intman.adb<s-intman-posix.adb \
785     s-osinte.adb<s-osinte-posix.adb \
786     s-osinte.ads<s-osinte-solaris-posix.ads \
787     s-osprim.adb<s-osprim-solaris.adb \
788     s-taprop.adb<s-taprop-posix.adb \
789     s-taspri.ads<s-taspri-posix.ads \
790     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
791     g-soccon.ads<g-soccon-solaris.ads \
792     g-soliop.ads<g-soliop-solaris.ads \
793     system.ads<system-solaris-sparc.ads
794
795     THREADSLIB = -lposix4 -lpthread
796   endif
797
798   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
799     LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
800   endif
801 endif
802
803 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
804   LIBGNAT_TARGET_PAIRS = \
805   a-numaux.adb<a-numaux-x86.adb \
806   a-numaux.ads<a-numaux-x86.ads \
807   a-intnam.ads<a-intnam-solaris.ads \
808   s-inmaop.adb<s-inmaop-posix.adb \
809   s-intman.adb<s-intman-solaris.adb \
810   s-osinte.adb<s-osinte-solaris.adb \
811   s-osinte.ads<s-osinte-solaris.ads \
812   s-osprim.adb<s-osprim-solaris.adb \
813   s-taprop.adb<s-taprop-solaris.adb \
814   s-tasinf.adb<s-tasinf-solaris.adb \
815   s-tasinf.ads<s-tasinf-solaris.ads \
816   s-taspri.ads<s-taspri-solaris.ads \
817   s-tpopsp.adb<s-tpopsp-solaris.adb \
818   g-bytswa.adb<g-bytswa-x86.adb \
819   g-soccon.ads<g-soccon-solaris.ads \
820   g-soliop.ads<g-soliop-solaris.ads \
821   system.ads<system-solaris-x86.ads
822
823   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
824
825   EH_MECHANISM=-gcc
826   THREADSLIB = -lposix4 -lthread
827   MISCLIB = -lposix4 -lnsl -lsocket
828   SO_OPTS = -Wl,-h,
829   GNATLIB_SHARED = gnatlib-shared-dual
830   GMEM_LIB = gmemlib
831   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
832   LIBRARY_VERSION := $(LIB_VERSION)
833 endif
834
835 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
836   LIBGNAT_TARGET_PAIRS = \
837   a-intnam.ads<a-intnam-linux.ads \
838   a-numaux.adb<a-numaux-x86.adb \
839   a-numaux.ads<a-numaux-x86.ads \
840   g-bytswa.adb<g-bytswa-x86.adb \
841   s-inmaop.adb<s-inmaop-posix.adb \
842   s-intman.adb<s-intman-posix.adb \
843   s-osprim.adb<s-osprim-posix.adb \
844   s-taspri.ads<s-taspri-posix.ads \
845   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
846   g-sercom.adb<g-sercom-linux.adb \
847   system.ads<system-linux-x86.ads
848
849   ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
850     LIBGNAT_TARGET_PAIRS += \
851     a-exetim.adb<a-exetim-linux-marte.adb \
852     a-exetim.ads<a-exetim-linux-marte.ads \
853     a-extiti.adb<a-extiti-linux-marte.adb \
854     a-extiti.ads<a-extiti-linux-marte.ads \
855     a-rttiev.adb<a-rttiev-linux-marte.adb \
856     a-rttiev.ads<a-rttiev-linux-marte.ads \
857     g-soccon.ads<g-soccon-linux-x86-marte.ads \
858     s-osinte.adb<s-osinte-linux-marte.adb \
859     s-osinte.ads<s-osinte-linux-marte.ads \
860     s-taprop.adb<s-taprop-linux-marte.adb
861
862     EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
863
864     EH_MECHANISM=
865     THREADSLIB = -lmarte
866   else
867     LIBGNAT_TARGET_PAIRS += \
868     g-soccon.ads<g-soccon-linux-x86.ads \
869     s-linux.ads<s-linux.ads \
870     s-osinte.adb<s-osinte-posix.adb \
871     s-osinte.ads<s-osinte-linux.ads \
872     s-tasinf.ads<s-tasinf-linux.ads \
873     s-tasinf.adb<s-tasinf-linux.adb \
874     s-taprop.adb<s-taprop-linux.adb
875
876     EH_MECHANISM=-gcc
877     THREADSLIB = -lpthread
878     EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
879   endif
880
881   TOOLS_TARGET_PAIRS =  \
882     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
883     indepsw.adb<indepsw-gnu.adb
884
885   GNATLIB_SHARED = gnatlib-shared-dual
886   GMEM_LIB = gmemlib
887   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
888   LIBRARY_VERSION := $(LIB_VERSION)
889 endif
890
891 ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
892   LIBGNAT_TARGET_PAIRS = \
893   a-intnam.ads<a-intnam-freebsd.ads \
894   a-numaux.adb<a-numaux-x86.adb \
895   a-numaux.ads<a-numaux-x86.ads \
896   s-inmaop.adb<s-inmaop-posix.adb \
897   s-intman.adb<s-intman-posix.adb \
898   g-soccon.ads<g-soccon-freebsd.ads \
899   s-osinte.adb<s-osinte-posix.adb \
900   s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
901   s-osprim.adb<s-osprim-posix.adb \
902   s-taprop.adb<s-taprop-linux.adb \
903   s-tasinf.ads<s-tasinf-linux.ads \
904   s-tasinf.adb<s-tasinf-linux.adb \
905   s-taspri.ads<s-taspri-posix.ads \
906   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
907   system.ads<system-freebsd-x86.ads
908
909   TOOLS_TARGET_PAIRS =  \
910     mlib-tgt-specific.adb<mlib-tgt-linux.adb \
911     indepsw.adb<indepsw-gnu.adb
912
913   EH_MECHANISM=-gcc
914   THREADSLIB = -lpthread
915   GNATLIB_SHARED = gnatlib-shared-dual
916   GMEM_LIB = gmemlib
917   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
918   LIBRARY_VERSION := $(LIB_VERSION)
919 endif
920
921 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
922   LIBGNAT_TARGET_PAIRS = \
923   a-intnam.ads<a-intnam-freebsd.ads \
924   a-numaux.adb<a-numaux-x86.adb \
925   a-numaux.ads<a-numaux-x86.ads \
926   g-bytswa.adb<g-bytswa-x86.adb \
927   g-soccon.ads<g-soccon-freebsd.ads \
928   s-inmaop.adb<s-inmaop-posix.adb \
929   s-intman.adb<s-intman-posix.adb \
930   s-osinte.adb<s-osinte-freebsd.adb \
931   s-osinte.ads<s-osinte-freebsd.ads \
932   s-osprim.adb<s-osprim-posix.adb \
933   s-taprop.adb<s-taprop-posix.adb \
934   s-taspri.ads<s-taspri-posix.ads \
935   s-tpopsp.adb<s-tpopsp-posix.adb \
936   system.ads<system-freebsd-x86.ads
937
938   TOOLS_TARGET_PAIRS = \
939   mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
940   GNATLIB_SHARED = gnatlib-shared-dual
941
942   EH_MECHANISM=-gcc
943   THREADSLIB= -lpthread
944   GMEM_LIB = gmemlib
945   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
946   LIBRARY_VERSION := $(LIB_VERSION)
947 endif
948
949 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
950   ifeq ($(strip $(filter-out s390x,$(arch))),)
951     LIBGNAT_TARGET_PAIRS = \
952     a-intnam.ads<a-intnam-linux.ads \
953     s-inmaop.adb<s-inmaop-posix.adb \
954     s-intman.adb<s-intman-posix.adb \
955     s-linux.ads<s-linux.ads \
956     s-osinte.adb<s-osinte-posix.adb \
957     s-osinte.ads<s-osinte-linux.ads \
958     s-osprim.adb<s-osprim-posix.adb \
959     s-taprop.adb<s-taprop-linux.adb \
960     s-tasinf.ads<s-tasinf-linux.ads \
961     s-tasinf.adb<s-tasinf-linux.adb \
962     s-taspri.ads<s-taspri-posix-noaltstack.ads \
963     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
964     system.ads<system-linux-s390x.ads
965   else
966     LIBGNAT_TARGET_PAIRS = \
967     a-intnam.ads<a-intnam-linux.ads \
968     s-inmaop.adb<s-inmaop-posix.adb \
969     s-intman.adb<s-intman-posix.adb \
970     s-linux.ads<s-linux.ads \
971     s-osinte.adb<s-osinte-posix.adb \
972     s-osinte.ads<s-osinte-linux.ads \
973     s-osprim.adb<s-osprim-posix.adb \
974     s-taprop.adb<s-taprop-linux.adb \
975     s-tasinf.ads<s-tasinf-linux.ads \
976     s-tasinf.adb<s-tasinf-linux.adb \
977     s-taspri.ads<s-taspri-posix-noaltstack.ads \
978     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
979     system.ads<system-linux-s390.ads
980   endif
981
982   TOOLS_TARGET_PAIRS =  \
983     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
984
985   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
986   EH_MECHANISM=-gcc
987   THREADSLIB = -lpthread
988   GNATLIB_SHARED = gnatlib-shared-dual
989   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
990   LIBRARY_VERSION := $(LIB_VERSION)
991 endif
992
993 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
994   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
995     LIBGNAT_TARGET_PAIRS = \
996     a-intnam.ads<a-intnam-irix.ads \
997     s-inmaop.adb<s-inmaop-posix.adb \
998     s-intman.adb<s-intman-irix.adb \
999     s-mastop.adb<s-mastop-irix.adb \
1000     s-osinte.adb<s-osinte-irix.adb \
1001     s-osinte.ads<s-osinte-irix.ads \
1002     s-osprim.adb<s-osprim-posix.adb \
1003     s-proinf.adb<s-proinf-irix-athread.adb \
1004     s-proinf.ads<s-proinf-irix-athread.ads \
1005     s-taprop.adb<s-taprop-irix.adb \
1006     s-tasinf.ads<s-tasinf-irix.ads \
1007     s-taspri.ads<s-taspri-posix.ads \
1008     s-tpopsp.adb<s-tpopsp-posix.adb \
1009     s-traceb.adb<s-traceb-mastop.adb \
1010     g-soccon.ads<g-soccon-irix.ads \
1011     system.ads<system-irix-n32.ads
1012
1013     THREADSLIB = -lpthread
1014     GNATLIB_SHARED = gnatlib-shared-default
1015
1016   else
1017     LIBGNAT_TARGET_PAIRS += \
1018     s-mastop.adb<s-mastop-irix.adb \
1019     s-osprim.adb<s-osprim-posix.adb \
1020     s-traceb.adb<s-traceb-mastop.adb \
1021     g-soccon.ads<g-soccon-irix.ads \
1022     system.ads<system-irix-o32.ads
1023   endif
1024
1025   EH_MECHANISM=-gcc
1026   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb
1027   TGT_LIB = -lexc
1028   MISCLIB = -lexc
1029   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1030   LIBRARY_VERSION := $(LIB_VERSION)
1031   GMEM_LIB = gmemlib
1032 endif
1033
1034 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
1035   LIBGNAT_TARGET_PAIRS = \
1036   a-excpol.adb<a-excpol-abort.adb \
1037   a-intnam.ads<a-intnam-hpux.ads \
1038   s-inmaop.adb<s-inmaop-posix.adb \
1039   s-interr.adb<s-interr-sigaction.adb \
1040   s-intman.adb<s-intman-posix.adb \
1041   s-osinte.adb<s-osinte-hpux-dce.adb \
1042   s-osinte.ads<s-osinte-hpux-dce.ads \
1043   s-parame.ads<s-parame-hpux.ads \
1044   s-osprim.adb<s-osprim-posix.adb \
1045   s-taprop.adb<s-taprop-hpux-dce.adb \
1046   s-taspri.ads<s-taspri-hpux-dce.ads \
1047   s-tpopsp.adb<s-tpopsp-posix.adb \
1048   g-soccon.ads<g-soccon-hpux.ads \
1049   system.ads<system-hpux.ads
1050
1051   EH_MECHANISM=-gcc
1052   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1053 endif
1054
1055 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
1056   LIBGNAT_TARGET_PAIRS = \
1057   a-intnam.ads<a-intnam-hpux.ads \
1058   s-inmaop.adb<s-inmaop-posix.adb \
1059   s-intman.adb<s-intman-posix.adb \
1060   s-osinte.adb<s-osinte-posix.adb \
1061   s-osinte.ads<s-osinte-hpux.ads \
1062   s-parame.ads<s-parame-hpux.ads \
1063   s-osprim.adb<s-osprim-posix.adb \
1064   s-traceb.adb<s-traceb-hpux.adb \
1065   s-taprop.adb<s-taprop-posix.adb \
1066   s-taspri.ads<s-taspri-posix.ads \
1067   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1068   g-soccon.ads<g-soccon-hpux.ads \
1069   system.ads<system-hpux.ads
1070
1071   TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
1072   EH_MECHANISM=-gcc
1073   TGT_LIB = /usr/lib/libcl.a
1074   THREADSLIB = -lpthread
1075   GMEM_LIB = gmemlib
1076   soext = .sl
1077   SO_OPTS = -Wl,+h,
1078   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1079   GNATLIB_SHARED = gnatlib-shared-dual
1080   LIBRARY_VERSION := $(LIB_VERSION)
1081 endif
1082
1083 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1084   LIBGNAT_TARGET_PAIRS = \
1085   a-intnam.ads<a-intnam-aix.ads \
1086   s-inmaop.adb<s-inmaop-posix.adb \
1087   s-intman.adb<s-intman-posix.adb \
1088   s-osinte.adb<s-osinte-aix.adb \
1089   s-osinte.ads<s-osinte-aix.ads \
1090   s-osprim.adb<s-osprim-posix.adb \
1091   s-taprop.adb<s-taprop-posix.adb \
1092   s-taspri.ads<s-taspri-posix.ads \
1093   s-tpopsp.adb<s-tpopsp-posix.adb \
1094   g-soccon.ads<g-soccon-aix.ads \
1095   system.ads<system-aix.ads
1096
1097   THREADSLIB = -lpthreads
1098   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1099
1100   TOOLS_TARGET_PAIRS = \
1101   mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
1102   indepsw.adb<indepsw-aix.adb
1103
1104   GMEM_LIB = gmemlib
1105 endif
1106
1107 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1108   TOOLS_TARGET_PAIRS = \
1109   mlib-tgt-specific.adb<mlib-tgt-specific-lynxos.adb \
1110   indepsw.adb<indepsw-gnu.adb
1111
1112   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1113     LIBGNAT_TARGET_PAIRS = \
1114     a-numaux.adb<a-numaux-x86.adb \
1115     a-numaux.ads<a-numaux-x86.ads \
1116     a-intnam.ads<a-intnam-lynxos.ads \
1117     g-bytswa.adb<g-bytswa-x86.adb \
1118     g-soccon.ads<g-soccon-lynxos.ads \
1119     g-sttsne.adb<g-sttsne-locking.adb \
1120     g-sttsne.ads<g-sttsne-locking.ads \
1121     s-inmaop.adb<s-inmaop-posix.adb \
1122     s-intman.adb<s-intman-posix.adb \
1123     s-osinte.adb<s-osinte-lynxos.adb \
1124     s-osinte.ads<s-osinte-lynxos.ads \
1125     s-osprim.adb<s-osprim-posix.adb \
1126     s-taprop.adb<s-taprop-lynxos.adb \
1127     s-taspri.ads<s-taspri-lynxos.ads \
1128     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1129     system.ads<system-lynxos-x86.ads
1130
1131     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1132
1133   else
1134     LIBGNAT_TARGET_PAIRS = \
1135     a-intnam.ads<a-intnam-lynxos.ads \
1136     g-soccon.ads<g-soccon-lynxos.ads \
1137     g-sttsne.adb<g-sttsne-locking.adb \
1138     g-sttsne.ads<g-sttsne-locking.ads \
1139     s-inmaop.adb<s-inmaop-posix.adb \
1140     s-intman.adb<s-intman-posix.adb \
1141     s-osinte.adb<s-osinte-lynxos.adb \
1142     s-osinte.ads<s-osinte-lynxos.ads \
1143     s-osprim.adb<s-osprim-posix.adb \
1144     s-taprop.adb<s-taprop-lynxos.adb \
1145     s-taspri.ads<s-taspri-lynxos.ads \
1146     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1147     system.ads<system-lynxos-ppc.ads
1148   endif
1149 endif
1150
1151 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1152   LIBGNAT_TARGET_PAIRS = \
1153   system.ads<system-rtems.ads \
1154   a-intnam.ads<a-intnam-rtems.ads \
1155   s-inmaop.adb<s-inmaop-posix.adb \
1156   s-intman.adb<s-intman-posix.adb \
1157   s-osinte.adb<s-osinte-rtems.adb \
1158   s-osinte.ads<s-osinte-rtems.ads \
1159   s-osprim.adb<s-osprim-posix.adb \
1160   s-parame.adb<s-parame-rtems.adb \
1161   s-taprop.adb<s-taprop-posix.adb \
1162   s-taspri.ads<s-taspri-posix.ads \
1163   s-tpopsp.adb<s-tpopsp-rtems.adb \
1164   g-soccon.ads<g-soccon-rtems.ads \
1165   s-stchop.adb<s-stchop-rtems.adb
1166 endif
1167
1168 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1169   LIBGNAT_TARGET_PAIRS = \
1170   a-intnam.ads<a-intnam-tru64.ads \
1171   s-inmaop.adb<s-inmaop-posix.adb \
1172   s-intman.adb<s-intman-posix.adb \
1173   s-mastop.adb<s-mastop-tru64.adb \
1174   s-osinte.adb<s-osinte-tru64.adb \
1175   s-osinte.ads<s-osinte-tru64.ads \
1176   s-osprim.adb<s-osprim-unix.adb \
1177   s-taprop.adb<s-taprop-tru64.adb \
1178   s-tasinf.ads<s-tasinf-tru64.ads \
1179   s-taspri.ads<s-taspri-tru64.ads \
1180   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1181   s-traceb.adb<s-traceb-mastop.adb \
1182   g-soccon.ads<g-soccon-tru64.ads \
1183   system.ads<system-tru64.ads
1184
1185   TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-tru64.adb
1186
1187   EH_MECHANISM=-gcc
1188   GMEM_LIB=gmemlib
1189   THREADSLIB = -lpthread -lmach -lexc -lrt
1190   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1191   GNATLIB_SHARED = gnatlib-shared-default
1192   LIBRARY_VERSION := $(LIB_VERSION)
1193 endif
1194
1195 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
1196
1197 soext  = .exe
1198 hyphen = _
1199 LN = cp -p
1200 LN_S = cp -p
1201
1202 .SUFFIXES: .sym
1203
1204 .o.sym: 
1205         @ gnu:[bin]vmssymvec $<
1206 endif
1207
1208 ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1209 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1210   LIBGNAT_TARGET_PAIRS_AUX1 = \
1211   g-enblsp.adb<g-enblsp-vms-ia64.adb \
1212   g-trasym.adb<g-trasym-vms-ia64.adb \
1213   s-asthan.adb<s-asthan-vms-ia64.adb \
1214   s-osinte.adb<s-osinte-vms-ia64.adb \
1215   s-osinte.ads<s-osinte-vms-ia64.ads \
1216   s-vaflop.adb<s-vaflop-vms-ia64.adb \
1217   system.ads<system-vms-ia64.ads
1218
1219   LIBGNAT_TARGET_PAIRS_AUX2 = \
1220   s-parame.ads<s-parame-vms-ia64.ads
1221 else
1222 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1223   LIBGNAT_TARGET_PAIRS_AUX1 = \
1224   g-enblsp.adb<g-enblsp-vms-alpha.adb \
1225   g-trasym.adb<g-trasym-vms-alpha.adb \
1226   s-traent.adb<s-traent-vms.adb \
1227   s-traent.ads<s-traent-vms.ads \
1228   s-asthan.adb<s-asthan-vms-alpha.adb \
1229   s-osinte.adb<s-osinte-vms.adb \
1230   s-osinte.ads<s-osinte-vms.ads \
1231   s-vaflop.adb<s-vaflop-vms-alpha.adb \
1232   system.ads<system-vms_64.ads
1233
1234 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1235   LIBGNAT_TARGET_PAIRS_AUX2 = \
1236   s-parame.ads<s-parame-vms-restrict.ads
1237 else
1238   LIBGNAT_TARGET_PAIRS_AUX2 = \
1239   s-parame.ads<s-parame-vms-alpha.ads
1240 endif
1241 endif
1242 endif
1243
1244   LIBGNAT_TARGET_PAIRS = \
1245   a-caldel.adb<a-caldel-vms.adb \
1246   a-calend.adb<a-calend-vms.adb \
1247   a-calend.ads<a-calend-vms.ads \
1248   a-dirval.adb<a-dirval-vms.adb \
1249   a-excpol.adb<a-excpol-abort.adb \
1250   a-intnam.ads<a-intnam-vms.ads \
1251   a-numaux.ads<a-numaux-vms.ads \
1252   g-expect.adb<g-expect-vms.adb \
1253   g-soccon.ads<g-soccon-vms.ads \
1254   g-socthi.ads<g-socthi-vms.ads \
1255   g-socthi.adb<g-socthi-vms.adb \
1256   g-stsifd.adb<g-stsifd-sockets.adb \
1257   g-sttsne.adb<g-sttsne-locking.adb \
1258   g-sttsne.ads<g-sttsne-locking.ads \
1259   i-c.ads<i-c-vms_64.ads \
1260   i-cstrin.ads<i-cstrin-vms_64.ads \
1261   i-cstrin.adb<i-cstrin-vms_64.adb \
1262   i-cpoint.ads<i-cpoint-vms_64.ads \
1263   i-cpoint.adb<i-cpoint-vms_64.adb \
1264   i-cstrea.adb<i-cstrea-vms.adb \
1265   memtrack.adb<memtrack-vms_64.adb \
1266   s-auxdec.ads<s-auxdec-vms_64.ads \
1267   s-crtl.ads<s-crtl-vms_64.ads \
1268   s-inmaop.adb<s-inmaop-vms.adb \
1269   s-interr.adb<s-interr-vms.adb \
1270   s-intman.adb<s-intman-vms.adb \
1271   s-intman.ads<s-intman-vms.ads \
1272   s-memory.adb<s-memory-vms_64.adb \
1273   s-memory.ads<s-memory-vms_64.ads \
1274   s-osprim.adb<s-osprim-vms.adb \
1275   s-osprim.ads<s-osprim-vms.ads \
1276   s-taprop.adb<s-taprop-vms.adb \
1277   s-taspri.ads<s-taspri-vms.ads \
1278   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1279   s-tpopde.adb<s-tpopde-vms.adb \
1280   s-tpopde.ads<s-tpopde-vms.ads \
1281   $(LIBGNAT_TARGET_PAIRS_AUX1) \
1282   $(LIBGNAT_TARGET_PAIRS_AUX2)
1283
1284 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1285   TOOLS_TARGET_PAIRS= \
1286   mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
1287   symbols.adb<symbols-vms.adb \
1288   symbols-processing.adb<symbols-processing-vms-ia64.adb
1289 else
1290   TOOLS_TARGET_PAIRS= \
1291   mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
1292   symbols.adb<symbols-vms.adb \
1293   symbols-processing.adb<symbols-processing-vms-alpha.adb
1294 endif
1295
1296 adamsg.o: adamsg.msg
1297         -$(DECC) --cc=message adamsg.msg -o adamsg.o
1298
1299   EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
1300
1301   GMEM_LIB = gmemlib
1302   EH_MECHANISM=-gcc
1303   GNATLIB_SHARED=gnatlib-shared-vms
1304 ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
1305   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1306   EXTRA_LIBGNAT_OBJS=vmshandler.o
1307 endif
1308   EXTRA_LIBGNAT_SRCS+=adamsg.msg
1309   EXTRA_LIBGNAT_OBJS+=adamsg.o
1310   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1311   EXTRA_GNATTOOLS = \
1312      ../../gnatlbr$(exeext)  \
1313      ../../gnatsym$(exeext)  \
1314      ../../vms_help$(exeext) \
1315      ../../gnat.hlp
1316   # This command transforms (YYYYMMDD) into YY,MMDD
1317   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
1318   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1319   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1320 endif
1321
1322 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1323   LIBGNAT_TARGET_PAIRS = \
1324   a-dirval.adb<a-dirval-mingw.adb \
1325   a-excpol.adb<a-excpol-abort.adb \
1326   a-numaux.adb<a-numaux-x86.adb \
1327   a-numaux.ads<a-numaux-x86.ads \
1328   s-gloloc.adb<s-gloloc-mingw.adb \
1329   s-inmaop.adb<s-inmaop-dummy.adb \
1330   s-memory.adb<s-memory-mingw.adb \
1331   s-taspri.ads<s-taspri-mingw.ads \
1332   s-tasinf.adb<s-tasinf-mingw.adb \
1333   s-tasinf.ads<s-tasinf-mingw.ads \
1334   g-bytswa.adb<g-bytswa-x86.adb \
1335   g-socthi.ads<g-socthi-mingw.ads \
1336   g-socthi.adb<g-socthi-mingw.adb \
1337   g-stsifd.adb<g-stsifd-sockets.adb \
1338   g-soccon.ads<g-soccon-mingw.ads \
1339   g-soliop.ads<g-soliop-mingw.ads
1340
1341   ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
1342     LIBGNAT_TARGET_PAIRS += \
1343     s-intman.adb<s-intman-dummy.adb \
1344     s-osinte.ads<s-osinte-rtx.ads \
1345     s-osprim.adb<s-osprim-rtx.adb \
1346     s-taprop.adb<s-taprop-rtx.adb \
1347     system.ads<system-rtx.ads
1348
1349     EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
1350
1351     MISCLIB = -lwsock32 -lrtapi_w32
1352     THREADSLIB=-lrtapi_w32
1353   else
1354     LIBGNAT_TARGET_PAIRS += \
1355     a-exetim.adb<a-exetim-mingw.adb \
1356     a-exetim.ads<a-exetim-mingw.ads \
1357     a-intnam.ads<a-intnam-mingw.ads \
1358     g-sercom.adb<g-sercom-mingw.adb \
1359     s-interr.adb<s-interr-sigaction.adb \
1360     s-intman.adb<s-intman-mingw.adb \
1361     s-osinte.ads<s-osinte-mingw.ads \
1362     s-osprim.adb<s-osprim-mingw.adb \
1363     s-taprop.adb<s-taprop-mingw.adb \
1364     system.ads<system-mingw.ads
1365
1366     EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o s-win32.o g-regist.o
1367     EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
1368
1369     MISCLIB = -lwsock32
1370
1371     # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
1372     # auto-import support for array/record will be done.
1373     GNATLIB_SHARED = gnatlib-shared-win32
1374   endif
1375
1376   TOOLS_TARGET_PAIRS= \
1377   mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
1378   indepsw.adb<indepsw-mingw.adb
1379
1380   EH_MECHANISM=-gcc
1381   GMEM_LIB = gmemlib
1382   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1383   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1384   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1385   soext = .dll
1386   LIBRARY_VERSION := $(LIB_VERSION)
1387 endif
1388
1389 ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
1390   LIBGNAT_TARGET_PAIRS = \
1391   a-intnam.ads<a-intnam-linux.ads \
1392   g-soccon.ads<g-soccon-linux-mips.ads \
1393   s-inmaop.adb<s-inmaop-posix.adb \
1394   s-intman.adb<s-intman-posix.adb \
1395   s-linux.ads<s-linux.ads \
1396   s-osinte.adb<s-osinte-posix.adb \
1397   s-osinte.ads<s-osinte-linux.ads \
1398   s-osprim.adb<s-osprim-posix.adb \
1399   s-taprop.adb<s-taprop-linux.adb \
1400   s-tasinf.ads<s-tasinf-linux.ads \
1401   s-tasinf.adb<s-tasinf-linux.adb \
1402   s-taspri.ads<s-taspri-posix.ads \
1403   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1404   system.ads<system-linux-mips.ads
1405
1406   EH_MECHANISM=-gcc
1407   THREADSLIB = -lpthread
1408   GNATLIB_SHARED = gnatlib-shared-dual
1409   GMEM_LIB = gmemlib
1410   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1411   LIBRARY_VERSION := $(LIB_VERSION)
1412 endif
1413
1414 ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
1415   LIBGNAT_TARGET_PAIRS = \
1416   a-intnam.ads<a-intnam-linux.ads \
1417   g-soccon.ads<g-soccon-linux-mips.ads \
1418   s-inmaop.adb<s-inmaop-posix.adb \
1419   s-intman.adb<s-intman-posix.adb \
1420   s-linux.ads<s-linux.ads \
1421   s-osinte.adb<s-osinte-posix.adb \
1422   s-osinte.ads<s-osinte-linux.ads \
1423   s-osprim.adb<s-osprim-posix.adb \
1424   s-taprop.adb<s-taprop-linux.adb \
1425   s-tasinf.ads<s-tasinf-linux.ads \
1426   s-tasinf.adb<s-tasinf-linux.adb \
1427   s-taspri.ads<s-taspri-posix.ads \
1428   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1429   system.ads<system-linux-mipsel.ads
1430
1431   EH_MECHANISM=-gcc
1432   THREADSLIB = -lpthread
1433   GNATLIB_SHARED = gnatlib-shared-dual
1434   GMEM_LIB = gmemlib
1435   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1436   LIBRARY_VERSION := $(LIB_VERSION)
1437 endif
1438
1439 ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
1440   LIBGNAT_TARGET_PAIRS = \
1441   a-intnam.ads<a-intnam-linux.ads \
1442   g-soccon.ads<g-soccon-linux-ppc.ads \
1443   s-inmaop.adb<s-inmaop-posix.adb \
1444   s-intman.adb<s-intman-posix.adb \
1445   s-linux.ads<s-linux.ads \
1446   s-osinte.adb<s-osinte-posix.adb \
1447   s-osinte.ads<s-osinte-linux.ads \
1448   s-osprim.adb<s-osprim-posix.adb \
1449   s-taprop.adb<s-taprop-linux.adb \
1450   s-tasinf.ads<s-tasinf-linux.ads \
1451   s-tasinf.adb<s-tasinf-linux.adb \
1452   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1453   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1454   g-sercom.adb<g-sercom-linux.adb \
1455   system.ads<system-linux-ppc.ads
1456
1457   TOOLS_TARGET_PAIRS =  \
1458     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1459     indepsw.adb<indepsw-gnu.adb
1460
1461   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1462   EH_MECHANISM=-gcc
1463   THREADSLIB = -lpthread
1464   GNATLIB_SHARED = gnatlib-shared-dual
1465   GMEM_LIB = gmemlib
1466   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1467   LIBRARY_VERSION := $(LIB_VERSION)
1468 endif
1469
1470 ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
1471   LIBGNAT_TARGET_PAIRS = \
1472   a-intnam.ads<a-intnam-linux.ads \
1473   s-inmaop.adb<s-inmaop-posix.adb \
1474   s-intman.adb<s-intman-posix.adb \
1475   s-linux.ads<s-linux.ads \
1476   s-osinte.adb<s-osinte-posix.adb \
1477   s-osinte.ads<s-osinte-linux.ads \
1478   s-osprim.adb<s-osprim-posix.adb \
1479   s-taprop.adb<s-taprop-linux.adb \
1480   s-tasinf.ads<s-tasinf-linux.ads \
1481   s-tasinf.adb<s-tasinf-linux.adb \
1482   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1483   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1484   system.ads<system-linux-sparc.ads
1485
1486   TOOLS_TARGET_PAIRS =  \
1487     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1488     indepsw.adb<indepsw-gnu.adb
1489
1490   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1491   EH_MECHANISM=-gcc
1492   THREADSLIB = -lpthread
1493   GNATLIB_SHARED = gnatlib-shared-dual
1494   GMEM_LIB = gmemlib
1495   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1496   LIBRARY_VERSION := $(LIB_VERSION)
1497 endif
1498
1499 ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
1500   LIBGNAT_TARGET_PAIRS = \
1501   a-intnam.ads<a-intnam-linux.ads \
1502   s-inmaop.adb<s-inmaop-posix.adb \
1503   s-intman.adb<s-intman-posix.adb \
1504   s-linux.ads<s-linux-hppa.ads \
1505   s-osinte.adb<s-osinte-posix.adb \
1506   s-osinte.ads<s-osinte-linux.ads \
1507   s-osprim.adb<s-osprim-posix.adb \
1508   s-taprop.adb<s-taprop-linux.adb \
1509   s-tasinf.ads<s-tasinf-linux.ads \
1510   s-tasinf.adb<s-tasinf-linux.adb \
1511   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1512   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1513   system.ads<system-linux-hppa.ads
1514
1515   TOOLS_TARGET_PAIRS =  \
1516     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1517     indepsw.adb<indepsw-gnu.adb
1518
1519   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1520   EH_MECHANISM=-gcc
1521   THREADSLIB = -lpthread
1522   GNATLIB_SHARED = gnatlib-shared-dual
1523   GMEM_LIB = gmemlib
1524   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1525   LIBRARY_VERSION := $(LIB_VERSION)
1526 endif
1527
1528 ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
1529   LIBGNAT_TARGET_PAIRS = \
1530   a-intnam.ads<a-intnam-linux.ads \
1531   s-inmaop.adb<s-inmaop-posix.adb \
1532   s-intman.adb<s-intman-posix.adb \
1533   s-osinte.adb<s-osinte-posix.adb \
1534   s-osinte.ads<s-osinte-linux.ads \
1535   s-osprim.adb<s-osprim-posix.adb \
1536   s-taprop.adb<s-taprop-linux.adb \
1537   s-tasinf.ads<s-tasinf-linux.ads \
1538   s-tasinf.adb<s-tasinf-linux.adb \
1539   s-taspri.ads<s-taspri-posix.ads \
1540   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1541   system.ads<system-linux-sh4.ads
1542
1543   TOOLS_TARGET_PAIRS =  \
1544     mlib-tgt-specific.adb<mlib-tgt-linux.adb \
1545     indepsw.adb<indepsw-linux.adb
1546
1547   EH_MECHANISM=-gcc
1548   MISCLIB=
1549   THREADSLIB = -lpthread
1550   GNATLIB_SHARED = gnatlib-shared-dual
1551   GMEM_LIB = gmemlib
1552   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1553   LIBRARY_VERSION := $(LIB_VERSION)
1554 endif
1555
1556 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1557   LIBGNAT_TARGET_PAIRS = \
1558   a-intnam.ads<a-intnam-linux.ads \
1559   a-numaux.ads<a-numaux-libc-x86.ads \
1560   g-soccon.ads<g-soccon-linux-64.ads \
1561   s-inmaop.adb<s-inmaop-posix.adb \
1562   s-intman.adb<s-intman-posix.adb \
1563   s-linux.ads<s-linux.ads \
1564   s-osinte.ads<s-osinte-linux.ads \
1565   s-osinte.adb<s-osinte-posix.adb \
1566   s-osprim.adb<s-osprim-posix.adb \
1567   s-taprop.adb<s-taprop-linux.adb \
1568   s-tasinf.ads<s-tasinf-linux.ads \
1569   s-tasinf.adb<s-tasinf-linux.adb \
1570   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1571   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1572   g-sercom.adb<g-sercom-linux.adb \
1573   system.ads<system-linux-ia64.ads
1574
1575   TOOLS_TARGET_PAIRS =  \
1576     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1577     indepsw.adb<indepsw-gnu.adb
1578
1579   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1580   EH_MECHANISM=-gcc
1581   MISCLIB=
1582   THREADSLIB=-lpthread
1583   GNATLIB_SHARED=gnatlib-shared-dual
1584   GMEM_LIB = gmemlib
1585   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1586   LIBRARY_VERSION := $(LIB_VERSION)
1587 endif
1588
1589 ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
1590   LIBGNAT_TARGET_PAIRS = \
1591   a-intnam.ads<a-intnam-linux.ads \
1592   s-inmaop.adb<s-inmaop-posix.adb \
1593   s-intman.adb<s-intman-posix.adb \
1594   s-linux.ads<s-linux-alpha.ads \
1595   s-osinte.ads<s-osinte-linux.ads \
1596   s-osinte.adb<s-osinte-posix.adb \
1597   s-osprim.adb<s-osprim-posix.adb \
1598   s-taprop.adb<s-taprop-linux.adb \
1599   s-tasinf.ads<s-tasinf-linux.ads \
1600   s-tasinf.adb<s-tasinf-linux.adb \
1601   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1602   s-taspri.ads<s-taspri-posix-noaltstack.ads \
1603   system.ads<system-linux-alpha.ads
1604
1605   TOOLS_TARGET_PAIRS =  \
1606     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1607     indepsw.adb<indepsw-gnu.adb
1608
1609   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1610   EH_MECHANISM=-gcc
1611   MISCLIB=
1612   THREADSLIB=-lpthread
1613   GNATLIB_SHARED=gnatlib-shared-dual
1614   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1615   LIBRARY_VERSION := $(LIB_VERSION)
1616 endif
1617
1618 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1619   LIBGNAT_TARGET_PAIRS = \
1620   a-intnam.ads<a-intnam-linux.ads \
1621   a-numaux.adb<a-numaux-x86.adb \
1622   a-numaux.ads<a-numaux-x86.ads \
1623   g-soccon.ads<g-soccon-linux-64.ads \
1624   s-inmaop.adb<s-inmaop-posix.adb \
1625   s-intman.adb<s-intman-posix.adb \
1626   s-linux.ads<s-linux.ads \
1627   s-osinte.ads<s-osinte-linux.ads \
1628   s-osinte.adb<s-osinte-posix.adb \
1629   s-osprim.adb<s-osprim-posix.adb \
1630   s-taprop.adb<s-taprop-linux.adb \
1631   s-tasinf.ads<s-tasinf-linux.ads \
1632   s-tasinf.adb<s-tasinf-linux.adb \
1633   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1634   s-taspri.ads<s-taspri-posix.ads \
1635   g-sercom.adb<g-sercom-linux.adb \
1636   system.ads<system-linux-x86_64.ads
1637
1638   TOOLS_TARGET_PAIRS =  \
1639     mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
1640     indepsw.adb<indepsw-gnu.adb
1641
1642   EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
1643   EH_MECHANISM=-gcc
1644   THREADSLIB=-lpthread
1645   GNATLIB_SHARED=gnatlib-shared-dual
1646   GMEM_LIB = gmemlib
1647   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1648   LIBRARY_VERSION := $(LIB_VERSION)
1649 endif
1650
1651 ifeq ($(strip $(filter-out darwin%,$(osys))),)
1652   ifeq ($(strip $(filter-out %86,$(arch))),)
1653     LIBGNAT_TARGET_PAIRS = \
1654     a-intnam.ads<a-intnam-darwin.ads \
1655     s-inmaop.adb<s-inmaop-posix.adb \
1656     s-intman.adb<s-intman-posix.adb \
1657     s-osinte.adb<s-osinte-darwin.adb \
1658     s-osinte.ads<s-osinte-darwin.ads \
1659     s-osprim.adb<s-osprim-posix.adb \
1660     s-taprop.adb<s-taprop-posix.adb \
1661     s-taspri.ads<s-taspri-posix.ads \
1662     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1663     g-soccon.ads<g-soccon-darwin.ads \
1664     a-numaux.ads<a-numaux-x86.ads \
1665     a-numaux.adb<a-numaux-x86.adb \
1666     system.ads<system-darwin-x86.ads
1667   else
1668     LIBGNAT_TARGET_PAIRS = \
1669     a-intnam.ads<a-intnam-darwin.ads \
1670     s-inmaop.adb<s-inmaop-posix.adb \
1671     s-intman.adb<s-intman-posix.adb \
1672     s-osinte.adb<s-osinte-darwin.adb \
1673     s-osinte.ads<s-osinte-darwin.ads \
1674     s-osprim.adb<s-osprim-posix.adb \
1675     s-taprop.adb<s-taprop-posix.adb \
1676     s-taspri.ads<s-taspri-posix.ads \
1677     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1678     g-soccon.ads<g-soccon-darwin.ads \
1679     a-numaux.ads<a-numaux-darwin.ads \
1680     a-numaux.adb<a-numaux-darwin.adb \
1681     system.ads<system-darwin-ppc.ads
1682   endif
1683
1684   TOOLS_TARGET_PAIRS =  \
1685     mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb
1686
1687   EH_MECHANISM=-gcc
1688   GNATLIB_SHARED = gnatlib-shared-darwin
1689   SO_OPTS = -Wl,-flat_namespace -shared-libgcc
1690   RANLIB = ranlib -c
1691   GMEM_LIB = gmemlib
1692   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1693   LIBRARY_VERSION := $(LIB_VERSION)
1694   soext = .dylib
1695 endif
1696
1697 ifneq ($(EH_MECHANISM),)
1698   LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
1699   EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
1700   EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
1701 endif
1702
1703 # Use the Ada 2005 version of Ada.Exceptions by default, unless specified
1704 # explicitly already. The base files (a-except.ad?) are used only for building
1705 # the compiler and other basic tools.
1706 # These base versions lack Ada 2005 additions which would cause bootstrap
1707 # problems if included in the compiler and other basic tools.
1708
1709 ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
1710   LIBGNAT_TARGET_PAIRS += \
1711     a-except.ads<a-except-2005.ads \
1712     a-except.adb<a-except-2005.adb
1713 endif
1714
1715 # The runtime library for gnat comprises two directories.  One contains the
1716 # Ada source files that the compiler (gnat1) needs -- these files are listed
1717 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1718 # corresponding .ali files for the parts written in Ada, libgnat.a for
1719 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1720 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1721 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1722 # go into the directory.  The pthreads emulation is built in the threads
1723 # subdirectory and copied.
1724 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1725   errno.c exit.c cal.c ctrl_c.c env.c env.h \
1726   raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
1727   final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
1728   socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
1729
1730 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
1731   raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o \
1732   final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
1733
1734 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1735 #  the library installation will change and there will be a
1736 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1737 #  from ADA_INCLUDE_SRCS.
1738
1739 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1740 # the following include file:
1741
1742 include $(fsrcdir)/Makefile.rtl
1743
1744 GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o a-nllrar.o a-nlrear.o \
1745   a-nucoar.o a-nurear.o i-forbla.o i-forlap.o s-gearop.o
1746
1747 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1748   $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
1749
1750 # Default run time files
1751
1752 ADA_INCLUDE_SRCS =\
1753  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1754  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1755  sequenio.ads system.ads memtrack.adb \
1756  a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
1757  s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads  
1758
1759 LIBGNAT=../rts/libgnat.a 
1760
1761 GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
1762
1763 # when compiling the tools, the runtime has to be first on the path so that
1764 # it hides the runtime files lying with the rest of the sources
1765 ifeq ($(TOOLSCASE),native)
1766   vpath %.ads ../rts ../
1767   vpath %.adb ../rts ../
1768   vpath %.c   ../rts ../
1769   vpath %.h   ../rts ../
1770 endif
1771
1772 # in the cross tools case, everything is compiled with the native 
1773 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1774 ifeq ($(TOOLSCASE),cross)
1775   vpath %.ads ../
1776   vpath %.adb ../
1777   vpath %.c   ../
1778   vpath %.h   ../
1779 endif
1780
1781 ../../gnatchop$(exeext): 
1782         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1783         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1784         $(GNATLINK) -v gnatchop -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1785
1786 ../../gnat$(exeext): 
1787         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1788         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1789         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1790
1791 ../../gnatkr$(exeext): 
1792         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1793         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1794         $(GNATLINK) -v gnatkr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1795
1796 ../../gnatls$(exeext): 
1797         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1798         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1799         $(GNATLINK) -v gnatls -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1800
1801 ../../gnatname$(exeext): 
1802         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1803         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1804         $(GNATLINK) -v gnatname -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1805
1806 ../../gprmake$(exeext): 
1807         $(GNATMAKE) -c $(ADA_INCLUDES) gprmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1808         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprmake
1809         $(GNATLINK) -v gprmake -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1810
1811 ../../gnatprep$(exeext): 
1812         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1813         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1814         $(GNATLINK) -v gnatprep -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1815
1816 ../../gnatxref$(exeext): 
1817         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1818         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1819         $(GNATLINK) -v gnatxref -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1820
1821 ../../gnatfind$(exeext): 
1822         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1823         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1824         $(GNATLINK) -v gnatfind -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1825
1826 ../../gnatclean$(exeext): 
1827         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1828         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1829         $(GNATLINK) -v gnatclean -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1830
1831 ../../gnatsym$(exeext): 
1832         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1833         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1834         $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1835
1836 ../../gnatdll$(exeext): 
1837         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1838         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1839         $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1840
1841 ../../vxaddr2line$(exeext): targext.o
1842         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1843         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1844         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
1845
1846 gnatmake-re:  link.o targext.o
1847         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1848         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1849         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1850         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1851                 --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1852
1853 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1854 # with the former version of gnatlink itself which cannot override itself.
1855 gnatlink-re:  link.o targext.o
1856         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1857         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1858         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1859                     --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
1860         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1861   
1862 # Needs to be built with CC=gcc
1863 # Since the RTL should be built with the latest compiler, remove the
1864 #  stamp target in the parent directory whenever gnat1 is rebuilt
1865
1866 # Likewise for the tools
1867 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
1868         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1869                     $(TOOLS_LIBS)
1870
1871 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
1872         $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1873                     $(TOOLS_LIBS)
1874
1875 ../stamp-gnatlib:
1876         @if [ ! -f stamp-gnatlib ] ; \
1877         then \
1878           $(ECHO) You must first build the GNAT library: make gnatlib; \
1879           false; \
1880         else \
1881           true; \
1882         fi
1883
1884 install-gnatlib: ../stamp-gnatlib
1885 #       Create the directory before deleting it, in case the directory is
1886 #       a list of directories (as it may be on VMS). This ensures we are
1887 #       deleting the right one.
1888         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1889         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1890         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1891         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1892         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1893         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1894         for file in rts/*.ali; do \
1895             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1896         done
1897         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1898         -cd rts; for file in *$(arext);do \
1899             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1900             $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
1901         done
1902         -$(foreach file, $(EXTRA_ADALIB_FILES), \
1903             $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1904         ) true
1905 #     Install the shared libraries, if any, using $(INSTALL) instead
1906 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1907 #     for shared libraries on some targets, e.g. on HP-UX where the x
1908 #     permission is required.
1909         for file in gnat gnarl; do \
1910            if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
1911               $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1912                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1913            fi; \
1914            if [ -f rts/lib$${file}$(soext) ]; then \
1915               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1916               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
1917            fi; \
1918         done
1919 # This copy must be done preserving the date on the original file.
1920         for file in rts/*.ad?; do \
1921             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1922         done
1923         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1924         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1925
1926 ../stamp-gnatlib2:
1927         $(RM) rts/s-*.ali
1928         $(RM) rts/s-*$(objext)
1929         $(RM) rts/a-*.ali
1930         $(RM) rts/a-*$(objext)
1931         $(RM) rts/*.ali
1932         $(RM) rts/*$(objext)
1933         $(RM) rts/*$(arext)
1934         $(RM) rts/*$(soext)
1935         touch ../stamp-gnatlib2
1936         $(RM) ../stamp-gnatlib
1937
1938 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1939 #       successive target commands. Although the Gnu make documentation
1940 #       implies this is true on all systems, I suspect it may not be, So care
1941 #       has been taken to allow a sed script to look for ";)" and substitue
1942 #       for ";" the appropriate character in the range of lines below
1943 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1944
1945 # GNULLI Begin ###########################################################
1946
1947 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1948         $(RMDIR) rts
1949         $(MKDIR) rts
1950         $(CHMOD) u+w rts
1951 # Copy target independent sources
1952         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1953           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1954 # Remove files to be replaced by target dependent sources
1955         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1956                         rts/$(word 1,$(subst <, ,$(PAIR))))
1957         $(RM) rts/*-*-*.ads rts/*-*-*.adb
1958 # Copy new target dependent sources
1959         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1960                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1961                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1962         $(RM) ../stamp-gnatlib
1963         touch ../stamp-gnatlib1
1964
1965 # GNULLI End #############################################################
1966
1967 # Don't use semicolon separated shell commands that involve list expansions.
1968 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1969 # line lengths in excess of 256 characters.
1970 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1971 # is guaranteed to overflow the buffer.
1972
1973 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1974         $(MAKE) -C rts \
1975                 CC="`echo \"$(GCC_FOR_TARGET)\" \
1976                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
1977                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1978                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1979                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
1980                 srcdir=$(fsrcdir) \
1981                 -f ../Makefile $(LIBGNAT_OBJS)
1982         $(MAKE) -C rts \
1983                 CC="`echo \"$(GCC_FOR_TARGET)\" \
1984                 | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
1985                 ADA_INCLUDES="" \
1986                 CFLAGS="$(GNATLIBCFLAGS)" \
1987                 ADAFLAGS="$(GNATLIBFLAGS)" \
1988                 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
1989                 srcdir=$(fsrcdir) \
1990                 -f ../Makefile \
1991                 $(GNATRTL_OBJS)
1992         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1993         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
1994            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1995         ifneq ($(PREFIX_OBJS),)
1996                 $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
1997                   $(PREFIX_OBJS);
1998                 $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
1999         endif
2000         $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
2001         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
2002            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
2003         $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
2004         $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnala$(arext) \
2005            $(addprefix rts/,$(GNATRTL_LINEARALGEBRA_OBJS))
2006         $(RANLIB_FOR_TARGET) rts/libgnala$(arext)
2007         ifeq ($(GMEM_LIB),gmemlib)
2008                 $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
2009                   rts/memtrack.o
2010                 $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
2011         endif
2012         $(CHMOD) a-wx rts/*.ali
2013         touch ../stamp-gnatlib
2014
2015 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
2016 gnatlib-shared-default:
2017         $(MAKE) $(FLAGS_TO_PASS) \
2018              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2019              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2020              THREAD_KIND="$(THREAD_KIND)" \
2021              gnatlib
2022         $(RM) rts/libgna*$(soext)
2023         cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
2024                 $(TARGET_LIBGCC2_CFLAGS) \
2025                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2026                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2027                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2028                 $(MISCLIB) -lm
2029         cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
2030                 $(TARGET_LIBGCC2_CFLAGS) \
2031                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2032                 $(GNATRTL_TASKING_OBJS) \
2033                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2034                 $(THREADSLIB)
2035         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2036                 libgnat$(soext)
2037         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2038                 libgnarl$(soext)
2039
2040 gnatlib-shared-dual:
2041         $(MAKE) $(FLAGS_TO_PASS) \
2042              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2043              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2044              THREAD_KIND="$(THREAD_KIND)" \
2045              gnatlib-shared-default
2046         $(MV) rts/libgna*$(soext) .
2047         $(RM) ../stamp-gnatlib2
2048         $(MAKE) $(FLAGS_TO_PASS) \
2049              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2050              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2051              THREAD_KIND="$(THREAD_KIND)" \
2052              gnatlib
2053         $(MV) libgna*$(soext) rts
2054
2055 gnatlib-shared-dual-win32:
2056         $(MAKE) $(FLAGS_TO_PASS) \
2057              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2058              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2059              THREAD_KIND="$(THREAD_KIND)" \
2060              gnatlib-shared-win32
2061         $(MV) rts/libgna*$(soext) .
2062         $(RM) ../stamp-gnatlib2
2063         $(MAKE) $(FLAGS_TO_PASS) \
2064              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2065              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2066              THREAD_KIND="$(THREAD_KIND)" \
2067              gnatlib
2068         $(MV) libgna*$(soext) rts
2069
2070 # ??? we need to add the option to support auto-import of arrays/records to
2071 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
2072 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
2073 # Windows.
2074 gnatlib-shared-win32:
2075         $(MAKE) $(FLAGS_TO_PASS) \
2076              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2077              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
2078              THREAD_KIND="$(THREAD_KIND)" \
2079              gnatlib
2080         $(RM) rts/libgna*$(soext)
2081         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2082                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2083                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2084                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
2085         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
2086                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2087                 $(GNATRTL_TASKING_OBJS) \
2088                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2089                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2090
2091 gnatlib-shared-darwin:
2092         $(MAKE) $(FLAGS_TO_PASS) \
2093              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2094              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
2095                             -fno-common" \
2096              THREAD_KIND="$(THREAD_KIND)" \
2097              gnatlib
2098         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
2099         cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
2100                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2101                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
2102                 $(SO_OPTS) \
2103                 $(MISCLIB) -lm
2104         cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
2105                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2106                 $(GNATRTL_TASKING_OBJS) \
2107                 $(SO_OPTS) \
2108                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
2109         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2110                 libgnat$(soext)
2111         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2112                 libgnarl$(soext)
2113
2114 gnatlib-shared-vms:
2115         $(MAKE) $(FLAGS_TO_PASS) \
2116              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2117              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2118              THREAD_KIND="$(THREAD_KIND)" \
2119              gnatlib
2120         $(RM) rts/libgna*$(soext)
2121         cd rts && \
2122         ../../gnatsym -s SYMVEC_$$$$.opt \
2123         $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
2124         ../../xgcc -g -B../../ -shared -shared-libgcc \
2125            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
2126            sys\$$library:trace.exe \
2127            --for-linker=/noinform \
2128            --for-linker=SYMVEC_$$$$.opt \
2129            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2130         cd rts && \
2131         ../../gnatsym -s SYMVEC_$$$$.opt \
2132         $(GNATRTL_TASKING_OBJS) && \
2133         ../../xgcc -g -B../../ -shared -shared-libgcc \
2134            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
2135            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
2136            sys\$$library:trace.exe \
2137            --for-linker=/noinform \
2138            --for-linker=SYMVEC_$$$$.opt \
2139            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
2140
2141 gnatlib-shared:
2142         $(MAKE) $(FLAGS_TO_PASS) \
2143              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2144              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2145              THREAD_KIND="$(THREAD_KIND)" \
2146              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2147              $(GNATLIB_SHARED)
2148
2149 gnatlib-sjlj:
2150         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
2151         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
2152         $(MV) rts/s.ads rts/system.ads
2153         $(MAKE) $(FLAGS_TO_PASS) \
2154              EH_MECHANISM="" \
2155              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2156              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2157              THREAD_KIND="$(THREAD_KIND)" \
2158              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2159
2160 gnatlib-zcx:
2161         $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
2162         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' rts/system.ads > rts/s.ads
2163         $(MV) rts/s.ads rts/system.ads
2164         $(MAKE) $(FLAGS_TO_PASS) \
2165              EH_MECHANISM="-gcc" \
2166              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2167              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2168              THREAD_KIND="$(THREAD_KIND)" \
2169              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
2170
2171 # .s files for cross-building
2172 gnat-cross: force
2173         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
2174
2175 # Compiling object files from source files.
2176
2177 # Note that dependencies on obstack.h are not written
2178 # because that file is not part of GCC.
2179 # Dependencies on gvarargs.h are not written
2180 # because all that file does, when not compiling with GCC,
2181 # is include the system varargs.h.
2182
2183 b_gnatl.c : $(GNATLINK_OBJS)
2184         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2185 b_gnatl.o : b_gnatl.c
2186
2187 b_gnatm.c : $(GNATMAKE_OBJS)
2188         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2189 b_gnatm.o : b_gnatm.c
2190
2191 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
2192 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
2193
2194 # force no sibling call optimization on s-traceb.o so the number of stack
2195 # frames to be skipped when computing a call chain is not modified by
2196 # optimization. However we can do that only when building the runtime
2197 # (not the compiler) because the -fno-optimize-sibling-calls option exists
2198 # only in GCC 3 and above.
2199
2200 ifneq (,$(findstring xgcc,$(CC)))
2201 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
2202 else
2203 NO_SIBLING_ADAFLAGS=
2204 endif
2205
2206 s-traceb.o  : s-traceb.adb
2207         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2208               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
2209       $< $(OUTPUT_OPTION)
2210
2211 # force debugging information on s-tasdeb.o so that it is always
2212 # possible to set conditional breakpoints on tasks.
2213
2214 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
2215         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2216               $< $(OUTPUT_OPTION)
2217
2218 # force no function reordering on a-except.o because of the exclusion bounds
2219 # mechanism (see the source file for more detailed information). However we
2220 # can do that only when building the runtime (not the compiler) because the
2221 # -fno-toplevel-reorder option exists only in GCC 4.2 and above.
2222
2223 ifneq (,$(findstring xgcc,$(CC)))
2224 NO_REORDER_ADAFLAGS=-fno-toplevel-reorder
2225 else
2226 NO_REORDER_ADAFLAGS=
2227 endif
2228
2229 # force debugging information on a-except.o so that it is always
2230 # possible to set conditional breakpoints on exceptions.
2231 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
2232
2233 a-except.o  : a-except.adb a-except.ads
2234         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
2235               $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
2236
2237 # compile s-except.o without optimization and with debug info to let the
2238 # debugger set breakpoints and inspect subprogram parameters on exception
2239 # related events.
2240
2241 s-except.o  : s-except.adb s-except.ads
2242         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2243               $< $(OUTPUT_OPTION)
2244
2245 # force debugging information on s-assert.o so that it is always
2246 # possible to set breakpoint on assert failures.
2247
2248 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
2249         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
2250               $< $(OUTPUT_OPTION)
2251
2252 adadecode.o : adadecode.c adadecode.h
2253 aux-io.o  : aux-io.c
2254 argv.o    : argv.c
2255 cal.o     : cal.c
2256 deftarg.o : deftarg.c
2257 errno.o   : errno.c
2258 exit.o    : adaint.h exit.c
2259 expect.o  : expect.c
2260 final.o   : final.c
2261 gmem.o    : gmem.c
2262 link.o    : link.c
2263 mkdir.o   : mkdir.c
2264 socket.o  : socket.c gsocket.h
2265 sysdep.o  : sysdep.c
2266 raise-gcc.o : raise-gcc.c raise.h
2267 raise.o   : raise.c raise.h
2268 vx_stack_info.o : vx_stack_info.c
2269
2270 gen-soccon: gen-soccon.c gsocket.h
2271         $(CC) $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2272                 -UIN_GCC -DTARGET=\"$(target_alias)\" \
2273                 $< $(OUTPUT_OPTION)
2274
2275 cio.o     : cio.c
2276         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2277                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2278
2279 init.o    : init.c adaint.h raise.h
2280         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2281                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2282
2283 initialize.o : initialize.c raise.h
2284         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2285                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2286
2287 targext.o : targext.c
2288         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
2289                 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
2290                 $< $(OUTPUT_OPTION)
2291
2292 # No optimization to compile this file as optimizations (-O1 or above) breaks
2293 # the SEH handling on Windows. The reasons are not clear.
2294 seh_init.o : seh_init.c raise.h
2295         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
2296                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2297
2298 # Need to keep the frame pointer in this file to pop the stack properly on
2299 # some targets.
2300 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
2301         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2302               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2303
2304 # In GNU Make, ignore whether `stage*' exists.
2305 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2306 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2307
2308 force:
2309
2310 # Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS
2311
2312 ../../gnatlbr$(exeext): ../../prefix.o
2313         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2314         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2315         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2316
2317 ../../vms_help$(exeext):
2318         $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)"
2319         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help
2320         $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
2321
2322 ../../gnat.hlp: ../../vms_help$(exeext)
2323         ../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \
2324                                 $(fsrcdir)/vms_data.ads ../../gnat.hlp