OSDN Git Service

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