OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [ada/] [gcc-interface/] [Makefile.in] - Blame information for rev 384

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.