OSDN Git Service

2004-10-04 Chao-ying Fu <fu@mips.com>
[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 indepsw.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-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \
312  prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
313  rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
314  scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \
315  sinfo.o sinput.o sinput-c.o sinput-p.o \
316  snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \
317  table.o targparm.o tempdir.o tree_io.o types.o \
318  uintp.o  uname.o urealp.o usage.o widechar.o \
319  $(EXTRA_GNATMAKE_OBJS)
320
321 # Convert the target variable into a space separated list of architecture,
322 # manufacturer, and operating system and assign each of those to its own
323 # variable.
324
325 host:=$(subst -, ,$(host_canonical))
326 targ:=$(subst -, ,$(target))
327 arch:=$(word 1,$(targ))
328 ifeq ($(words $(targ)),2)
329   manu:=
330   osys:=$(word 2,$(targ))
331 else
332   manu:=$(word 2,$(targ))
333   osys:=$(word 3,$(targ))
334 endif
335
336 # LIBGNAT_TARGET_PAIRS is a list of pairs of filenames.
337 # The members of each pair must be separated by a '<' and no whitespace.
338 # Each pair must be separated by some amount of whitespace from the following
339 # pair.
340
341 # Non-tasking case:
342
343 LIBGNAT_TARGET_PAIRS = \
344 a-intnam.ads<a-intnam-dummy.ads \
345 s-inmaop.adb<s-inmaop-dummy.adb \
346 s-intman.adb<s-intman-dummy.adb \
347 s-osinte.ads<s-osinte-dummy.ads \
348 s-osprim.adb<s-osprim-posix.adb \
349 s-taprop.adb<s-taprop-dummy.adb \
350 s-taspri.ads<s-taspri-dummy.ads
351
352 # 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 %86 wrs vxworks,$(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   i-vxwork.ads<i-vxwork-x86.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   a-numaux.adb<a-numaux-x86.adb \
606   a-numaux.ads<a-numaux-x86.ads \
607   s-osinte.adb<s-osinte-vxworks.adb \
608   s-osinte.ads<s-osinte-vxworks.ads \
609   s-osprim.adb<s-osprim-vxworks.adb \
610   s-parame.ads<s-parame-vxworks.ads \
611   s-stchop.adb<s-stchop-vxworks.adb \
612   s-taprop.adb<s-taprop-vxworks.adb \
613   s-taspri.ads<s-taspri-vxworks.ads \
614   s-tpopsp.adb<s-tpopsp-vxworks.adb \
615   s-vxwork.ads<s-vxwork-x86.ads \
616   g-soccon.ads<g-soccon-vxworks.ads \
617   g-socthi.ads<g-socthi-vxworks.ads \
618   g-socthi.adb<g-socthi-vxworks.adb \
619   system.ads<system-vxworks-x86.ads
620
621   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
622
623   ifeq ($(strip $(filter-out yes,$(TRACE))),)
624     LIBGNAT_TARGET_PAIRS += \
625     s-traces.adb<s-traces-default.adb \
626     s-trafor.adb<s-trafor-default.adb \
627     s-trafor.ads<s-trafor-default.ads \
628     s-tratas.adb<s-tratas-default.adb \
629     s-tfsetr.adb<s-tfsetr-vxworks.adb
630   endif
631
632   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
633   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
634 endif
635
636 ifeq ($(strip $(filter-out xscale% coff wrs vx%,$(targ))),)
637   LIBGNAT_TARGET_PAIRS = \
638   a-sytaco.ads<a-sytaco-vxworks.ads \
639   a-sytaco.adb<a-sytaco-vxworks.adb \
640   a-intnam.ads<a-intnam-vxworks.ads \
641   a-numaux.ads<a-numaux-vxworks.ads \
642   s-inmaop.adb<s-inmaop-posix.adb \
643   s-interr.adb<s-interr-vxworks.adb \
644   s-intman.ads<s-intman-vxworks.ads \
645   s-intman.adb<s-intman-vxworks.adb \
646   s-osinte.adb<s-osinte-vxworks.adb \
647   s-osinte.ads<s-osinte-vxworks.ads \
648   s-osprim.adb<s-osprim-vxworks.adb \
649   s-parame.ads<s-parame-vxworks.ads \
650   s-stchop.adb<s-stchop-vxworks.adb \
651   s-taprop.adb<s-taprop-vxworks.adb \
652   s-taspri.ads<s-taspri-vxworks.ads \
653   s-tpopsp.adb<s-tpopsp-vxworks.adb \
654   s-vxwork.ads<s-vxwork-xscale.ads \
655   g-soccon.ads<g-soccon-vxworks.ads \
656   g-socthi.ads<g-socthi-vxworks.ads \
657   g-socthi.adb<g-socthi-vxworks.adb \
658   system.ads<system-elf-sparc.ads
659
660   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
661
662   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
663   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
664 endif
665
666 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
667   LIBGNAT_TARGET_PAIRS = \
668   a-sytaco.ads<a-sytaco-vxworks.ads \
669   a-sytaco.adb<a-sytaco-vxworks.adb \
670   a-intnam.ads<a-intnam-vxworks.ads \
671   a-numaux.ads<a-numaux-vxworks.ads \
672   s-inmaop.adb<s-inmaop-posix.adb \
673   s-interr.adb<s-interr-vxworks.adb \
674   s-intman.ads<s-intman-vxworks.ads \
675   s-intman.adb<s-intman-vxworks.adb \
676   s-osinte.adb<s-osinte-vxworks.adb \
677   s-osinte.ads<s-osinte-vxworks.ads \
678   s-osprim.adb<s-osprim-vxworks.adb \
679   s-parame.ads<s-parame-vxworks.ads \
680   s-stchop.adb<s-stchop-vxworks.adb \
681   s-taprop.adb<s-taprop-vxworks.adb \
682   s-taspri.ads<s-taspri-vxworks.ads \
683   s-tpopsp.adb<s-tpopsp-vxworks.adb \
684   s-vxwork.ads<s-vxwork-mips.ads \
685   g-soccon.ads<g-soccon-vxworks.ads \
686   g-socthi.ads<g-socthi-vxworks.ads \
687   g-socthi.adb<g-socthi-vxworks.adb \
688   system.ads<system-vxworks-mips.ads
689
690   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-vxworks.adb
691
692   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
693   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
694 endif
695
696 ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
697   LIBGNAT_TARGET_PAIRS = \
698   a-intnam.ads<a-intnam-solaris.ads \
699   s-inmaop.adb<s-inmaop-posix.adb \
700   s-intman.adb<s-intman-solaris.adb \
701   s-osinte.adb<s-osinte-solaris.adb \
702   s-osinte.ads<s-osinte-solaris.ads \
703   s-osprim.adb<s-osprim-solaris.adb \
704   s-parame.adb<s-parame-solaris.adb \
705   s-taprop.adb<s-taprop-solaris.adb \
706   s-tasinf.adb<s-tasinf-solaris.adb \
707   s-tasinf.ads<s-tasinf-solaris.ads \
708   s-taspri.ads<s-taspri-solaris.ads \
709   s-tpopsp.adb<s-tpopsp-solaris.adb \
710   g-soccon.ads<g-soccon-solaris.ads \
711   g-soliop.ads<g-soliop-solaris.ads \
712   system.ads<system-solaris-sparc.ads
713
714   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-solaris.adb
715
716   THREADSLIB = -lposix4 -lthread
717   MISCLIB = -lposix4 -lnsl -lsocket
718   SYMLIB = $(ADDR2LINE_SYMLIB)
719   SO_OPTS = -Wl,-h,
720   GNATLIB_SHARED = gnatlib-shared-dual
721   GMEM_LIB = gmemlib
722   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
723   LIBRARY_VERSION := $(LIB_VERSION)
724
725   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
726     LIBGNAT_TARGET_PAIRS = \
727     a-intnam.ads<a-intnam-solaris.ads \
728     s-inmaop.adb<s-inmaop-posix.adb \
729     s-intman.adb<s-intman-solaris.adb \
730     s-osinte.adb<s-osinte-fsu.adb \
731     s-osinte.ads<s-osinte-solaris-fsu.ads \
732     s-osprim.adb<s-osprim-solaris.adb \
733     s-taprop.adb<s-taprop-posix.adb \
734     s-taspri.ads<s-taspri-posix.ads \
735     s-tpopsp.adb<s-tpopsp-posix.adb \
736     g-soccon.ads<g-soccon-solaris.ads \
737     g-soliop.ads<g-soliop-solaris.ads \
738     system.ads<system-solaris-sparc.ads
739
740     THREADSLIB = -lgthreads -lmalloc
741   endif
742
743   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
744     LIBGNAT_TARGET_PAIRS = \
745     a-intnam.ads<a-intnam-solaris.ads \
746     s-inmaop.adb<s-inmaop-posix.adb \
747     s-intman.adb<s-intman-posix.adb \
748     s-osinte.adb<s-osinte-posix.adb \
749     s-osinte.ads<s-osinte-solaris-posix.ads \
750     s-osprim.adb<s-osprim-solaris.adb \
751     s-taprop.adb<s-taprop-posix.adb \
752     s-taspri.ads<s-taspri-posix.ads \
753     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
754     g-soccon.ads<g-soccon-solaris.ads \
755     g-soliop.ads<g-soliop-solaris.ads \
756     system.ads<system-solaris-sparc.ads
757
758     THREADSLIB = -lposix4 -lpthread
759   endif
760
761   ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
762     LIBGNAT_TARGET_PAIRS = \
763     a-intnam.ads<a-intnam-solaris.ads \
764     s-inmaop.adb<s-inmaop-posix.adb \
765     s-intman.adb<s-intman-solaris.adb \
766     s-osinte.adb<s-osinte-solaris.adb \
767     s-osinte.ads<s-osinte-solaris.ads \
768     s-osprim.adb<s-osprim-solaris.adb \
769     s-parame.adb<s-parame-solaris.adb \
770     s-taprop.adb<s-taprop-solaris.adb \
771     s-tasinf.adb<s-tasinf-solaris.adb \
772     s-tasinf.ads<s-tasinf-solaris.ads \
773     s-taspri.ads<s-taspri-solaris.ads \
774     s-tpopsp.adb<s-tpopsp-solaris.adb \
775     g-soccon.ads<g-soccon-solaris.ads \
776     g-soliop.ads<g-soliop-solaris.ads \
777     system.ads<system-solaris-sparcv9.ads
778   endif
779 endif
780
781 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
782   LIBGNAT_TARGET_PAIRS = \
783   a-numaux.adb<a-numaux-x86.adb \
784   a-numaux.ads<a-numaux-x86.ads \
785   a-intnam.ads<a-intnam-solaris.ads \
786   s-inmaop.adb<s-inmaop-posix.adb \
787   s-intman.adb<s-intman-solaris.adb \
788   s-mastop.adb<s-mastop-x86.adb \
789   s-osinte.adb<s-osinte-solaris.adb \
790   s-osinte.ads<s-osinte-solaris.ads \
791   s-osprim.adb<s-osprim-solaris.adb \
792   s-parame.adb<s-parame-solaris.adb \
793   s-taprop.adb<s-taprop-solaris.adb \
794   s-tasinf.adb<s-tasinf-solaris.adb \
795   s-tasinf.ads<s-tasinf-solaris.ads \
796   s-taspri.ads<s-taspri-solaris.ads \
797   s-tpopsp.adb<s-tpopsp-solaris.adb \
798   g-soccon.ads<g-soccon-solaris.ads \
799   g-soliop.ads<g-soliop-solaris.ads \
800   system.ads<system-solaris-x86.ads
801
802   THREADSLIB = -lposix4 -lthread
803   MISCLIB = -lposix4 -lnsl -lsocket
804   SO_OPTS = -Wl,-h,
805   GNATLIB_SHARED = gnatlib-shared-dual
806   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
807   LIBRARY_VERSION := $(LIB_VERSION)
808 endif
809
810 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
811   LIBGNAT_TARGET_PAIRS = \
812   a-intnam.ads<a-intnam-linux.ads \
813   a-numaux.adb<a-numaux-x86.adb \
814   a-numaux.ads<a-numaux-x86.ads \
815   s-inmaop.adb<s-inmaop-posix.adb \
816   s-intman.adb<s-intman-posix.adb \
817   s-mastop.adb<s-mastop-x86.adb \
818   s-osinte.adb<s-osinte-posix.adb \
819   s-osinte.ads<s-osinte-linux.ads \
820   s-osprim.adb<s-osprim-posix.adb \
821   s-taprop.adb<s-taprop-linux.adb \
822   s-taspri.ads<s-taspri-linux.ads \
823   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
824   s-parame.adb<s-parame-linux.adb \
825   system.ads<system-linux-x86.ads
826
827   TOOLS_TARGET_PAIRS =  \
828     mlib-tgt.adb<mlib-tgt-linux.adb \
829     indepsw.adb<indepsw-linux.adb
830
831   SYMLIB = $(ADDR2LINE_SYMLIB)
832   THREADSLIB = -lpthread
833   GNATLIB_SHARED = gnatlib-shared-dual
834   GMEM_LIB = gmemlib
835   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
836   LIBRARY_VERSION := $(LIB_VERSION)
837
838   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
839     LIBGNAT_TARGET_PAIRS = \
840     a-intnam.ads<a-intnam-linux.ads \
841     a-numaux.adb<a-numaux-x86.adb \
842     a-numaux.ads<a-numaux-x86.ads \
843     s-inmaop.adb<s-inmaop-posix.adb \
844     s-intman.adb<s-intman-posix.adb \
845     s-mastop.adb<s-mastop-x86.adb \
846     s-osinte.adb<s-osinte-fsu.adb \
847     s-osinte.ads<s-osinte-linux-fsu.ads \
848     s-osprim.adb<s-osprim-posix.adb \
849     s-taprop.adb<s-taprop-posix.adb \
850     s-taspri.ads<s-taspri-posix.ads \
851     s-tpopsp.adb<s-tpopsp-posix.adb \
852     system.ads<system-linux-x86.ads
853
854     THREADSLIB = -lgthreads -lmalloc
855   endif
856 endif
857
858 ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
859   LIBGNAT_TARGET_PAIRS = \
860   a-intnam.ads<a-intnam-freebsd.ads \
861   a-numaux.adb<a-numaux-x86.adb \
862   a-numaux.ads<a-numaux-x86.ads \
863   g-soccon.ads<g-soccon-freebsd.ads \
864   s-inmaop.adb<s-inmaop-posix.adb \
865   s-intman.adb<s-intman-posix.adb \
866   s-mastop.adb<s-mastop-x86.adb \
867   s-osinte.adb<s-osinte-freebsd.adb \
868   s-osinte.ads<s-osinte-freebsd.ads \
869   s-osprim.adb<s-osprim-posix.adb \
870   s-taprop.adb<s-taprop-posix.adb \
871   s-taspri.ads<s-taspri-posix.ads \
872   s-tpopsp.adb<s-tpopsp-posix.adb \
873   system.ads<system-freebsd-x86.ads
874
875   TOOLS_TARGET_PAIRS = \
876   mlib-tgt.adb<mlib-tgt-linux.adb
877   GNATLIB_SHARED = gnatlib-shared-dual
878
879   SYMLIB = $(ADDR2LINE_SYMLIB)
880   THREADSLIB= -lc_r
881   GMEM_LIB = gmemlib
882   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
883   LIBRARY_VERSION := $(LIB_VERSION)
884 endif
885
886 ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
887   ifeq ($(strip $(filter-out s390x,$(arch))),)
888     LIBGNAT_TARGET_PAIRS = \
889     a-intnam.ads<a-intnam-linux.ads \
890     s-inmaop.adb<s-inmaop-posix.adb \
891     s-intman.adb<s-intman-posix.adb \
892     s-osinte.adb<s-osinte-posix.adb \
893     s-osinte.ads<s-osinte-linux.ads \
894     s-osprim.adb<s-osprim-posix.adb \
895     s-taprop.adb<s-taprop-linux.adb \
896     s-taspri.ads<s-taspri-linux.ads \
897     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
898     s-parame.adb<s-parame-linux.adb \
899     system.ads<system-linux-s390x.ads
900   else
901     LIBGNAT_TARGET_PAIRS = \
902     a-intnam.ads<a-intnam-linux.ads \
903     s-inmaop.adb<s-inmaop-posix.adb \
904     s-intman.adb<s-intman-posix.adb \
905     s-osinte.adb<s-osinte-posix.adb \
906     s-osinte.ads<s-osinte-linux.ads \
907     s-osprim.adb<s-osprim-posix.adb \
908     s-taprop.adb<s-taprop-linux.adb \
909     s-taspri.ads<s-taspri-linux.ads \
910     s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
911     s-parame.adb<s-parame-linux.adb \
912     system.ads<system-linux-s390.ads
913   endif
914
915   TOOLS_TARGET_PAIRS =  \
916     mlib-tgt.adb<mlib-tgt-linux.adb
917
918   THREADSLIB = -lpthread
919   GNATLIB_SHARED = gnatlib-shared-dual
920   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
921   LIBRARY_VERSION := $(LIB_VERSION)
922 endif
923
924 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
925   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
926     LIBGNAT_TARGET_PAIRS = \
927     a-intnam.ads<a-intnam-irix.ads \
928     s-inmaop.adb<s-inmaop-posix.adb \
929     s-intman.adb<s-intman-irix.adb \
930     s-mastop.adb<s-mastop-irix.adb \
931     s-osinte.adb<s-osinte-irix.adb \
932     s-osinte.ads<s-osinte-irix.ads \
933     s-osprim.adb<s-osprim-posix.adb \
934     s-proinf.adb<s-proinf-irix-athread.adb \
935     s-proinf.ads<s-proinf-irix-athread.ads \
936     s-taprop.adb<s-taprop-irix.adb \
937     s-tasinf.ads<s-tasinf-irix.ads \
938     s-taspri.ads<s-taspri-posix.ads \
939     s-tpopsp.adb<s-tpopsp-posix.adb \
940     s-traceb.adb<s-traceb-mastop.adb \
941     g-soccon.ads<g-soccon-irix.ads \
942     system.ads<system-irix-n32.ads
943
944     THREADSLIB = -lpthread
945     GNATLIB_SHARED = gnatlib-shared-default
946
947   else
948     LIBGNAT_TARGET_PAIRS = \
949     a-intnam.ads<a-intnam-irix.ads \
950     s-inmaop.adb<s-inmaop-dummy.adb \
951     s-interr.adb<s-interr-sigaction.adb \
952     s-intman.adb<s-intman-irix-athread.adb \
953     s-mastop.adb<s-mastop-irix.adb \
954     s-osinte.adb<s-osinte-irix.adb \
955     s-osinte.ads<s-osinte-irix-athread.ads \
956     s-osprim.adb<s-osprim-posix.adb \
957     s-proinf.adb<s-proinf-irix-athread.adb \
958     s-proinf.ads<s-proinf-irix-athread.ads \
959     s-taprop.adb<s-taprop-irix-athread.adb \
960     s-tasinf.adb<s-tasinf-irix-athread.adb \
961     s-tasinf.ads<s-tasinf-irix-athread.ads \
962     s-taspri.ads<s-taspri-posix.ads \
963     s-traceb.adb<s-traceb-mastop.adb \
964     g-soccon.ads<g-soccon-irix.ads \
965     system.ads<system-irix-o32.ads
966   endif
967
968   TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-irix.adb
969   TGT_LIB = -lexc
970   MISCLIB = -lexc
971   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
972   LIBRARY_VERSION := $(LIB_VERSION)
973 endif
974
975 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
976   LIBGNAT_TARGET_PAIRS = \
977   a-excpol.adb<a-excpol-abort.adb \
978   a-intnam.ads<a-intnam-hpux.ads \
979   s-inmaop.adb<s-inmaop-posix.adb \
980   s-interr.adb<s-interr-sigaction.adb \
981   s-intman.adb<s-intman-posix.adb \
982   s-osinte.adb<s-osinte-hpux-dce.adb \
983   s-osinte.ads<s-osinte-hpux-dce.ads \
984   s-parame.ads<s-parame-hpux.ads \
985   s-osprim.adb<s-osprim-posix.adb \
986   s-taprop.adb<s-taprop-hpux-dce.adb \
987   s-taspri.ads<s-taspri-hpux-dce.ads \
988   s-tpopsp.adb<s-tpopsp-posix.adb \
989   g-soccon.ads<g-soccon-hpux.ads \
990   system.ads<system-hpux.ads
991
992   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
993 endif
994
995 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
996   LIBGNAT_TARGET_PAIRS = \
997   a-intnam.ads<a-intnam-hpux.ads \
998   s-inmaop.adb<s-inmaop-posix.adb \
999   s-intman.adb<s-intman-posix.adb \
1000   s-osinte.adb<s-osinte-posix.adb \
1001   s-osinte.ads<s-osinte-hpux.ads \
1002   s-parame.ads<s-parame-hpux.ads \
1003   s-osprim.adb<s-osprim-posix.adb \
1004   s-traceb.adb<s-traceb-hpux.adb \
1005   s-taprop.adb<s-taprop-posix.adb \
1006   s-taspri.ads<s-taspri-posix.ads \
1007   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1008   g-soccon.ads<g-soccon-hpux.ads \
1009   system.ads<system-hpux.ads
1010
1011   TOOLS_TARGET_PAIRS = mlib-tgt.adb<mlib-tgt-hpux.adb
1012   TGT_LIB = /usr/lib/libcl.a
1013   THREADSLIB = -lpthread
1014   SYMLIB = $(ADDR2LINE_SYMLIB)
1015   GMEM_LIB = gmemlib
1016   soext = .sl
1017   SO_OPTS = -Wl,+h,
1018   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1019   GNATLIB_SHARED = gnatlib-shared-dual
1020   LIBRARY_VERSION := $(LIB_VERSION)
1021
1022   ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),)
1023     LIBGNAT_TARGET_PAIRS = \
1024     a-excpol.adb<a-excpol-abort.adb \
1025     a-intnam.ads<a-intnam-hpux.ads \
1026     s-inmaop.adb<s-inmaop-posix.adb \
1027     s-interr.adb<s-interr-sigaction.adb \
1028     s-intman.adb<s-intman-posix.adb \
1029     s-osinte.adb<s-osinte-hpux-dce.adb \
1030     s-osinte.ads<s-osinte-hpux-dce.ads \
1031     s-parame.ads<s-parame-hpux.ads \
1032     s-osprim.adb<s-osprim-posix.adb \
1033     s-taprop.adb<s-taprop-hpux-dce.adb \
1034     s-taspri.ads<s-taspri-hpux-dce.ads \
1035     s-tpopsp.adb<s-tpopsp-posix.adb \
1036     g-soccon.ads<g-soccon-hpux.ads \
1037     system.ads<system-hpux.ads
1038
1039     TGT_LIB =
1040     THREADSLIB = -lcma
1041   endif
1042 endif
1043
1044 ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
1045   LIBGNAT_TARGET_PAIRS = \
1046   a-intnam.ads<a-intnam-aix.ads \
1047   s-inmaop.adb<s-inmaop-posix.adb \
1048   s-intman.adb<s-intman-posix.adb \
1049   s-osinte.adb<s-osinte-aix.adb \
1050   s-osinte.ads<s-osinte-aix.ads \
1051   s-osprim.adb<s-osprim-posix.adb \
1052   s-taprop.adb<s-taprop-posix.adb \
1053   s-taspri.ads<s-taspri-posix.ads \
1054   s-tpopsp.adb<s-tpopsp-posix.adb \
1055   g-soccon.ads<g-soccon-aix.ads \
1056   system.ads<system-aix.ads
1057
1058   THREADSLIB = -lpthreads
1059   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1060
1061   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
1062     LIBGNAT_TARGET_PAIRS = \
1063     a-intnam.ads<a-intnam-aix.ads \
1064     s-inmaop.adb<s-inmaop-posix.adb \
1065     s-intman.adb<s-intman-posix.adb \
1066     s-osinte.adb<s-osinte-fsu.adb \
1067     s-osinte.ads<s-osinte-aix-fsu.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     g-soccon.ads<g-soccon-aix.ads \
1073     system.ads<system-aix.ads
1074
1075     THREADSLIB = -lgthreads -lmalloc
1076   endif
1077
1078   TOOLS_TARGET_PAIRS = \
1079   mlib-tgt.adb<mlib-tgt-aix.adb \
1080   indepsw.adb<indepsw-aix.adb
1081
1082   GMEM_LIB = gmemlib
1083   SYMLIB = $(ADDR2LINE_SYMLIB)
1084
1085 endif
1086
1087 ifeq ($(strip $(filter-out lynxos,$(osys))),)
1088   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
1089     LIBGNAT_TARGET_PAIRS = \
1090     a-numaux.adb<a-numaux-x86.adb \
1091     a-numaux.ads<a-numaux-x86.ads \
1092     a-intnam.ads<a-intnam-lynxos.ads \
1093     s-mastop.adb<s-mastop-x86.adb \
1094     s-inmaop.adb<s-inmaop-posix.adb \
1095     s-intman.adb<s-intman-posix.adb \
1096     s-osinte.adb<s-osinte-lynxos.adb \
1097     s-osinte.ads<s-osinte-lynxos.ads \
1098     s-osprim.adb<s-osprim-posix.adb \
1099     s-taprop.adb<s-taprop-lynxos.adb \
1100     s-taspri.ads<s-taspri-lynxos.ads \
1101     s-tpopsp.adb<s-tpopsp-lynxos.adb \
1102     system.ads<system-lynxos-x86.ads
1103
1104     PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1105
1106   else
1107     LIBGNAT_TARGET_PAIRS = \
1108     a-intnam.ads<a-intnam-lynxos.ads \
1109     s-inmaop.adb<s-inmaop-posix.adb \
1110     s-intman.adb<s-intman-posix.adb \
1111     s-osinte.adb<s-osinte-lynxos-3.adb \
1112     s-osinte.ads<s-osinte-lynxos-3.ads \
1113     s-osprim.adb<s-osprim-posix.adb \
1114     s-taprop.adb<s-taprop-posix.adb \
1115     s-taspri.ads<s-taspri-posix.ads \
1116     s-tpopsp.adb<s-tpopsp-posix.adb \
1117     system.ads<system-lynxos-ppc.ads
1118
1119     ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
1120       LIBGNAT_TARGET_PAIRS = \
1121       a-intnam.ads<a-intnam-lynxos.ads \
1122       s-inmaop.adb<s-inmaop-posix.adb \
1123       s-intman.adb<s-intman-posix.adb \
1124       s-osinte.adb<s-osinte-lynxos.adb \
1125       s-osinte.ads<s-osinte-lynxos.ads \
1126       s-osprim.adb<s-osprim-posix.adb \
1127       s-taprop.adb<s-taprop-lynxos.adb \
1128       s-taspri.ads<s-taspri-lynxos.ads \
1129       s-tpopsp.adb<s-tpopsp-lynxos.adb \
1130       system.ads<system-lynxos-ppc.ads
1131     endif
1132
1133   endif
1134 endif
1135
1136 ifeq ($(strip $(filter-out rtems%,$(osys))),)
1137   LIBGNAT_TARGET_PAIRS = \
1138   a-intnam.ads<4rintnam.ads \
1139   s-inmaop.adb<s-inmaop-posix.adb \
1140   s-intman.adb<s-intman-posix.adb \
1141   s-osinte.adb<5rosinte.adb \
1142   s-osinte.ads<5rosinte.ads \
1143   s-osprim.adb<s-osprim-posix.adb \
1144   s-parame.adb<5rparame.adb \
1145   s-taprop.adb<s-taprop-posix.adb \
1146   s-taspri.ads<s-taspri-posix.ads \
1147   s-tpopsp.adb<5rtpopsp.adb
1148 endif
1149
1150 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
1151   LIBGNAT_TARGET_PAIRS = \
1152   a-intnam.ads<a-intnam-tru64.ads \
1153   s-inmaop.adb<s-inmaop-posix.adb \
1154   s-intman.adb<s-intman-posix.adb \
1155   s-mastop.adb<s-mastop-tru64.adb \
1156   s-osinte.adb<s-osinte-tru64.adb \
1157   s-osinte.ads<s-osinte-tru64.ads \
1158   s-osprim.adb<s-osprim-unix.adb \
1159   s-taprop.adb<s-taprop-tru64.adb \
1160   s-tasinf.ads<s-tasinf-tru64.ads \
1161   s-taspri.ads<s-taspri-tru64.ads \
1162   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1163   s-traceb.adb<s-traceb-mastop.adb \
1164   g-soccon.ads<g-soccon-tru64.ads \
1165   system.ads<system-tru64.ads
1166
1167   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-tru64.adb
1168
1169   GMEM_LIB=gmemlib
1170   SYMLIB = $(ADDR2LINE_SYMLIB)
1171   THREADSLIB = -lpthread -lmach -lexc -lrt
1172   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1173   GNATLIB_SHARED = gnatlib-shared-default
1174   LIBRARY_VERSION := $(LIB_VERSION)
1175 endif
1176
1177 ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(host))),)
1178
1179 soext  = .exe
1180 hyphen = _
1181
1182 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1183 AR = iar
1184 endif
1185
1186 .SUFFIXES: .sym
1187
1188 .o.sym: 
1189         @ gnu:[bin]vmssymvec $<
1190 endif
1191
1192 ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),)
1193 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1194   LIBGNAT_TARGET_PAIRS_AUX1 = \
1195   s-auxdec.ads<s-auxdec-vms_64.ads \
1196   s-crtl.ads<s-crtl-vms.ads \
1197   s-osinte.adb<s-osinte-vms-ia64.adb \
1198   s-osinte.ads<s-osinte-vms-ia64.ads \
1199   system.ads<system-vms_64.ads
1200 else
1201 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
1202   LIBGNAT_TARGET_PAIRS_AUX1 = \
1203   s-crtl.ads<s-crtl-vms.ads \
1204   s-osinte.adb<s-osinte-vms.adb \
1205   s-osinte.ads<s-osinte-vms.ads \
1206   s-vaflop.adb<s-vaflop-vms-alpha.adb \
1207   system.ads<system-vms-zcx.ads
1208 endif
1209 endif
1210 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
1211   LIBGNAT_TARGET_PAIRS_AUX2 = \
1212   s-parame.ads<s-parame-vms-restrict.ads
1213 else
1214   LIBGNAT_TARGET_PAIRS_AUX2 = \
1215   s-parame.ads<s-parame-vms.ads
1216 endif
1217
1218   LIBGNAT_TARGET_PAIRS = \
1219   a-caldel.adb<a-caldel-vms.adb \
1220   a-calend.adb<a-calend-vms.adb \
1221   a-calend.ads<a-calend-vms.ads \
1222   a-dirval.adb<a-dirval-vms.adb \
1223   a-excpol.adb<a-excpol-abort.adb \
1224   a-intnam.ads<a-intnam-vms.ads \
1225   a-numaux.ads<a-numaux-vms.ads \
1226   g-expect.adb<g-expect-vms.adb \
1227   g-soccon.ads<g-soccon-vms.adb \
1228   g-socthi.ads<g-socthi-vms.ads \
1229   g-socthi.adb<g-socthi-vms.adb \
1230   g-trasym.adb<g-trasym-vms.adb \
1231   i-cstrea.adb<i-cstrea-vms.adb \
1232   i-cpp.adb<i-cpp-vms.adb \
1233   interfac.ads<interfac-vms.ads \
1234   s-asthan.adb<s-asthan-vms.adb \
1235   s-inmaop.adb<s-inmaop-vms.adb \
1236   s-interr.adb<s-interr-vms.adb \
1237   s-intman.adb<s-intman-vms.adb \
1238   s-intman.ads<s-intman-vms.ads \
1239   s-osprim.adb<s-osprim-vms.adb \
1240   s-osprim.ads<s-osprim-vms.ads \
1241   s-taprop.adb<s-taprop-vms.adb \
1242   s-taspri.ads<s-taspri-vms.ads \
1243   s-tpopsp.adb<s-tpopsp-posix.adb \
1244   s-tpopde.adb<s-tpopde-vms.adb \
1245   s-tpopde.ads<s-tpopde-vms.ads \
1246   s-traent.adb<s-traent-vms.adb \
1247   s-traent.ads<s-traent-vms.ads \
1248   $(LIBGNAT_TARGET_PAIRS_AUX1) \
1249   $(LIBGNAT_TARGET_PAIRS_AUX2)
1250
1251 ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
1252   TOOLS_TARGET_PAIRS= \
1253   mlib-tgt.adb<mlib-tgt-vms-ia64.adb \
1254   symbols.adb<symbols-vms-ia64.adb
1255 else
1256   TOOLS_TARGET_PAIRS= \
1257   mlib-tgt.adb<mlib-tgt-vms-alpha.adb \
1258   symbols.adb<symbols-vms-alpha.adb
1259 endif
1260
1261   GNATLIB_SHARED=gnatlib-shared-vms
1262 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
1263   EXTRA_LIBGNAT_SRCS=vmshandler.asm
1264   EXTRA_LIBGNAT_OBJS=vmshandler.o
1265 endif
1266   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
1267   EXTRA_GNATTOOLS = \
1268      ../../gnatlbr$(exeext) \
1269      ,,/../gnatsym$(exeext)
1270   # This command transforms (YYYYMMDD) into YY,MMDD
1271   GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
1272   TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
1273   LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
1274 endif
1275
1276 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1277   LIBGNAT_TARGET_PAIRS = \
1278   a-calend.adb<a-calend-mingw.adb \
1279   a-dirval.adb<a-dirval-mingw.adb \
1280   a-excpol.adb<a-excpol-abort.adb \
1281   a-intnam.ads<a-intnam-mingw.ads \
1282   a-numaux.adb<a-numaux-x86.adb \
1283   a-numaux.ads<a-numaux-x86.ads \
1284   s-gloloc.adb<s-gloloc-mingw.adb \
1285   s-inmaop.adb<s-inmaop-dummy.adb \
1286   s-interr.adb<s-interr-sigaction.adb \
1287   s-intman.adb<s-intman-mingw.adb \
1288   s-mastop.adb<s-mastop-x86.adb \
1289   s-memory.adb<s-memory-mingw.adb \
1290   s-osinte.ads<s-osinte-mingw.ads \
1291   s-osprim.adb<s-osprim-mingw.adb \
1292   s-taprop.adb<s-taprop-mingw.adb \
1293   s-taspri.ads<s-taspri-mingw.ads \
1294   s-parame.adb<s-parame-mingw.adb \
1295   g-socthi.ads<g-socthi-mingw.ads \
1296   g-socthi.adb<g-socthi-mingw.adb \
1297   g-soccon.ads<g-soccon-mingw.ads \
1298   g-soliop.ads<g-soliop-mingw.ads \
1299   system.ads<system-mingw.ads
1300
1301   TOOLS_TARGET_PAIRS= \
1302   mlib-tgt.adb<mlib-tgt-mingw.adb \
1303   indepsw.adb<indepsw-mingw.adb
1304
1305   MISCLIB = -lwsock32
1306   SYMLIB = $(ADDR2LINE_SYMLIB)
1307   GMEM_LIB = gmemlib
1308   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1309   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1310   EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
1311   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1312   soext = .dll
1313 # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT auto-import
1314 # support for array/record will be done.
1315   GNATLIB_SHARED = gnatlib-shared-win32
1316   LIBRARY_VERSION := $(LIB_VERSION)
1317 endif
1318
1319 ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
1320   LIBGNAT_TARGET_PAIRS = \
1321   a-intnam.ads<a-intnam-linux.ads \
1322   s-inmaop.adb<s-inmaop-posix.adb \
1323   s-intman.adb<s-intman-posix.adb \
1324   s-osinte.adb<s-osinte-posix.adb \
1325   s-osinte.ads<s-osinte-linux.ads \
1326   s-osprim.adb<s-osprim-posix.adb \
1327   s-taprop.adb<s-taprop-linux.adb \
1328   s-taspri.ads<s-taspri-linux.ads \
1329   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1330   s-parame.adb<s-parame-linux.adb \
1331   system.ads<system-linux-ppc.ads
1332
1333   TOOLS_TARGET_PAIRS =  \
1334     mlib-tgt.adb<mlib-tgt-linux.adb \
1335     indepsw.adb<indepsw-linux.adb
1336
1337   SYMLIB = $(ADDR2LINE_SYMLIB)
1338   THREADSLIB = -lpthread
1339   GNATLIB_SHARED = gnatlib-shared-dual
1340   GMEM_LIB = gmemlib
1341   PREFIX_OBJS = $(PREFIX_REAL_OBJS)
1342   LIBRARY_VERSION := $(LIB_VERSION)
1343
1344 endif
1345
1346 ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
1347   LIBGNAT_TARGET_PAIRS = \
1348   a-intnam.ads<a-intnam-linux.ads \
1349   a-numaux.ads<a-numaux-libc-x86.ads \
1350   s-inmaop.adb<s-inmaop-posix.adb \
1351   s-intman.adb<s-intman-posix.adb \
1352   s-osinte.ads<s-osinte-linux.ads \
1353   s-osinte.adb<s-osinte-posix.adb \
1354   s-osprim.adb<s-osprim-posix.adb \
1355   s-taprop.adb<s-taprop-linux.adb \
1356   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1357   s-taspri.ads<s-taspri-linux.ads \
1358   system.ads<system-linux-ia64.ads
1359
1360   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-linux.adb
1361   MISCLIB=
1362   THREADSLIB=-lpthread
1363   GNATLIB_SHARED=gnatlib-shared-dual
1364   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1365   LIBRARY_VERSION := $(LIB_VERSION)
1366 endif
1367
1368 ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
1369   LIBGNAT_TARGET_PAIRS = \
1370   a-intnam.ads<a-intnam-linux.ads \
1371   a-numaux.adb<a-numaux-x86.adb \
1372   a-numaux.ads<a-numaux-x86.ads \
1373   s-inmaop.adb<s-inmaop-posix.adb \
1374   s-intman.adb<s-intman-posix.adb \
1375   s-osinte.ads<s-osinte-linux.ads \
1376   s-osinte.adb<s-osinte-posix.adb \
1377   s-osprim.adb<s-osprim-posix.adb \
1378   s-taprop.adb<s-taprop-linux.adb \
1379   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1380   s-taspri.ads<s-taspri-linux.ads \
1381   system.ads<system-linux-x86_64.ads
1382
1383   TOOLS_TARGET_PAIRS=mlib-tgt.adb<mlib-tgt-linux.adb
1384   SYMLIB = $(ADDR2LINE_SYMLIB)
1385   THREADSLIB=-lpthread
1386   GNATLIB_SHARED=gnatlib-shared-dual
1387   GMEM_LIB = gmemlib
1388   PREFIX_OBJS=$(PREFIX_REAL_OBJS)
1389   LIBRARY_VERSION := $(LIB_VERSION)
1390 endif
1391
1392 ifeq ($(strip $(filter-out powerpc darwin%,$(arch) $(osys))),)
1393   LIBGNAT_TARGET_PAIRS = \
1394   a-intnam.ads<a-intnam-darwin.ads \
1395   s-inmaop.adb<s-inmaop-posix.adb \
1396   s-intman.adb<s-intman-posix.adb \
1397   s-osinte.adb<s-osinte-darwin.adb \
1398   s-osinte.ads<s-osinte-darwin.ads \
1399   s-osprim.adb<s-osprim-posix.adb \
1400   s-taprop.adb<s-taprop-posix.adb \
1401   s-taspri.ads<s-taspri-posix.ads \
1402   s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
1403   g-soccon.ads<g-soccon-aix.ads \
1404   system.ads<system-darwin-ppc.ads
1405 endif
1406
1407 # The runtime library for gnat comprises two directories.  One contains the
1408 # Ada source files that the compiler (gnat1) needs -- these files are listed
1409 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1410 # corresponding .ali files for the parts written in Ada, libgnat.a for
1411 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1412 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1413 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1414 # go into the directory.  The pthreads emulation is built in the threads
1415 # subdirectory and copied.
1416 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1417   errno.c exit.c cal.c ctrl_c.c \
1418   raise.h raise.c sysdep.c aux-io.c init.c \
1419   final.c tracebak.c tb-alvms.c tb-alvxw.c expect.c mkdir.c socket.c \
1420   $(EXTRA_LIBGNAT_SRCS)
1421
1422 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o \
1423   raise.o sysdep.o aux-io.o init.o cal.o final.o \
1424   tracebak.o expect.o mkdir.o socket.o $(EXTRA_LIBGNAT_OBJS)
1425
1426 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1427 #  the library installation will change and there will be a
1428 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1429 #  from ADA_INCLUDE_SRCS.
1430
1431 # GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
1432 # the following include file:
1433
1434 include $(fsrcdir)/Makefile.rtl
1435
1436 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
1437   g-trasym.o memtrack.o
1438
1439 # Default run time files
1440
1441 ADA_INCLUDE_SRCS =\
1442  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1443  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1444  sequenio.ads system.ads Makefile.prolog Makefile.generic \
1445  memtrack.adb \
1446  a-*.adb a-*.ads g-*.ad? i-*.ad? \
1447  s-[a-o]*.adb s-[p-z]*.adb \
1448  s-[a-o]*.ads s-[p-z]*.ads
1449
1450 LIBGNAT=../rts/libgnat.a 
1451 TOOLS_FLAGS_TO_PASS=            \
1452         "CC=$(CC)"              \
1453         "CFLAGS=$(CFLAGS)"      \
1454         "LDFLAGS=$(LDFLAGS)"    \
1455         "ADAFLAGS=$(ADAFLAGS)"  \
1456         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
1457         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
1458         "libsubdir=$(libsubdir)"        \
1459         "exeext=$(exeext)"      \
1460         "fsrcdir=$(fsrcdir)"    \
1461         "srcdir=$(fsrcdir)"     \
1462         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
1463         "GNATMAKE=$(GNATMAKE)"  \
1464         "GNATLINK=$(GNATLINK)"  \
1465         "GNATBIND=$(GNATBIND)"
1466
1467 # Build directory for the tools. Let's copy the target-dependent
1468 # sources using the same mechanism as for gnatlib. The other sources are 
1469 # accessed using the vpath directive below
1470
1471 ../stamp-tools:
1472         -$(RM) tools/*
1473         -$(RMDIR) tools
1474         -$(MKDIR) tools
1475         -(cd tools; $(LN_S) ../sdefault.adb .)
1476         -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
1477                   $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\
1478                   $(LN_S) $(fsrcdir)/$(word 2,$(subst <, ,$(PAIR))) \
1479                         tools/$(word 1,$(subst <, ,$(PAIR)));)
1480         touch ../stamp-tools
1481
1482 # when compiling the tools, the runtime has to be first on the path so that
1483 # it hides the runtime files lying with the rest of the sources
1484 ifeq ($(TOOLSCASE),native)
1485   vpath %.ads ../rts ../
1486   vpath %.adb ../rts ../
1487   vpath %.c   ../rts ../
1488   vpath %.h   ../rts ../
1489 endif
1490
1491 # in the cross tools case, everything is compiled with the native 
1492 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1493 ifeq ($(TOOLSCASE),cross)
1494   vpath %.ads ../
1495   vpath %.adb ../
1496   vpath %.c   ../
1497   vpath %.h   ../
1498 endif
1499
1500 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap 
1501 # reasons: gnatmake should be built with a recent compiler, a recent compiler
1502 # may not generate ALI files compatible with an old gnatmake so it is important
1503 # to be able to build gnatmake without a version of gnatmake around. Once 
1504 # everything has been compiled once, gnatmake can be recompiled with itself 
1505 # (see target gnattools1-re) 
1506 gnattools1: ../stamp-tools ../stamp-gnatlib
1507         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1508           TOOLSCASE=native \
1509           ../../gnatmake$(exeext) ../../gnatlink$(exeext) ../../gnatbl$(exeext)
1510
1511 # gnatmake/link can be built with recent gnatmake/link if they are available.
1512 # This is especially convenient for building cross tools or for rebuilding
1513 # the tools when the original bootstrap has already be done.
1514 gnattools1-re: ../stamp-tools
1515         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1516           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
1517
1518 # these tools are built with gnatmake & are common to native and cross
1519 gnattools2: ../stamp-tools
1520         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1521           TOOLSCASE=native \
1522           ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
1523           ../../gnatls$(exeext) ../../gnatprep$(exeext) \
1524           ../../gnatxref$(exeext) \
1525           ../../gnatfind$(exeext) ../../gnatname$(exeext) \
1526           ../../gnatclean$(exeext) ../../gprmake$(exeext) \
1527           ../../gprcmd$(exeext)   ../../gpr2make$(exeext)
1528
1529 # These tools are only built for the native version.
1530 gnattools3: ../stamp-tools
1531 #       $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1532 #         TOOLSCASE=native top_builddir=../../.. \
1533 #         ../../gnatmem$(exeext) $(EXTRA_GNATTOOLS)
1534
1535 # those tools are only built for the cross version
1536 gnattools4: ../stamp-tools
1537         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1538           TOOLSCASE=cross top_buildir=../../.. \
1539            ../../vxaddr2line$(exeext)
1540
1541 ../../gnatchop$(exeext): ../stamp-tools
1542         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1543         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1544         $(GNATLINK) -v gnatchop -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1545                 $(TOOLS_LIBS)
1546
1547 ../../gnat$(exeext): ../stamp-tools
1548         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1549         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1550         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1551
1552 ../../gnatkr$(exeext): ../stamp-tools
1553         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1554         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1555         $(GNATLINK) -v gnatkr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1556
1557 ../../gnatls$(exeext): ../stamp-tools
1558         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1559         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1560         $(GNATLINK) -v gnatls -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1561
1562 ../../gnatname$(exeext): ../stamp-tools
1563         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1564         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1565         $(GNATLINK) -v gnatname -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1566                     $(TOOLS_LIBS)
1567
1568 ../../gprmake$(exeext): ../stamp-tools
1569         $(GNATMAKE) -c $(ADA_INCLUDES) gprmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1570         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprmake
1571         $(GNATLINK) -v gprmake -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1572                     $(TOOLS_LIBS)
1573
1574 ../../gpr2make$(exeext): ../stamp-tools
1575         $(GNATMAKE) -c $(ADA_INCLUDES) gpr2make --GCC="$(CC) $(ALL_ADAFLAGS)"
1576         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gpr2make 
1577         $(GNATLINK) -v gpr2make -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1578                     $(TOOLS_LIBS)
1579
1580 ../../gnatprep$(exeext): ../stamp-tools
1581         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1582         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1583         $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1584                     $(TOOLS_LIBS)
1585
1586 ../../gnatxref$(exeext): ../stamp-tools
1587         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1588         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1589         $(GNATLINK) -v gnatxref -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1590                     $(TOOLS_LIBS)
1591
1592 ../../gnatfind$(exeext): ../stamp-tools
1593         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1594         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1595         $(GNATLINK) -v gnatfind -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1596                     $(TOOLS_LIBS)
1597
1598 ../../gnatclean$(exeext): ../stamp-tools
1599         $(GNATMAKE) -c $(ADA_INCLUDES) gnatclean --GCC="$(CC) $(ALL_ADAFLAGS)"
1600         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatclean
1601         $(GNATLINK) -v gnatclean -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1602                     $(TOOLS_LIBS)
1603
1604 ../../gnatsym$(exeext): ../stamp-tools
1605         $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
1606         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
1607         $(GNATLINK) -v gnatsym -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1608                     $(TOOLS_LIBS)
1609
1610 ../../gnatmem$(exeext): ../stamp-tools gmem.o $(SYMDEPS)
1611 ifeq ($(GMEM_LIB),gmemlib)
1612            $(GNATMAKE) -c $(ADA_INCLUDES) gnatmem --GCC="$(CC) $(ALL_ADAFLAGS)"
1613            $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmem 
1614            $(GNATLINK) -v gnatmem -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1615                     gmem.o $(SYMLIB) $(TOOLS_LIBS)
1616 endif 
1617
1618 ../../gnatdll$(exeext): ../stamp-tools
1619         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1620         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1621         $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1622                 $(TOOLS_LIBS)
1623
1624 ../../gprcmd$(exeext): ../stamp-tools
1625         $(GNATMAKE) -c $(ADA_INCLUDES) gprcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1626         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprcmd 
1627         $(GNATLINK) -v gprcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1628
1629 ../../vxaddr2line$(exeext): ../stamp-tools
1630         $(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
1631         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line 
1632         $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(CLIB)
1633
1634 gnatmake-re: ../stamp-tools link.o
1635         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1636         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1637         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1638         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1639                 --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1640
1641 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1642 # with the former version of gnatlink itself which cannot override itself.
1643 gnatlink-re: ../stamp-tools link.o
1644         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1645         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1646         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1647                     --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1648         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1649   
1650 # Needs to be built with CC=gcc
1651 # Since the RTL should be built with the latest compiler, remove the
1652 #  stamp target in the parent directory whenever gnat1 is rebuilt
1653
1654 # Likewise for the tools
1655 ../../gnatmake$(exeext): $(P) b_gnatm.o link.o $(GNATMAKE_OBJS)
1656         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1657               $(TOOLS_LIBS)
1658
1659 ../../gnatlink$(exeext): $(P) b_gnatl.o link.o $(GNATLINK_OBJS)
1660         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1661               $(TOOLS_LIBS)
1662
1663 ../../gnatbl$(exeext): gnatbl.o
1664         $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1665
1666 gnatbl.o: gnatbl.c adaint.h
1667         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< $(OUTPUT_OPTION)
1668
1669 ../stamp-gnatlib:
1670         @if [ ! -f stamp-gnatlib ] ; \
1671         then \
1672           $(ECHO) You must first build the GNAT library: make gnatlib; \
1673           false; \
1674         else \
1675           true; \
1676         fi
1677
1678 install-gnatlib: ../stamp-gnatlib
1679 #       Create the directory before deleting it, in case the directory is
1680 #       a list of directories (as it may be on VMS). This ensures we are
1681 #       deleting the right one.
1682         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1683         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1684         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1685         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1686         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1687         $(RMDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1688         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1689         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1690         -$(MKDIR) $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1691         -$(INSTALL_DATA) rts/Makefile.prolog $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1692         -$(INSTALL_DATA) rts/Makefile.generic $(DESTDIR)$(ADA_SHARE_MAKE_DIR)
1693         for file in rts/*.ali; do \
1694             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1695         done
1696         -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1697         -cd rts; for file in *$(arext);do \
1698             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1699             $(RANLIB) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
1700         done
1701         -$(foreach file, $(EXTRA_ADALIB_FILES), \
1702             $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1703         ) true
1704 #     Install the shared libraries, if any, using $(INSTALL) instead
1705 #     of $(INSTALL_DATA). The latter may force a mode inappropriate
1706 #     for shared libraries on some targets, e.g. on HP-UX where the x
1707 #     permission is required.
1708         for file in gnat gnarl; do \
1709            if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
1710               $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1711                          $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1712            fi; \
1713            if [ -f rts/lib$${file}$(soext) ]; then \
1714               $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
1715               $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
1716            fi; \
1717         done
1718 # This copy must be done preserving the date on the original file.
1719         for file in rts/*.adb rts/*.ads; do \
1720             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1721         done
1722         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1723         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1724
1725 ../stamp-gnatlib2:
1726         $(RM) rts/s-*.ali
1727         $(RM) rts/s-*$(objext)
1728         $(RM) rts/a-*.ali
1729         $(RM) rts/a-*$(objext)
1730         $(RM) rts/*.ali
1731         $(RM) rts/*$(objext)
1732         $(RM) rts/*$(arext)
1733         $(RM) rts/*$(soext)
1734         touch ../stamp-gnatlib2
1735         $(RM) ../stamp-gnatlib
1736
1737 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1738 #       successive target commands. Although the Gnu make documentation
1739 #       implies this is true on all systems, I suspect it may not be, So care
1740 #       has been taken to allow a sed script to look for ";)" and substitue
1741 #       for ";" the appropriate character in the range of lines below
1742 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1743
1744 # GNULLI Begin ###########################################################
1745
1746 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1747         $(RMDIR) rts
1748         $(MKDIR) rts
1749         $(CHMOD) u+w rts
1750 # Copy target independent sources
1751         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1752           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1753 # Remove files to be replaced by target dependent sources
1754         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1755                         rts/$(word 1,$(subst <, ,$(PAIR))))
1756         $(RM) rts/*-*-*.ads rts/*-*-*.adb
1757 # Copy new target dependent sources
1758         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1759                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1760                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1761         $(RM) ../stamp-gnatlib
1762         touch ../stamp-gnatlib1
1763
1764 # GNULLI End #############################################################
1765
1766 # Don't use semicolon separated shell commands that involve list expansions.
1767 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1768 # line lengths in excess of 256 characters.
1769 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1770 # is guaranteed to overflow the buffer.
1771
1772 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1773         $(MAKE) -C rts CC="../../xgcc -B../../" \
1774                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1775                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1776                 srcdir=$(fsrcdir) \
1777                 -f ../Makefile $(LIBGNAT_OBJS)
1778         $(MAKE) -C rts CC="../../xgcc -B../../" \
1779                 ADA_INCLUDES="" \
1780                 CFLAGS="$(GNATLIBCFLAGS)" \
1781                 ADAFLAGS="$(GNATLIBFLAGS)" \
1782                 srcdir=$(fsrcdir) \
1783                 -f ../Makefile \
1784                 $(GNATRTL_OBJS)
1785         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1786         $(AR) $(AR_FLAGS) rts/libgnat$(arext) \
1787            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
1788         ifneq ($(PREFIX_OBJS),)
1789                 $(AR) $(AR_FLAGS) rts/libgccprefix$(arext) $(PREFIX_OBJS);
1790         endif
1791         -$(RANLIB) rts/libgnat$(arext)
1792         $(AR) $(AR_FLAGS) rts/libgnarl$(arext) \
1793            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1794         -$(RANLIB) rts/libgnarl$(arext)
1795         ifeq ($(GMEM_LIB),gmemlib)
1796                 $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o
1797                 -$(RANLIB) rts/libgmem$(arext)
1798         endif
1799         $(CHMOD) a-wx rts/*.ali
1800         touch ../stamp-gnatlib
1801
1802 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
1803 gnatlib-shared-default:
1804         $(MAKE) $(FLAGS_TO_PASS) \
1805              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1806              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1807              THREAD_KIND="$(THREAD_KIND)" \
1808              gnatlib
1809         $(RM) rts/libgna*$(soext)
1810         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1811                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1812                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1813                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1814                 $(MISCLIB) -lm
1815         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1816                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1817                 $(GNATRTL_TASKING_OBJS) \
1818                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1819                 $(THREADSLIB)
1820         cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1821                 libgnat$(soext)
1822         cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1823                 libgnarl$(soext)
1824
1825 gnatlib-shared-dual:
1826         $(MAKE) $(FLAGS_TO_PASS) \
1827              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1828              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1829              THREAD_KIND="$(THREAD_KIND)" \
1830              gnatlib-shared-default
1831         $(MV) rts/libgna*$(soext) .
1832         $(RM) ../stamp-gnatlib2
1833         $(MAKE) $(FLAGS_TO_PASS) \
1834              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1835              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1836              THREAD_KIND="$(THREAD_KIND)" \
1837              gnatlib
1838         $(MV) libgna*$(soext) rts
1839
1840 gnatlib-shared-dual-win32:
1841         $(MAKE) $(FLAGS_TO_PASS) \
1842              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1843              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1844              THREAD_KIND="$(THREAD_KIND)" \
1845              gnatlib-shared-win32
1846         $(MV) rts/libgna*$(soext) .
1847         $(RM) ../stamp-gnatlib2
1848         $(MAKE) $(FLAGS_TO_PASS) \
1849              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1850              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1851              THREAD_KIND="$(THREAD_KIND)" \
1852              gnatlib
1853         $(MV) libgna*$(soext) rts
1854
1855 # ??? we need to add the option to support auto-import of arrays/records to
1856 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
1857 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
1858 # Windows.
1859 gnatlib-shared-win32:
1860         $(MAKE) $(FLAGS_TO_PASS) \
1861              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1862              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1863              THREAD_KIND="$(THREAD_KIND)" \
1864              gnatlib
1865         $(RM) rts/libgna*$(soext)
1866         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1867                 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1868                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1869                 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
1870         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1871                 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1872                 $(GNATRTL_TASKING_OBJS) \
1873                 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1874                 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
1875
1876 gnatlib-shared-vms:
1877         $(MAKE) $(FLAGS_TO_PASS) \
1878              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1879              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1880              THREAD_KIND="$(THREAD_KIND)" \
1881              gnatlib
1882         $(RM) rts/libgna*$(soext)
1883         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1884         objdump --syms $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) | \
1885         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1886         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1887         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1888            -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
1889            sys\$$library:trace.exe \
1890            --for-linker=/noinform \
1891            --for-linker=SYMVEC_$$$$.opt \
1892            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1893         cd rts && echo "case_sensitive=yes" > SYMVEC_$$$$.opt && \
1894         objdump --syms $(GNATRTL_TASKING_OBJS) | \
1895         $(SHLIB_SYMVEC) >> SYMVEC_$$$$.opt && \
1896         echo "case_sensitive=NO" >> SYMVEC_$$$$.opt && \
1897         ../../xgcc -g -B../../ -nostartfiles -shared -shared-libgcc \
1898            -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
1899            libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
1900            sys\$$library:trace.exe \
1901            --for-linker=/noinform \
1902            --for-linker=SYMVEC_$$$$.opt \
1903            --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
1904
1905 gnatlib-shared:
1906         $(MAKE) $(FLAGS_TO_PASS) \
1907              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1908              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1909              THREAD_KIND="$(THREAD_KIND)" \
1910              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
1911              $(GNATLIB_SHARED)
1912
1913 gnatlib-sjlj: ../stamp-gnatlib1
1914         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := False;/' rts/system.ads > rts/s.ads
1915         $(MV) rts/s.ads rts/system.ads
1916         $(MAKE) $(FLAGS_TO_PASS) \
1917              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1918              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1919              THREAD_KIND="$(THREAD_KIND)" \
1920              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
1921
1922 gnatlib-zcx: ../stamp-gnatlib1
1923         sed -e 's/ZCX_By_Default.*/ZCX_By_Default            : constant Boolean := True;/' rts/system.ads > rts/s.ads
1924         $(MV) rts/s.ads rts/system.ads
1925         $(MAKE) $(FLAGS_TO_PASS) \
1926              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1927              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1928              THREAD_KIND="$(THREAD_KIND)" \
1929              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
1930
1931 # .s files for cross-building
1932 gnat-cross: force
1933         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
1934
1935 # Compiling object files from source files.
1936
1937 # Note that dependencies on obstack.h are not written
1938 # because that file is not part of GCC.
1939 # Dependencies on gvarargs.h are not written
1940 # because all that file does, when not compiling with GCC,
1941 # is include the system varargs.h.
1942
1943 b_gnatl.c : $(GNATLINK_OBJS)
1944         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
1945 b_gnatl.o : b_gnatl.c
1946
1947 b_gnatm.c : $(GNATMAKE_OBJS)
1948         $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
1949 b_gnatm.o : b_gnatm.c
1950
1951 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
1952 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
1953 ADA_SHARE_MAKE_DIR = $(prefix)/share/gnat
1954
1955 # force no sibling call optimization on s-traceb.o so the number of stack
1956 # frames to be skipped when computing a call chain is not modified by
1957 # optimization. However we can do that only when building the runtime
1958 # (not the compiler) because the -fno-optimize-sibling-calls exists
1959 # only in GCC 3.
1960
1961 ifneq (,$(findstring xgcc,$(CC)))
1962 NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
1963 else
1964 NO_SIBLING_ADAFLAGS=
1965 endif
1966
1967 s-traceb.o  : s-traceb.adb
1968         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
1969               $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
1970       $< $(OUTPUT_OPTION)
1971
1972 # force debugging information on s-tasdeb.o so that it is always
1973 # possible to set conditional breakpoints on tasks.
1974
1975 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
1976         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
1977               $< $(OUTPUT_OPTION)
1978
1979 # force debugging information on a-except.o so that it is always
1980 # possible to set conditional breakpoints on exceptions.
1981 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
1982
1983 a-except.o  : a-except.adb a-except.ads
1984         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
1985               $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
1986
1987 # force debugging information on s-assert.o so that it is always
1988 # possible to set breakpoint on assert failures.
1989
1990 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
1991         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
1992               $< $(OUTPUT_OPTION)
1993
1994 adadecode.o : adadecode.c adadecode.h
1995 aux-io.o  : aux-io.c
1996 argv.o    : argv.c
1997 cal.o     : cal.c
1998 deftarg.o  : deftarg.c
1999 errno.o   : errno.c
2000 exit.o    : raise.h exit.c
2001 expect.o  : expect.c
2002 final.o   : raise.h final.c
2003 gmem.o    : gmem.c
2004 link.o    : link.c
2005 mkdir.o   : mkdir.c
2006 socket.o  : socket.c
2007 sysdep.o  : sysdep.c
2008
2009 cio.o     : cio.c 
2010         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2011                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2012
2013 init.o    : init.c ada.h types.h raise.h
2014         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2015                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2016
2017 raise.o   : raise.c raise.h
2018         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(RT_FLAGS) \
2019                  $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
2020
2021 # Need to keep the frame pointer in this file to pop the stack properly on
2022 # some targets.
2023 tracebak.o  : tracebak.c tb-alvms.c tb-alvxw.c
2024         $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2025               -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
2026
2027 # In GNU Make, ignore whether `stage*' exists.
2028 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2029 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2030
2031 force:
2032
2033 # Gnatlbr is only used on VMS
2034
2035 ../../gnatlbr$(exeext): ../../prefix.o
2036         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
2037         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
2038         $(GNATLINK) -v gnatlbr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
2039                 $(TOOLS_LIBS)