OSDN Git Service

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