OSDN Git Service

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