OSDN Git Service

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