OSDN Git Service

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