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