OSDN Git Service

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