OSDN Git Service

2003-07-04 H.J. Lu <hongjiu.lu@intel.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / Makefile.in
1 # Makefile for GNU Ada Compiler (GNAT).
2 #   Copyright (C) 1994-2003 Free Software Foundation, Inc.
3
4 #This file is part of GCC.
5
6 #GCC is free software; you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation; either version 2, or (at your option)
9 #any later version.
10
11 #GCC is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with GCC; see the file COPYING.  If not, write to
18 #the Free Software Foundation, 59 Temple Place - Suite 330,
19 #Boston, MA 02111-1307, USA.
20
21 # The makefile built from this file lives in the language subdirectory.
22 # It's 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 # Let the configure setting prevail only if CC hasn't been overridden
93 # to xgcc by the top level Makefile (in a later stage of bootstrap).
94 ifeq ($(findstring xgcc, $(CC)),)
95 ADAC = @ADAC@
96 else
97 ADAC = $(CC)
98 endif
99
100 BISON = bison
101 BISONFLAGS =
102 ECHO = echo
103 LEX = flex
104 LEXFLAGS =
105 CHMOD = chmod
106 CP = cp -p
107 MV = mv -f
108 RM = rm -f
109 RMDIR = rm -rf
110 MKDIR = mkdir -p
111 AR = ar
112 AR_FLAGS = rc
113 # How to invoke ranlib.
114 RANLIB = ranlib
115 # Test to use to see whether ranlib exists on the system.
116 RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
117 SHELL = @SHELL@
118 PWD_COMMAND = $${PWDCMD-pwd}
119 # How to copy preserving the date
120 INSTALL_DATA_DATE = cp -p
121 MAKEINFO = makeinfo
122 TEXI2DVI = texi2dvi
123 GNATBIND = $(STAGE_PREFIX)gnatbind -C
124 GNATBIND_FLAGS = -static -x
125 ADA_CFLAGS =
126 ADAFLAGS = -W -Wall -gnatpg -gnata
127 SOME_ADAFLAGS =-gnata
128 FORCE_DEBUG_ADAFLAGS = -g
129 GNATLIBFLAGS = -gnatpg
130 GNATLIBCFLAGS = -g -O2
131 GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
132         -DIN_RTS
133 ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
134 ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
135         $(ADAFLAGS)
136 MOST_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
137         $(SOME_ADAFLAGS)
138 THREAD_KIND = native
139 THREADSLIB =
140 GMEM_LIB =
141 MISCLIB =
142
143 objext = .o
144 exeext =
145 arext  = .a
146 soext  = .so
147 shext  =
148
149 HOST_CC=$(CC)
150 HOST_CFLAGS=$(ALL_CFLAGS)
151 HOST_CLIB=$(CLIB)
152 HOST_LDFLAGS=$(LDFLAGS)
153 HOST_CPPFLAGS=$(ALL_CPPFLAGS)
154 HOST_ALLOCA=$(ALLOCA)
155 HOST_MALLOC=$(MALLOC)
156 HOST_OBSTACK=$(OBSTACK)
157
158 # Define this as & to perform parallel make on a Sequent.
159 # Note that this has some bugs, and it seems currently necessary 
160 # to compile all the gen* files first by hand to avoid erroneous results.
161 P =
162
163 # This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
164 # It omits XCFLAGS, and specifies -B./.
165 # It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
166 GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
167
168 # Tools to use when building a cross-compiler.
169 # These are used because `configure' appends `cross-make'
170 # to the makefile when making a cross-compiler.
171
172 # We don't use cross-make.  Instead we use the tools from the build tree,
173 # if they are available.
174 # program_transform_name and objdir are set by configure.in.
175 program_transform_name =
176 objdir = .
177
178 target=@target@
179 target_alias=@target_alias@
180 xmake_file=@dep_host_xmake_file@
181 tmake_file=@dep_tmake_file@
182 host_canonical=@host@
183 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
184 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
185
186 # Directory where sources are, from where we are.
187 srcdir = @srcdir@
188 VPATH = @srcdir@
189
190 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
191 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
192 fcurdir := $(shell ${PWD_COMMAND})
193 fcurpfx := $(shell ${PWD_COMMAND})/
194
195 # Top build directory, relative to here.
196 top_builddir = ..
197
198 # Internationalization library.
199 INTLLIBS = @INTLLIBS@
200 INTLDEPS = @INTLDEPS@
201
202 # Any system libraries needed just for GNAT.
203 SYSLIBS = @GNAT_LIBEXC@
204
205 # List of extra object files linked in with various programs.
206 EXTRA_GNATTOOLS_OBJS = ../prefix.o
207
208 # List extra gnattools
209 EXTRA_GNATTOOLS =
210
211 # End of variables for you to override.
212
213 # Definition of `all' is here so that new rules inserted by sed
214 # do not specify the default target.
215 all: all.indirect
216
217 # This tells GNU Make version 3 not to put all variables in the environment.
218 .NOEXPORT:
219
220 # sed inserts variable overrides after the following line.
221 ####target overrides
222 @target_overrides@
223
224 ####host overrides
225 @host_overrides@
226 \f
227 # Now figure out from those variables how to compile and link.
228
229 all.indirect: Makefile ../gnat1$(exeext)
230
231 # IN_GCC distinguishes between code compiled into GCC itself and other
232 # programs built during a bootstrap.
233 # autoconf inserts -DCROSS_COMPILE if we are building a cross compiler.
234 INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
235
236 # This is the variable actually used when we compile.
237 LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
238 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS) \
239         $(XCFLAGS)
240
241 # Likewise.
242 ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
243
244 # This is where we get libiberty.a from.
245 LIBIBERTY = ../../libiberty/libiberty.a
246
247 # How to link with both our special library facilities
248 # and the system's installed libraries.
249 LIBS = $(INTLLIBS) $(LIBIBERTY) $(SYSLIBS)
250 LIBDEPS = $(INTLDEPS) $(LIBIBERTY)
251 TOOLS_LIBS = ../../prefix.o ../../version.o $(LIBGNAT) \
252         ../../../libiberty/libiberty.a $(SYSLIBS)
253
254 # Specify the directories to be searched for header files.
255 # Both . and srcdir are used, in that order,
256 # so that tm.h and config.h will be found in the compilation
257 # subdirectory rather than in the source directory.
258 INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \
259         -I$(srcdir)/../../include
260
261 ADA_INCLUDES = -I- -I. -I$(srcdir)
262
263 INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) \
264         -I$(fsrcdir)/.. -I$(fsrcdir)/../config -I$(fsrcdir)/../../include
265 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)
266
267 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
268 .SUFFIXES: .in .def
269
270 # Say how to compile Ada programs.
271 .SUFFIXES: .ada .adb .ads
272
273 # Always use -I$(srcdir)/config when compiling.
274 .c.o:
275         $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
276 .adb.o:
277         $(ADAC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $<
278 .ads.o:
279         $(ADAC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $<
280
281 # This tells GNU make version 3 not to export all the variables
282 # defined in this file into the environment.
283 .NOEXPORT:
284 \f
285 # Lists of files for various purposes.
286
287 # Object files for gnat executables
288 GNATLINK_OBJS = gnatlink.o link.o \
289  ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o gnatvsn.o \
290  hostparm.o namet.o opt.o osint.o output.o rident.o sdefault.o stylesw.o \
291  switch.o table.o tree_io.o types.o validsw.o widechar.o
292
293 GNATMAKE_OBJS = ali.o ali-util.o \
294  alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o einfo.o elists.o \
295  errout.o fmap.o fname.o fname-uf.o fname-sf.o \
296  gnatmake.o gnatvsn.o hostparm.o krunch.o lib.o make.o makeusg.o \
297  mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o mlib-utl.o \
298  namet.o nlists.o opt.o osint.o osint-m.o output.o \
299  prj.o prj-attr.o prj-com.o prj-dect.o prj-env.o prj-ext.o prj-nmsc.o \
300  prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
301  rident.o scans.o scn.o sdefault.o sfn_scan.o sinfo.o sinfo-cn.o \
302  sinput.o sinput-l.o sinput-p.o \
303  snames.o stand.o stringt.o style.o stylesw.o validsw.o switch.o switch-m.o \
304  switch-c.o table.o targparm.o tree_io.o types.o \
305  uintp.o uname.o urealp.o usage.o widechar.o
306
307 # Convert the target variable into a space separated list of architecture,
308 # manufacturer, and operating system and assign each of those to its own
309 # variable.
310
311 host:=$(subst -, ,$(host_canonical))
312 targ:=$(subst -, ,$(target))
313 arch:=$(word 1,$(targ))
314 ifeq ($(words $(targ)),2)
315   manu:=
316   osys:=$(word 2,$(targ))
317 else
318   manu:=$(word 2,$(targ))
319   osys:=$(word 3,$(targ))
320 endif
321
322 # LIBGNAT_TARGET_PAIRS is a list of pairs of filenames.
323 # The members of each pair must be separated by a '<' and no whitespace.
324 # Each pair must be separated by some amount of whitespace from the following
325 # pair.
326
327 # Non-tasking case:
328
329 LIBGNAT_TARGET_PAIRS = \
330 a-intnam.ads<4nintnam.ads \
331 s-inmaop.adb<5ninmaop.adb \
332 s-intman.adb<5nintman.adb \
333 s-osinte.ads<5nosinte.ads \
334 s-osprim.adb<7sosprim.adb \
335 s-taprop.adb<5ntaprop.adb \
336 s-taspri.ads<5ntaspri.ads
337
338 # Default shared object option. Note that we rely on the fact that the "soname"
339 # option will always be present and last in this flag, so that we can have
340 # $(SO_OPTS)libgnat-x.xx
341
342 SO_OPTS = -Wl,-soname,
343
344 # Default gnatlib-shared target.
345 # This is needed on some targets to use a different gnatlib-shared target, e.g
346 # gnatlib-shared-dual
347 GNATLIB_SHARED = gnatlib-shared-default
348
349 # default value for gnatmake's target dependent file
350 MLIB_TGT = mlib-tgt
351
352 # $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
353 # $(strip STRING) removes leading and trailing spaces from STRING.
354 # If what's left is null then it's a match.
355
356 ifeq ($(strip $(filter-out %86 os2 OS2 os2_emx,$(arch) $(osys))),)
357   LIBGNAT_TARGET_PAIRS = \
358   a-excpol.adb<4wexcpol.adb \
359   a-intnam.ads<4nintnam.ads \
360   a-numaux.adb<86numaux.adb \
361   a-numaux.ads<86numaux.ads \
362   s-inmaop.adb<5ninmaop.adb \
363   s-interr.adb<5ointerr.adb \
364   s-intman.adb<5nintman.adb \
365   s-mastop.adb<5omastop.adb \
366   s-osinte.adb<5oosinte.adb \
367   s-osinte.ads<5oosinte.ads \
368   s-osprim.adb<5oosprim.adb \
369   s-parame.adb<5oparame.adb \
370   system.ads<5osystem.ads \
371   s-taprop.adb<5otaprop.adb \
372   s-taspri.ads<5otaspri.ads
373
374   EXTRA_GNATRTL_NONTASKING_OBJS = \
375   i-os2err.o \
376   i-os2lib.o \
377   i-os2syn.o \
378   i-os2thr.o
379 endif
380
381 ifeq ($(strip $(filter-out %86 interix%,$(arch) $(osys))),)
382   LIBGNAT_TARGET_PAIRS = \
383   a-excpol.adb<4hexcpol.adb \
384   a-intnam.ads<4pintnam.ads \
385   a-numaux.adb<86numaux.adb \
386   a-numaux.ads<86numaux.ads \
387   g-soccon.ads<3psoccon.ads \
388   s-inmaop.adb<7sinmaop.adb \
389   s-intman.adb<7sintman.adb \
390   s-mastop.adb<5omastop.adb \
391   s-osinte.adb<7sosinte.adb \
392   s-osinte.ads<5posinte.ads \
393   s-osprim.adb<5posprim.adb \
394   s-taprop.adb<7staprop.adb \
395   system.ads<5psystem.ads \
396   s-taspri.ads<7staspri.ads \
397   s-tpopsp.adb<7stpopsp.adb
398
399   THREADSLIB = -lgthreads -lmalloc
400 endif
401
402 # sysv5uw is SCO UnixWare 7
403 ifeq ($(strip $(filter-out %86 sysv5uw%,$(arch) $(osys))),)
404   LIBGNAT_TARGET_PAIRS = \
405   a-excpol.adb<4wexcpol.adb \
406   a-intnam.ads<41intnam.ads \
407   a-numaux.adb<86numaux.adb \
408   a-numaux.ads<86numaux.ads \
409   s-inmaop.adb<7sinmaop.adb \
410   s-intman.adb<7sintman.adb \
411   s-mastop.adb<5omastop.adb \
412   s-osinte.ads<51osinte.ads \
413   s-osinte.adb<51osinte.adb \
414   s-osprim.adb<5posprim.adb \
415   s-taprop.adb<7staprop.adb \
416   s-taspri.ads<7staspri.ads \
417   s-tpopsp.adb<5atpopsp.adb \
418   system.ads<51system.ads \
419   g-soccon.ads<31soccon.ads \
420   g-soliop.ads<31soliop.ads
421
422   THREADSLIB = -lthread
423   SO_OPTS = -Wl,-h,
424   GNATLIB_SHARED = gnatlib-shared-dual
425   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
426 endif
427
428 ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),)
429   LIBGNAT_TARGET_PAIRS = \
430   a-sytaco.ads<4zsytaco.ads \
431   a-sytaco.adb<4zsytaco.adb \
432   a-intnam.ads<4zintnam.ads \
433   a-numaux.ads<4znumaux.ads \
434   s-inmaop.adb<7sinmaop.adb \
435   s-interr.adb<5zinterr.adb \
436   s-intman.adb<5zintman.adb \
437   s-osinte.adb<5zosinte.adb \
438   s-osinte.ads<5zosinte.ads \
439   s-osprim.adb<5zosprim.adb \
440   s-taprop.adb<5ztaprop.adb \
441   s-taspri.ads<5ztaspri.ads \
442   s-vxwork.ads<5avxwork.ads \
443   g-soccon.ads<3zsoccon.ads \
444   g-socthi.ads<3zsocthi.ads \
445   g-socthi.adb<3zsocthi.adb \
446   system.ads<5zsystem.ads
447
448   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
449   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
450 endif
451
452 ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
453   LIBGNAT_TARGET_PAIRS = \
454   a-sytaco.ads<4zsytaco.ads \
455   a-sytaco.adb<4zsytaco.adb \
456   a-intnam.ads<4zintnam.ads \
457   a-numaux.ads<4znumaux.ads \
458   s-inmaop.adb<7sinmaop.adb \
459   s-interr.adb<5zinterr.adb \
460   s-intman.adb<5zintman.adb \
461   s-osinte.adb<5zosinte.adb \
462   s-osinte.ads<5zosinte.ads \
463   s-osprim.adb<5zosprim.adb \
464   s-taprop.adb<5ztaprop.adb \
465   s-taspri.ads<5ztaspri.ads \
466   s-vxwork.ads<5kvxwork.ads \
467   g-soccon.ads<3zsoccon.ads \
468   g-socthi.ads<3zsocthi.ads \
469   g-socthi.adb<3zsocthi.adb \
470   system.ads<5ksystem.ads
471
472   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
473   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
474
475   ifeq ($(strip $(filter-out yes,$(TRACE))),)
476     LIBGNAT_TARGET_PAIRS += \
477     s-traces.adb<7straces.adb \
478     s-tratas.adb<7stratas.adb \
479     s-trafor.adb<7strafor.adb \
480     s-trafor.ads<7strafor.ads \
481     s-tfsetr.adb<5ztfsetr.adb 
482   endif
483 endif
484
485 ifeq ($(strip $(filter-out powerpc% wrs vx%,$(targ))),)
486   LIBGNAT_TARGET_PAIRS = \
487   a-sytaco.ads<4zsytaco.ads \
488   a-sytaco.adb<4zsytaco.adb \
489   a-intnam.ads<4zintnam.ads \
490   a-numaux.ads<4znumaux.ads \
491   s-inmaop.adb<7sinmaop.adb \
492   s-interr.adb<5zinterr.adb \
493   s-intman.adb<5zintman.adb \
494   s-osinte.adb<5zosinte.adb \
495   s-osinte.ads<5zosinte.ads \
496   s-osprim.adb<5zosprim.adb \
497   s-taprop.adb<5ztaprop.adb \
498   s-taspri.ads<5ztaspri.ads \
499   s-vxwork.ads<5pvxwork.ads \
500   g-soccon.ads<3zsoccon.ads \
501   g-socthi.ads<3zsocthi.ads \
502   g-socthi.adb<3zsocthi.adb \
503   system.ads<5ysystem.ads
504
505   EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads
506   EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o
507   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o
508   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
509 endif
510
511 ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
512   LIBGNAT_TARGET_PAIRS = \
513   a-sytaco.ads<4zsytaco.ads \
514   a-sytaco.adb<4zsytaco.adb \
515   a-intnam.ads<4zintnam.ads \
516   a-numaux.ads<4znumaux.ads \
517   s-inmaop.adb<7sinmaop.adb \
518   s-interr.adb<5zinterr.adb \
519   s-intman.adb<5zintman.adb \
520   s-osinte.adb<5zosinte.adb \
521   s-osinte.ads<5zosinte.ads \
522   s-osprim.adb<5zosprim.adb \
523   s-taprop.adb<5ztaprop.adb \
524   s-taspri.ads<7staspri.ads \
525   s-vxwork.ads<5svxwork.ads \
526   system.ads<5ysystem.ads
527
528   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o
529   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
530 endif
531
532 ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
533   LIBGNAT_TARGET_PAIRS = \
534   a-sytaco.ads<4zsytaco.ads \
535   a-sytaco.adb<4zsytaco.adb \
536   a-intnam.ads<4zintnam.ads \
537   a-numaux.ads<4znumaux.ads \
538   s-inmaop.adb<7sinmaop.adb \
539   s-interr.adb<5zinterr.adb \
540   s-intman.adb<5zintman.adb \
541   s-osinte.adb<5zosinte.adb \
542   s-osinte.ads<5zosinte.ads \
543   s-osprim.adb<5zosprim.adb \
544   s-taprop.adb<5ztaprop.adb \
545   s-taspri.ads<7staspri.ads \
546   s-vxwork.ads<5mvxwork.ads \
547   system.ads<5zsystem.ads
548
549   EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o
550   EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
551 endif
552
553 ifeq ($(strip $(filter-out sparc sun solaris2% sunos5%,$(targ))),)
554   LIBGNAT_TARGET_PAIRS = \
555   a-intnam.ads<4sintnam.ads \
556   s-inmaop.adb<7sinmaop.adb \
557   s-intman.adb<5sintman.adb \
558   s-osinte.adb<5sosinte.adb \
559   s-osinte.ads<5sosinte.ads \
560   s-osprim.adb<5posprim.adb \
561   s-parame.adb<5sparame.adb \
562   s-taprop.adb<5staprop.adb \
563   s-tasinf.adb<5stasinf.adb \
564   s-tasinf.ads<5stasinf.ads \
565   s-taspri.ads<5staspri.ads \
566   s-tpopse.adb<5stpopse.adb \
567   g-soccon.ads<3ssoccon.ads \
568   g-soliop.ads<3ssoliop.ads \
569   system.ads<5ssystem.ads
570
571   THREADSLIB = -lposix4 -lthread
572   MISCLIB = -lposix4 -lnsl -lsocket
573   SYMLIB = -laddr2line -lbfd $(INTLLIBS)
574   SO_OPTS = -Wl,-h,
575   GNATLIB_SHARED = gnatlib-shared-dual
576   GMEM_LIB = gmemlib
577   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
578
579   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
580     LIBGNAT_TARGET_PAIRS = \
581     a-intnam.ads<4sintnam.ads \
582     s-inmaop.adb<7sinmaop.adb \
583     s-intman.adb<5sintman.adb \
584     s-osinte.adb<7sosinte.adb \
585     s-osinte.ads<5tosinte.ads \
586     s-osprim.adb<5posprim.adb \
587     s-taprop.adb<7staprop.adb \
588     s-taspri.ads<7staspri.ads \
589     s-tpopsp.adb<7stpopsp.adb \
590     g-soccon.ads<3ssoccon.ads \
591     g-soliop.ads<3ssoliop.ads \
592     system.ads<5ssystem.ads
593
594     THREADSLIB = -lgthreads -lmalloc
595   endif
596
597   ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
598     LIBGNAT_TARGET_PAIRS = \
599     a-intnam.ads<4sintnam.ads \
600     s-inmaop.adb<7sinmaop.adb \
601     s-intman.adb<7sintman.adb \
602     s-osinte.adb<5iosinte.adb \
603     s-osinte.ads<54osinte.ads \
604     s-osprim.adb<5posprim.adb \
605     s-taprop.adb<7staprop.adb \
606     s-taspri.ads<7staspri.ads \
607     s-tpopsp.adb<5atpopsp.adb \
608     g-soccon.ads<3ssoccon.ads \
609     g-soliop.ads<3ssoliop.ads \
610     system.ads<5ssystem.ads
611
612     THREADSLIB = -lposix4 -lpthread
613   endif
614 endif
615
616 ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
617   LIBGNAT_TARGET_PAIRS = \
618   a-numaux.adb<86numaux.adb \
619   a-numaux.ads<86numaux.ads \
620   a-intnam.ads<4sintnam.ads \
621   s-inmaop.adb<7sinmaop.adb \
622   s-intman.adb<5sintman.adb \
623   s-mastop.adb<5omastop.adb \
624   s-osinte.adb<5sosinte.adb \
625   s-osinte.ads<5sosinte.ads \
626   s-osprim.adb<5posprim.adb \
627   s-parame.adb<5sparame.adb \
628   s-taprop.adb<5staprop.adb \
629   s-tasinf.adb<5stasinf.adb \
630   s-tasinf.ads<5stasinf.ads \
631   s-taspri.ads<5staspri.ads \
632   s-tpopse.adb<5etpopse.adb \
633   g-soccon.ads<3ssoccon.ads \
634   g-soliop.ads<3ssoliop.ads \
635   system.ads<5esystem.ads
636
637   THREADSLIB = -lposix4 -lthread
638   MISCLIB = -lposix4 -lnsl -lsocket
639   SO_OPTS = -Wl,-h,
640   GNATLIB_SHARED = gnatlib-shared-dual
641   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
642 endif
643
644 ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
645   LIBGNAT_TARGET_PAIRS = \
646   a-intnam.ads<4lintnam.ads \
647   a-numaux.adb<86numaux.adb \
648   a-numaux.ads<86numaux.ads \
649   s-inmaop.adb<7sinmaop.adb \
650   s-intman.adb<5lintman.adb \
651   s-mastop.adb<5omastop.adb \
652   s-osinte.adb<5iosinte.adb \
653   s-osinte.ads<5iosinte.ads \
654   s-osprim.adb<7sosprim.adb \
655   s-taprop.adb<5itaprop.adb \
656   s-taspri.ads<5itaspri.ads \
657   s-tpopsp.adb<5atpopsp.adb \
658   system.ads<5lsystem.ads
659
660   TOOLS_TARGET_PAIRS = mlib-tgt.adb<5lml-tgt.adb
661   SYMLIB = -laddr2line -lbfd $(INTLLIBS)
662   THREADSLIB = -lpthread
663   GNATLIB_SHARED = gnatlib-shared-dual
664   GMEM_LIB = gmemlib
665   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
666
667   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
668     LIBGNAT_TARGET_PAIRS = \
669     a-intnam.ads<4lintnam.ads \
670     a-numaux.adb<86numaux.adb \
671     a-numaux.ads<86numaux.ads \
672     s-inmaop.adb<7sinmaop.adb \
673     s-intman.adb<5lintman.adb \
674     s-mastop.adb<5omastop.adb \
675     s-osinte.adb<7sosinte.adb \
676     s-osinte.ads<5losinte.ads \
677     s-osprim.adb<7sosprim.adb \
678     s-taprop.adb<7staprop.adb \
679     s-taspri.ads<7staspri.ads \
680     s-tpopsp.adb<7stpopsp.adb \
681     system.ads<5lsystem.ads
682
683     THREADSLIB = -lgthreads -lmalloc
684   endif
685
686   ifeq ($(strip $(filter-out rt-linux RT-LINUX,$(THREAD_KIND))),)
687     LIBGNAT_TARGET_PAIRS = \
688     a-intnam.ads<4nintnam.ads \
689     s-inmaop.adb<5ninmaop.adb \
690     s-intman.adb<5nintman.adb \
691     s-osinte.adb<5qosinte.adb \
692     s-osinte.ads<5qosinte.ads \
693     s-osprim.adb<5qosprim.adb \
694     s-stache.adb<5qstache.adb \
695     s-taprop.adb<5qtaprop.adb \
696     s-taspri.ads<5qtaspri.ads \
697     system.ads<5lsystem.ads
698
699     RT_FLAGS = -D__RT__
700   endif
701 endif
702
703 ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
704   ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
705     LIBGNAT_TARGET_PAIRS = \
706     a-intnam.ads<4gintnam.ads \
707     s-inmaop.adb<7sinmaop.adb \
708     s-intman.adb<5fintman.adb \
709     s-mastop.adb<5gmastop.adb \
710     s-osinte.adb<5aosinte.adb \
711     s-osinte.ads<5fosinte.ads \
712     s-osprim.adb<7sosprim.adb \
713     s-proinf.adb<5gproinf.adb \
714     s-proinf.ads<5gproinf.ads \
715     s-taprop.adb<5ftaprop.adb \
716     s-tasinf.ads<5ftasinf.ads \
717     s-taspri.ads<7staspri.ads \
718     s-traceb.adb<7straceb.adb \
719     g-soccon.ads<3gsoccon.ads \
720     system.ads<5gsystem.ads
721
722     THREADSLIB = -lpthread
723
724   else
725     LIBGNAT_TARGET_PAIRS = \
726     a-intnam.ads<4gintnam.ads \
727     s-inmaop.adb<5ninmaop.adb \
728     s-interr.adb<5ginterr.adb \
729     s-intman.adb<5gintman.adb \
730     s-mastop.adb<5gmastop.adb \
731     s-osinte.adb<5aosinte.adb \
732     s-osinte.ads<5gosinte.ads \
733     s-osprim.adb<7sosprim.adb \
734     s-proinf.adb<5gproinf.adb \
735     s-proinf.ads<5gproinf.ads \
736     s-taprop.adb<5gtaprop.adb \
737     s-tasinf.adb<5gtasinf.adb \
738     s-tasinf.ads<5gtasinf.ads \
739     s-taspri.ads<7staspri.ads \
740     s-traceb.adb<7straceb.adb \
741     g-soccon.ads<3gsoccon.ads \
742     system.ads<5fsystem.ads
743
744     THREADSLIB = -lathread
745   endif
746
747   TGT_LIB = -lexc
748   MISCLIB = -lexc
749   SO_OPTS = -Wl,-all,-set_version,sgi1.0,-update_registry,../so_locations,-soname,
750   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
751 endif
752
753 ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
754   LIBGNAT_TARGET_PAIRS = \
755   a-excpol.adb<4wexcpol.adb \
756   a-intnam.ads<4hintnam.ads \
757   s-inmaop.adb<7sinmaop.adb \
758   s-interr.adb<5ginterr.adb \
759   s-intman.adb<7sintman.adb \
760   s-osinte.adb<5hosinte.adb \
761   s-osinte.ads<5hosinte.ads \
762   s-parame.ads<5hparame.ads \
763   s-osprim.adb<7sosprim.adb \
764   s-taprop.adb<5htaprop.adb \
765   s-taspri.ads<5htaspri.ads \
766   s-tpopsp.adb<7stpopsp.adb \
767   g-soccon.ads<3hsoccon.ads \
768   system.ads<5hsystem.ads
769 endif
770
771 ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
772   LIBGNAT_TARGET_PAIRS = \
773   a-intnam.ads<4hintnam.ads \
774   s-inmaop.adb<7sinmaop.adb \
775   s-intman.adb<7sintman.adb \
776   s-osinte.adb<5iosinte.adb \
777   s-osinte.ads<53osinte.ads \
778   s-parame.ads<5hparame.ads \
779   s-osprim.adb<7sosprim.adb \
780   s-traceb.adb<5htraceb.adb \
781   s-taprop.adb<7staprop.adb \
782   s-taspri.ads<7staspri.ads \
783   s-tpopsp.adb<5atpopsp.adb \
784   g-soccon.ads<3hsoccon.ads \
785   system.ads<5hsystem.ads
786
787   TGT_LIB = /usr/lib/libcl.a
788   THREADSLIB = -lpthread -lc_r
789   SYMLIB = -laddr2line -lbfd $(INTLLIBS)
790   soext = .sl
791   SO_OPTS = -Wl,+h,
792   GNATLIB_SHARED = gnatlib-shared-dual
793
794   ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),)
795     LIBGNAT_TARGET_PAIRS = \
796     a-excpol.adb<4wexcpol.adb \
797     a-intnam.ads<4hintnam.ads \
798     s-inmaop.adb<7sinmaop.adb \
799     s-interr.adb<5ginterr.adb \
800     s-intman.adb<7sintman.adb \
801     s-osinte.adb<5hosinte.adb \
802     s-osinte.ads<5hosinte.ads \
803     s-parame.ads<5hparame.ads \
804     s-osprim.adb<7sosprim.adb \
805     s-taprop.adb<5htaprop.adb \
806     s-taspri.ads<5htaspri.ads \
807     g-soccon.ads<3hsoccon.ads \
808     system.ads<5hsystem.ads
809
810     TGT_LIB =
811     THREADSLIB = -lcma
812   endif
813 endif
814
815 ifeq ($(strip $(filter-out ibm aix4%,$(manu) $(osys))),)
816   LIBGNAT_TARGET_PAIRS = \
817   a-intnam.ads<4cintnam.ads \
818   s-inmaop.adb<7sinmaop.adb \
819   s-intman.adb<7sintman.adb \
820   s-osinte.adb<5bosinte.adb \
821   s-osinte.ads<5bosinte.ads \
822   s-osprim.adb<7sosprim.adb \
823   s-taprop.adb<7staprop.adb \
824   s-taspri.ads<7staspri.ads \
825   s-tpopsp.adb<7stpopsp.adb \
826   g-soccon.ads<3bsoccon.ads \
827   system.ads<5bsystem.ads
828
829   THREADSLIB = -lpthreads
830   ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
831     LIBGNAT_TARGET_PAIRS = \
832     a-intnam.ads<4cintnam.ads \
833     s-inmaop.adb<7sinmaop.adb \
834     s-intman.adb<7sintman.adb \
835     s-osinte.adb<7sosinte.adb \
836     s-osinte.ads<5cosinte.ads \
837     s-osprim.adb<7sosprim.adb \
838     s-taprop.adb<7staprop.adb \
839     s-taspri.ads<7staspri.ads \
840     s-tpopsp.adb<7stpopsp.adb \
841     g-soccon.ads<3bsoccon.ads \
842     system.ads<5bsystem.ads
843
844     THREADSLIB = -lgthreads -lmalloc
845   endif
846 endif
847
848 ifeq ($(strip $(filter-out lynxos,$(osys))),)
849   ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
850     LIBGNAT_TARGET_PAIRS = \
851     a-numaux.adb<86numaux.adb \
852     a-numaux.ads<86numaux.ads \
853     a-intnam.ads<42intnam.ads \
854     s-mastop.adb<5omastop.adb \
855     s-inmaop.adb<7sinmaop.adb \
856     s-intman.adb<7sintman.adb \
857     s-osinte.adb<52osinte.adb \
858     s-osinte.ads<52osinte.ads \
859     s-osprim.adb<7sosprim.adb \
860     s-taprop.adb<7staprop.adb \
861     s-taspri.ads<7staspri.ads \
862     s-tpopsp.adb<7stpopsp.adb \
863     system.ads<52system.ads
864
865     ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
866       LIBGNAT_TARGET_PAIRS = \
867       a-numaux.adb<86numaux.adb \
868       a-numaux.ads<86numaux.ads \
869       a-intnam.ads<42intnam.ads \
870       s-mastop.adb<5omastop.adb \
871       s-inmaop.adb<7sinmaop.adb \
872       s-intman.adb<7sintman.adb \
873       s-osinte.adb<56osinte.adb \
874       s-osinte.ads<56osinte.ads \
875       s-osprim.adb<7sosprim.adb \
876       s-taprop.adb<56taprop.adb \
877       s-taspri.ads<56taspri.ads \
878       s-tpopsp.adb<5atpopsp.adb \
879       system.ads<52system.ads
880     endif
881
882   else
883     LIBGNAT_TARGET_PAIRS = \
884     a-intnam.ads<42intnam.ads \
885     s-inmaop.adb<7sinmaop.adb \
886     s-intman.adb<7sintman.adb \
887     s-osinte.adb<56osinte.adb \
888     s-osinte.ads<56osinte.ads \
889     s-osprim.adb<7sosprim.adb \
890     s-taprop.adb<56taprop.adb \
891     s-taspri.ads<56taspri.ads \
892     s-tpopsp.adb<5atpopsp.adb \
893     system.ads<52system.ads
894   endif
895 endif
896
897 ifeq ($(strip $(filter-out rtems rtemself rtemsaout rtemscoff,$(osys))),)
898   LIBGNAT_TARGET_PAIRS = \
899   a-intnam.ads<4rintnam.ads \
900   s-inmaop.adb<7sinmaop.adb \
901   s-intman.adb<7sintman.adb \
902   s-osinte.adb<5rosinte.adb \
903   s-osinte.ads<5rosinte.ads \
904   s-osprim.adb<7sosprim.adb \
905   s-parame.adb<5rparame.adb \
906   s-taprop.adb<7staprop.adb \
907   s-taspri.ads<7staspri.ads \
908   s-tpopsp.adb<5rtpopsp.adb
909 endif
910
911 ifeq ($(strip $(filter-out go32 msdos,$(osys))),)
912   LIBGNAT_TARGET_PAIRS = \
913   a-intnam.ads<4dintnam.ads \
914   s-inmaop.adb<7sinmaop.adb \
915   s-intman.adb<7sintman.adb \
916   s-osinte.adb<7sosinte.adb \
917   s-osinte.ads<5dosinte.ads \
918   s-osprim.adb<7sosprim.adb \
919   s-taprop.adb<7staprop.adb \
920   s-taspri.ads<7staspri.ads \
921   s-tpopsp.adb<7stpopsp.adb
922 endif
923
924 ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
925   LIBGNAT_TARGET_PAIRS = \
926   a-intnam.ads<4aintnam.ads \
927   s-inmaop.adb<7sinmaop.adb \
928   s-intman.adb<7sintman.adb \
929   s-mastop.adb<5amastop.adb \
930   s-osinte.adb<5aosinte.adb \
931   s-osinte.ads<5aosinte.ads \
932   s-osprim.adb<5posprim.adb \
933   s-taprop.adb<5ataprop.adb \
934   s-tasinf.ads<5atasinf.ads \
935   s-taspri.ads<5ataspri.ads \
936   s-tpopsp.adb<5atpopsp.adb \
937   s-traceb.adb<7straceb.adb \
938   g-soccon.ads<3asoccon.ads \
939   system.ads<5asystem.ads
940
941   THREADSLIB = -lpthread -lmach -lexc -lrt
942   SYMLIB = -laddr2line -lbfd $(INTLLIBS)
943   LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
944 endif
945
946 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(host))),)
947
948 EXTRA_GNAT1_OBJS = ../prefix.o vmshandler.o
949 EXTRA_GNATBIND_OBJS = ../prefix.o vmshandler.o
950
951 endif
952
953 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
954
955 ifeq ($(strip $(filter-out alpha64% dec vms% openvms% alphavms%,$(targ))),)
956   LIBGNAT_TARGET_PAIRS_AUX =
957 else
958 ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
959   LIBGNAT_TARGET_PAIRS_AUX = \
960   s-parame.ads<5xparame.ads
961 else
962   LIBGNAT_TARGET_PAIRS_AUX = \
963   s-parame.ads<5vparame.ads
964 endif
965 endif
966
967   LIBGNAT_TARGET_PAIRS = \
968   a-caldel.adb<4vcaldel.adb \
969   a-calend.adb<4vcalend.adb \
970   a-calend.ads<4vcalend.ads \
971   a-excpol.adb<4wexcpol.adb \
972   a-intnam.ads<4vintnam.ads \
973   g-enblsp.adb<3venblsp.adb \
974   i-cstrea.adb<6vcstrea.adb \
975   i-cpp.adb<6vcpp.adb \
976   interfac.ads<6vinterf.ads \
977   s-asthan.adb<5vasthan.adb \
978   s-inmaop.adb<5vinmaop.adb \
979   s-interr.adb<5vinterr.adb \
980   s-intman.adb<5vintman.adb \
981   s-intman.ads<5vintman.ads \
982   s-osinte.adb<5vosinte.adb \
983   s-osinte.ads<5vosinte.ads \
984   s-osprim.adb<5vosprim.adb \
985   s-osprim.ads<5vosprim.ads \
986   s-taprop.adb<5vtaprop.adb \
987   s-taspri.ads<5vtaspri.ads \
988   s-tpopde.adb<5vtpopde.adb \
989   s-tpopde.ads<5vtpopde.ads \
990   s-vaflop.adb<5vvaflop.adb \
991   system.ads<5xsystem.ads   \
992   $(LIBGNAT_TARGET_PAIRS_AUX)
993
994   GNATLIB_SHARED=gnatlib-shared-vms
995   EXTRA_LIBGNAT_SRCS=vmshandler.asm
996   EXTRA_LIBGNAT_OBJS=vmshandler.o
997   EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
998   EXTRA_GNATTOOLS_OBJS = ../prefix.o vmshandler.o
999 endif
1000
1001 ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
1002   LIBGNAT_TARGET_PAIRS = \
1003   a-calend.adb<4wcalend.adb \
1004   a-excpol.adb<4wexcpol.adb \
1005   a-intnam.ads<4wintnam.ads \
1006   a-numaux.adb<86numaux.adb \
1007   a-numaux.ads<86numaux.ads \
1008   s-gloloc.adb<5wgloloc.adb \
1009   s-inmaop.adb<5ninmaop.adb \
1010   s-interr.adb<5ginterr.adb \
1011   s-intman.adb<5wintman.adb \
1012   s-mastop.adb<5omastop.adb \
1013   s-memory.adb<5wmemory.adb \
1014   s-osinte.ads<5wosinte.ads \
1015   s-osprim.adb<5wosprim.adb \
1016   s-taprop.adb<5wtaprop.adb \
1017   s-taspri.ads<5wtaspri.ads \
1018   g-socthi.ads<3wsocthi.ads \
1019   g-socthi.adb<3wsocthi.adb \
1020   g-soccon.ads<3wsoccon.ads \
1021   g-soliop.ads<3wsoliop.ads \
1022   system.ads<5wsystem.ads
1023
1024   MISCLIB = -lwsock32
1025   SYMLIB = -laddr2line -lbfd $(INTLLIBS)
1026   GMEM_LIB = gmemlib
1027   EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
1028   EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
1029 endif
1030
1031 # The runtime library for gnat comprises two directories.  One contains the
1032 # Ada source files that the compiler (gnat1) needs -- these files are listed
1033 # by ADA_INCLUDE_SRCS -- and the other contains the object files and their
1034 # corresponding .ali files for the parts written in Ada, libgnat.a for
1035 # the parts of the runtime written in C, and libgthreads.a for the pthreads
1036 # emulation library.  LIBGNAT_OBJS lists the objects that go into libgnat.a,
1037 # while GNATRTL_OBJS lists the object files compiled from Ada sources that
1038 # go into the directory.  The pthreads emulation is built in the threads
1039 # subdirectory and copied.
1040 LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
1041   errno.c exit.c cal.c \
1042   raise.h raise.c sysdep.c types.h aux-io.c init.c \
1043   adafinal.c tracebak.c expect.c mkdir.c $(EXTRA_LIBGNAT_SRCS)
1044
1045 LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o errno.o exit.o \
1046   raise.o sysdep.o aux-io.o init.o cal.o adafinal.o \
1047   tracebak.o expect.o mkdir.o $(EXTRA_LIBGNAT_OBJS)
1048
1049 # NOTE ??? - when the -I option for compiling Ada code is made to work,
1050 #  the library installation will change and there will be a
1051 #  GNAT_RTL_SRCS.  Right now we count on being able to build GNATRTL_OBJS
1052 #  from ADA_INCLUDE_SRCS.
1053
1054 # Objects needed only for tasking
1055 GNATRTL_TASKING_OBJS= \
1056   a-dynpri.o \
1057   a-interr.o \
1058   a-intsig.o \
1059   a-intnam.o \
1060   a-reatim.o \
1061   a-retide.o \
1062   a-sytaco.o \
1063   a-taside.o \
1064   g-thread.o \
1065   s-asthan.o \
1066   s-inmaop.o \
1067   s-interr.o \
1068   s-intman.o \
1069   s-osinte.o \
1070   s-proinf.o \
1071   s-taenca.o \
1072   s-taprob.o \
1073   s-taprop.o \
1074   s-tarest.o \
1075   s-tasdeb.o \
1076   s-tasinf.o \
1077   s-tasini.o \
1078   s-taskin.o \
1079   s-taspri.o \
1080   s-tasque.o \
1081   s-tasres.o \
1082   s-tasren.o \
1083   s-tassta.o \
1084   s-tasuti.o \
1085   s-taasde.o \
1086   s-tadeca.o \
1087   s-tadert.o \
1088   s-tataat.o \
1089   s-tpinop.o \
1090   s-tpoben.o \
1091   s-tpobop.o \
1092   s-tposen.o \
1093   s-tratas.o $(EXTRA_GNATRTL_TASKING_OBJS)
1094
1095 # Objects needed for non-tasking.
1096 GNATRTL_NONTASKING_OBJS= \
1097   a-caldel.o \
1098   a-calend.o \
1099   a-chahan.o \
1100   a-charac.o \
1101   a-chlat1.o \
1102   a-chlat9.o \
1103   a-colien.o \
1104   a-colire.o \
1105   a-comlin.o \
1106   a-cwila1.o \
1107   a-cwila9.o \
1108   a-decima.o \
1109   a-einuoc.o \
1110   a-except.o \
1111   a-exctra.o \
1112   a-filico.o \
1113   a-finali.o \
1114   a-flteio.o \
1115   a-fwteio.o \
1116   a-inteio.o \
1117   a-ioexce.o \
1118   a-iwteio.o \
1119   a-lfteio.o \
1120   a-lfwtio.o \
1121   a-liteio.o \
1122   a-liwtio.o \
1123   a-llftio.o \
1124   a-llfwti.o \
1125   a-llitio.o \
1126   a-lliwti.o \
1127   a-ncelfu.o \
1128   a-nlcefu.o \
1129   a-nlcoty.o \
1130   a-nlelfu.o \
1131   a-nllcef.o \
1132   a-nllcty.o \
1133   a-nllefu.o \
1134   a-nscefu.o \
1135   a-nscoty.o \
1136   a-nselfu.o \
1137   a-nucoty.o \
1138   a-nuelfu.o \
1139   a-nuflra.o \
1140   a-numaux.o \
1141   a-numeri.o \
1142   a-sfteio.o \
1143   a-sfwtio.o \
1144   a-siteio.o \
1145   a-siwtio.o \
1146   a-ssicst.o \
1147   a-ssitio.o \
1148   a-ssiwti.o \
1149   a-stmaco.o \
1150   a-strbou.o \
1151   a-stream.o \
1152   a-strfix.o \
1153   a-string.o \
1154   a-strmap.o \
1155   a-strsea.o \
1156   a-strunb.o \
1157   a-ststio.o \
1158   a-stunau.o \
1159   a-stwibo.o \
1160   a-stwifi.o \
1161   a-stwima.o \
1162   a-stwise.o \
1163   a-stwiun.o \
1164   a-suteio.o \
1165   a-swuwti.o \
1166   a-swmwco.o \
1167   a-tags.o \
1168   a-teioed.o \
1169   a-textio.o \
1170   a-ticoau.o \
1171   a-tideau.o \
1172   a-tienau.o \
1173   a-tiflau.o \
1174   a-tigeau.o \
1175   a-tiinau.o \
1176   a-timoau.o \
1177   a-tiocst.o \
1178   a-titest.o \
1179   a-witeio.o \
1180   a-wtcoau.o \
1181   a-wtcstr.o \
1182   a-wtdeau.o \
1183   a-wtedit.o \
1184   a-wtenau.o \
1185   a-wtflau.o \
1186   a-wtgeau.o \
1187   a-wtinau.o \
1188   a-wtmoau.o \
1189   a-wttest.o \
1190   ada.o \
1191   calendar.o \
1192   g-awk.o \
1193   g-busora.o \
1194   g-calend.o \
1195   g-casuti.o \
1196   g-catiio.o \
1197   g-cgi.o    \
1198   g-cgicoo.o \
1199   g-cgideb.o \
1200   g-comlin.o \
1201   g-crc32.o \
1202   g-curexc.o \
1203   g-debuti.o \
1204   g-debpoo.o \
1205   g-diopit.o \
1206   g-dirope.o \
1207   g-except.o \
1208   g-exctra.o \
1209   g-expect.o \
1210   g-flocon.o \
1211   g-hesora.o \
1212   g-htable.o \
1213   g-io.o \
1214   g-io_aux.o \
1215   g-locfil.o \
1216   g-md5.o \
1217   g-moreex.o \
1218   g-os_lib.o \
1219   g-regexp.o \
1220   g-regpat.o \
1221   g-soccon.o \
1222   g-socket.o \
1223   g-socthi.o \
1224   g-soliop.o \
1225   g-souinf.o \
1226   g-speche.o \
1227   g-spipat.o \
1228   g-spitbo.o \
1229   g-sptabo.o \
1230   g-sptain.o \
1231   g-sptavs.o \
1232   g-tasloc.o \
1233   g-traceb.o \
1234   gnat.o \
1235   i-c.o \
1236   i-cexten.o \
1237   i-cobol.o \
1238   i-cpp.o \
1239   i-cstrea.o \
1240   i-cstrin.o \
1241   i-fortra.o \
1242   i-pacdec.o \
1243   interfac.o \
1244   ioexcept.o \
1245   machcode.o \
1246   s-addima.o \
1247   s-arit64.o \
1248   s-assert.o \
1249   s-auxdec.o \
1250   s-bitops.o \
1251   s-chepoo.o \
1252   s-crc32.o  \
1253   s-direio.o \
1254   s-errrep.o \
1255   s-except.o \
1256   s-exctab.o \
1257   s-exnflt.o \
1258   s-exngen.o \
1259   s-exnint.o \
1260   s-exnlfl.o \
1261   s-exnlin.o \
1262   s-exnllf.o \
1263   s-exnlli.o \
1264   s-exnsfl.o \
1265   s-exnsin.o \
1266   s-exnssi.o \
1267   s-expflt.o \
1268   s-expgen.o \
1269   s-expint.o \
1270   s-explfl.o \
1271   s-explin.o \
1272   s-expllf.o \
1273   s-explli.o \
1274   s-expllu.o \
1275   s-expmod.o \
1276   s-expsfl.o \
1277   s-expsin.o \
1278   s-expssi.o \
1279   s-expuns.o \
1280   s-fatflt.o \
1281   s-fatlfl.o \
1282   s-fatllf.o \
1283   s-fatsfl.o \
1284   s-ficobl.o \
1285   s-fileio.o \
1286   s-finimp.o \
1287   s-finroo.o \
1288   s-fore.o \
1289   s-imgbiu.o \
1290   s-imgboo.o \
1291   s-imgcha.o \
1292   s-imgdec.o \
1293   s-imgenu.o \
1294   s-imgint.o \
1295   s-imgllb.o \
1296   s-imglld.o \
1297   s-imglli.o \
1298   s-imgllu.o \
1299   s-imgllw.o \
1300   s-imgrea.o \
1301   s-imguns.o \
1302   s-imgwch.o \
1303   s-imgwiu.o \
1304   s-io.o \
1305   s-gloloc.o \
1306   s-maccod.o \
1307   s-mantis.o \
1308   s-mastop.o \
1309   s-osprim.o \
1310   s-pack03.o \
1311   s-pack05.o \
1312   s-pack06.o \
1313   s-pack07.o \
1314   s-pack09.o \
1315   s-pack10.o \
1316   s-pack11.o \
1317   s-pack12.o \
1318   s-pack13.o \
1319   s-pack14.o \
1320   s-pack15.o \
1321   s-pack17.o \
1322   s-pack18.o \
1323   s-pack19.o \
1324   s-pack20.o \
1325   s-pack21.o \
1326   s-pack22.o \
1327   s-pack23.o \
1328   s-pack24.o \
1329   s-pack25.o \
1330   s-pack26.o \
1331   s-pack27.o \
1332   s-pack28.o \
1333   s-pack29.o \
1334   s-pack30.o \
1335   s-pack31.o \
1336   s-pack33.o \
1337   s-pack34.o \
1338   s-pack35.o \
1339   s-pack36.o \
1340   s-pack37.o \
1341   s-pack38.o \
1342   s-pack39.o \
1343   s-pack40.o \
1344   s-pack41.o \
1345   s-pack42.o \
1346   s-pack43.o \
1347   s-pack44.o \
1348   s-pack45.o \
1349   s-pack46.o \
1350   s-pack47.o \
1351   s-pack48.o \
1352   s-pack49.o \
1353   s-pack50.o \
1354   s-pack51.o \
1355   s-pack52.o \
1356   s-pack53.o \
1357   s-pack54.o \
1358   s-pack55.o \
1359   s-pack56.o \
1360   s-pack57.o \
1361   s-pack58.o \
1362   s-pack59.o \
1363   s-pack60.o \
1364   s-pack61.o \
1365   s-pack62.o \
1366   s-pack63.o \
1367   s-parame.o \
1368   s-parint.o \
1369   s-pooglo.o \
1370   s-pooloc.o \
1371   s-poosiz.o \
1372   s-powtab.o \
1373   s-rpc.o \
1374   s-scaval.o \
1375   s-secsta.o \
1376   s-sequio.o \
1377   s-shasto.o \
1378   s-sopco3.o \
1379   s-sopco4.o \
1380   s-sopco5.o \
1381   s-stache.o \
1382   s-stalib.o \
1383   s-stoele.o \
1384   s-stopoo.o \
1385   s-stratt.o \
1386   s-strops.o \
1387   s-soflin.o \
1388   s-memory.o \
1389   s-traceb.o \
1390   s-traces.o \
1391   s-unstyp.o \
1392   s-vaflop.o \
1393   s-valboo.o \
1394   s-valcha.o \
1395   s-valdec.o \
1396   s-valenu.o \
1397   s-valint.o \
1398   s-vallld.o \
1399   s-vallli.o \
1400   s-valllu.o \
1401   s-valrea.o \
1402   s-valuns.o \
1403   s-valuti.o \
1404   s-valwch.o \
1405   s-vercon.o \
1406   s-vmexta.o \
1407   s-wchcnv.o \
1408   s-wchcon.o \
1409   s-wchjis.o \
1410   s-wchstw.o \
1411   s-wchwts.o \
1412   s-widboo.o \
1413   s-widcha.o \
1414   s-widenu.o \
1415   s-widlli.o \
1416   s-widllu.o \
1417   s-widwch.o \
1418   s-wwdcha.o \
1419   s-wwdenu.o \
1420   s-wwdwch.o \
1421   system.o \
1422   text_io.o $(EXTRA_GNATRTL_NONTASKING_OBJS)
1423
1424 GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) g-trasym.o
1425
1426 # Files which are suitable in no run time/hi integrity mode
1427
1428 HIE_SOURCES = \
1429  system.ads   \
1430  ada.ads      \
1431  a-unccon.ads \
1432  a-uncdea.ads \
1433  gnat.ads     \
1434  g-souinf.ads \
1435  interfac.ads \
1436  s-stoele.ads \
1437  s-stoele.adb \
1438  unchconv.ads \
1439  unchdeal.ads \
1440  s-maccod.ads \
1441  s-unstyp.ads \
1442  s-fatgen.ads \
1443  s-fatgen.adb \
1444  s-fatflt.ads \
1445  s-fatlfl.ads \
1446  s-fatllf.ads \
1447  s-fatsfl.ads \
1448  s-secsta.ads \
1449  s-secsta.adb \
1450  a-tags.ads   \
1451  a-tags.adb $(EXTRA_HIE_SOURCES)
1452
1453 HIE_OBJS =  \
1454  system.o   \
1455  ada.o      \
1456  a-except.o \
1457  gnat.o     \
1458  g-souinf.o \
1459  interfac.o \
1460  i-c.o      \
1461  s-stoele.o \
1462  s-maccod.o \
1463  s-unstyp.o \
1464  s-fatflt.o \
1465  s-fatlfl.o \
1466  s-fatllf.o \
1467  s-secsta.o \
1468  a-tags.o $(EXTRA_HIE_OBJS)
1469
1470 # Files which are needed in ravenscar mode
1471
1472 RAVEN_SOURCES = \
1473  $(HIE_SOURCES) \
1474  s-parame.ads \
1475  s-parame.adb \
1476  g-except.ads \
1477  s-osinte.ads \
1478  s-osinte.adb \
1479  s-tasinf.ads \
1480  s-tasinf.adb \
1481  s-taspri.ads \
1482  s-taprop.ads \
1483  s-taprop.adb \
1484  s-taskin.ads \
1485  s-taskin.adb \
1486  s-interr.ads \
1487  s-interr.adb \
1488  a-interr.ads \
1489  a-interr.adb \
1490  a-intnam.ads \
1491  a-reatim.ads \
1492  a-reatim.adb \
1493  a-retide.ads \
1494  a-retide.adb \
1495  s-taprob.ads \
1496  s-taprob.adb \
1497  s-tposen.ads \
1498  s-tposen.adb \
1499  s-tasres.ads \
1500  s-tarest.ads \
1501  s-tarest.adb $(EXTRA_RAVEN_SOURCES)
1502
1503 # Objects to generate for the ravenscar run time
1504
1505 RAVEN_OBJS = \
1506  $(HIE_OBJS) \
1507  s-parame.o  \
1508  g-except.o  \
1509  s-osinte.o  \
1510  s-tasinf.o  \
1511  s-taspri.o  \
1512  s-taprop.o  \
1513  s-taskin.o  \
1514  s-interr.o  \
1515  a-interr.o  \
1516  a-intnam.o  \
1517  a-reatim.o  \
1518  a-retide.o  \
1519  s-taprob.o  \
1520  s-tposen.o  \
1521  s-tasres.o  \
1522  s-tarest.o  $(EXTRA_RAVEN_OBJS)
1523
1524 # Default run time files
1525
1526 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
1527 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
1528
1529 ADA_INCLUDE_SRCS =\
1530  ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
1531  machcode.ads text_io.ads unchconv.ads unchdeal.ads \
1532  sequenio.ads system.ads Makefile.adalib memtrack.adb \
1533  a-*.adb a-*.ads g-*.ad? i-*.ad? \
1534  s-[a-o]*.adb s-[p-z]*.adb \
1535  s-[a-o]*.ads s-[p-z]*.ads
1536
1537 # Language-independent object files.
1538 LIBGNAT=../rts/libgnat.a 
1539 TOOLS_FLAGS_TO_PASS=            \
1540         "CC=$(CC)"              \
1541         "CFLAGS=$(CFLAGS)"      \
1542         "LDFLAGS=$(LDFLAGS)"    \
1543         "ADAFLAGS=$(ADAFLAGS)"  \
1544         "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
1545         "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
1546         "libsubdir=$(libsubdir)"        \
1547         "exeext=$(exeext)"      \
1548         "srcdir=$(fsrcdir)"     \
1549         "VPATH=$(fsrcdir)"      \
1550         "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)"   \
1551         "GNATMAKE=$(GNATMAKE)"  \
1552         "GNATLINK=$(GNATLINK)"  \
1553         "GNATBIND=$(GNATBIND)"
1554
1555 # Build directory for the tools. Let's copy the target dependent
1556 # sources using the same mechanism as for gnatlib. The other sources are 
1557 # accessed using the vpath directive below
1558
1559 ../stamp-tools:
1560         -$(RM) tools/*
1561         -$(RMDIR) tools
1562         -$(MKDIR) tools
1563         -(cd tools; $(LN_S) ../sdefault.adb .)
1564         -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
1565                   $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\
1566                   $(LN_S) $(fsrcdir)/$(word 2,$(subst <, ,$(PAIR))) \
1567                         tools/$(word 1,$(subst <, ,$(PAIR)));)
1568         touch ../stamp-tools
1569
1570 # when compiling the tools, the runtime has to be first on the path so that
1571 # it hides the runtime files lying with the rest of the sources
1572 ifeq ($(TOOLSCASE),native)
1573   vpath %.ads ../rts ../
1574   vpath %.adb ../rts ../
1575   vpath %.c   ../rts ../
1576   vpath %.h   ../rts ../
1577 endif
1578
1579 # in the cross tools case, everything is compiled with the native 
1580 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
1581 ifeq ($(TOOLSCASE),cross)
1582   vpath %.ads ../
1583   vpath %.adb ../
1584   vpath %.c   ../
1585   vpath %.h   ../
1586 endif
1587
1588 # gnatmake/link  tools cannot always be built with gnatmake/link for bootstrap 
1589 # reasons: gnatmake should be built with a recent compiler, a recent compiler
1590 # may not generate ALI files compatible with an old gnatmake so it is important
1591 # to be able to build gnatmake without a version of gnatmake around. Once 
1592 # everything has been compiled once, gnatmake can be recompiled with itself 
1593 # (see target gnattools1-re) 
1594 gnattools1: ../stamp-tools ../stamp-gnatlib
1595         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1596           TOOLSCASE=native \
1597           ../../gnatmake$(exeext) ../../gnatlink$(exeext) ../../gnatbl$(exeext)
1598
1599 # gnatmake/link can be build with recent gnatmake/link if they are available.
1600 # This is especially convenient for building cross tools or for rebuilding
1601 # the tools when the original bootstrap has already be done.
1602 gnattools1-re: ../stamp-tools
1603         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1604           TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
1605
1606 # these tools are built with gnatmake & are common to native and cross
1607 gnattools2: ../stamp-tools
1608         $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1609           TOOLSCASE=native \
1610           ../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
1611           ../../gnatls$(exeext) ../../gnatprep$(exeext) \
1612           ../../gnatpsta$(exeext) ../../gnatxref$(exeext) \
1613           ../../gnatfind$(exeext) ../../gnatname$(exeext)
1614
1615 # These tools are only built for the native version.
1616 gnattools3: ../stamp-tools
1617 #       $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
1618 #         TOOLSCASE=native \
1619 #         top_builddir=../.. ../../gnatmem$(exeext) $(EXTRA_GNATTOOLS)
1620
1621 ../../gnatchop$(exeext):
1622         $(GNATMAKE) -c $(ADA_INCLUDES) gnatchop --GCC="$(CC) $(ALL_ADAFLAGS)"
1623         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatchop 
1624         $(GNATLINK) -v gnatchop -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1625                 $(TOOLS_LIBS)
1626
1627 ../../gnat$(exeext):
1628         $(GNATMAKE) -c $(ADA_INCLUDES) gnatcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
1629         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatcmd 
1630         $(GNATLINK) -v gnatcmd -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1631                 $(TOOLS_LIBS)
1632
1633 ../../gnatkr$(exeext):
1634         $(GNATMAKE) -c $(ADA_INCLUDES) gnatkr --GCC="$(CC) $(ALL_ADAFLAGS)"
1635         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatkr 
1636         $(GNATLINK) -v gnatkr -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1637
1638 ../../gnatls$(exeext):
1639         $(GNATMAKE) -c $(ADA_INCLUDES) gnatls --GCC="$(CC) $(ALL_ADAFLAGS)"
1640         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatls 
1641         $(GNATLINK) -v gnatls -o $@ --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1642
1643 ../../gnatname$(exeext):
1644         $(GNATMAKE) -c $(ADA_INCLUDES) gnatname --GCC="$(CC) $(ALL_ADAFLAGS)"
1645         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatname 
1646         $(GNATLINK) -v gnatname -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1647                 $(TOOLS_LIBS)
1648
1649 ../../gnatprep$(exeext):
1650         $(GNATMAKE) -c $(ADA_INCLUDES) gnatprep --GCC="$(CC) $(ALL_ADAFLAGS)"
1651         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatprep 
1652         $(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1653                 $(TOOLS_LIBS)
1654
1655 ../../gnatpsta$(exeext): deftarg.o
1656         $(GNATMAKE) -c $(ADA_INCLUDES) gnatpsta --GCC="$(CC) $(ALL_ADAFLAGS)"
1657         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatpsta 
1658         $(GNATLINK) -v gnatpsta -o $@ --GCC="$(CC) $(ADA_INCLUDES)"\
1659                       ../targtyps.o deftarg.o $(TOOLS_LIBS)
1660
1661 ../../gnatxref$(exeext):
1662         $(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
1663         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref 
1664         $(GNATLINK) -v gnatxref -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1665                 $(TOOLS_LIBS)
1666
1667 ../../gnatfind$(exeext):
1668         $(GNATMAKE) -c $(ADA_INCLUDES) gnatfind --GCC="$(CC) $(ALL_ADAFLAGS)"
1669         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatfind 
1670         $(GNATLINK) -v gnatfind -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1671                 $(TOOLS_LIBS)
1672
1673 ../../gnatmem$(exeext): gmem.o $(SYMDEPS)
1674         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmem --GCC="$(CC) $(ALL_ADAFLAGS)"
1675         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmem 
1676         $(GNATLINK) -v gnatmem -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1677                     gmem.o $(SYMLIB) $(TOOLS_LIBS)
1678
1679 ../../gnatdll$(exeext):
1680         $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
1681         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) $(GNATBIND_FLAGS) gnatdll
1682         $(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
1683                 $(TOOLS_LIBS)
1684
1685 gnatmake-re:
1686         $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
1687         $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
1688         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake 
1689         $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
1690                 --GCC="$(CC) $(ADA_INCLUDES)" $(TOOLS_LIBS)
1691
1692 # Note the use of the "mv" command in order to allow gnatlink to be linked with
1693 # with the former version of gnatlink itself which cannot override itself.
1694 gnatlink-re: link.o
1695         $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
1696         $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink 
1697         $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
1698                 --GCC="$(CC) $(ADA_INCLUDES)" link.o $(TOOLS_LIBS)
1699         $(MV)  ../../gnatlinknew$(exeext)  ../../gnatlink$(exeext)
1700   
1701
1702 # Needs to be built with CC=gcc
1703 # Since the RTL should be built with the latest compiler, remove the
1704 #  stamp target in the parent directory whenever gnat1 is rebuilt
1705 # Likewise for the tools
1706 ../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
1707         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
1708               $(TOOLS_LIBS)
1709
1710 ../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
1711         $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
1712               $(TOOLS_LIBS)
1713
1714 ../../gnatbl$(exeext): gnatbl.o
1715         $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) gnatbl.o $(TOOLS_LIBS)
1716
1717 gnatbl.o: gnatbl.c adaint.h
1718         $(CC) $(ALL_CFLAGS) $(INCLUDES) -c $< 
1719   
1720 ../stamp-gnatlib:
1721         @if [ ! -f stamp-gnatlib ] ; \
1722         then \
1723           $(ECHO) You must first build the GNAT library: make gnatlib; \
1724           false; \
1725         else \
1726           true; \
1727         fi
1728
1729 install-gnatlib: ../stamp-gnatlib
1730 #       Create the directory before deleting it, in case the directory is
1731 #       a list of directories (as it may be on VMS). This ensures we are
1732 #       deleting the right one.
1733         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1734         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1735         $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1736         $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1737         -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1738         -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
1739         -$(INSTALL_DATA) rts/Makefile.adalib $(DESTDIR)$(ADA_RTL_OBJ_DIR)
1740         for file in rts/*.ali; do \
1741             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1742         done
1743         -for file in rts/*$(arext);do \
1744             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1745         done
1746 ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(targ))),)
1747         -for file in rts/lib*$(soext);do \
1748             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1749         done
1750 else
1751         -for file in rts/lib*-**$(soext);do \
1752             $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
1753         done
1754 endif
1755         -( cd $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1756           $(LN_S) libgnat-*$(soext) libgnat$(soext) )
1757         -( cd $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
1758           $(LN_S) libgnarl-*$(soext) libgnarl$(soext) )
1759 # This copy must be done preserving the date on the original file.
1760         for file in rts/*.adb rts/*.ads; do \
1761             $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
1762         done
1763         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
1764         cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
1765
1766 ../stamp-gnatlib2:
1767         $(RM) rts/s-*.ali
1768         $(RM) rts/s-*$(objext)
1769         $(RM) rts/a-*.ali
1770         $(RM) rts/a-*$(objext)
1771         $(RM) rts/*.ali
1772         $(RM) rts/*$(objext)
1773         $(RM) rts/*$(arext)
1774         $(RM) rts/*$(soext)
1775         touch ../stamp-gnatlib2
1776         $(RM) ../stamp-gnatlib
1777
1778 # NOTE: The $(foreach ...) commands assume ";" is the valid separator between
1779 #       successive target commands. Although the Gnu make documentation
1780 #       implies this is true on all systems, I suspect it may not be, So care
1781 #       has been taken to allow a sed script to look for ";)" and substitue
1782 #       for ";" the appropriate character in the range of lines below
1783 #       beginning with "GNULLI Begin" and ending with "GNULLI End"
1784
1785 # GNULLI Begin ###########################################################
1786
1787 ../stamp-gnatlib1: Makefile ../stamp-gnatlib2
1788         $(RMDIR) rts
1789         $(MKDIR) rts
1790         $(CHMOD) u+w rts
1791 # Copy target independent sources
1792         $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
1793           $(LN_S) $(fsrcpfx)$(f) rts ;) true
1794 # Remove files to be replaced by target dependent sources
1795         $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1796                         rts/$(word 1,$(subst <, ,$(PAIR))))
1797 # Copy new target dependent sources
1798         $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
1799                   $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1800                         rts/$(word 1,$(subst <, ,$(PAIR)));)
1801         $(RM) ../stamp-gnatlib
1802         touch ../stamp-gnatlib1
1803
1804 # GNULLI End #############################################################
1805
1806 # Don't use semicolon separated shell commands that involve list expansions.
1807 # The semicolon triggers a call to DCL on VMS and DCL can't handle command
1808 # line lengths in excess of 256 characters.
1809 # Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
1810 # is guaranteed to overflow the buffer.
1811
1812 gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
1813 #       ../xgcc -B../ -dD -E ../tconfig.h $(INCLUDES) > rts/tconfig.h
1814         $(MAKE) -C rts CC="../../xgcc -B../../" \
1815                 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
1816                 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
1817                 srcdir=$(fsrcdir) VPATH=$(fsrcdir) \
1818                 -f ../Makefile $(LIBGNAT_OBJS) prefix.o
1819         $(MAKE) -C rts CC="../../xgcc -B../../" \
1820                 ADA_INCLUDES="$(ADA_INCLUDES_FOR_SUBDIR)" \
1821                 CFLAGS="$(GNATLIBCFLAGS)" ADA_CFLAGS="$(GNATLIBCFLAGS)" \
1822                 ADAFLAGS="$(GNATLIBFLAGS)" \
1823                 srcdir=$(fsrcdir) VPATH=$(fsrcdir) \
1824                 -f ../Makefile \
1825                 $(GNATRTL_OBJS)
1826         $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
1827         $(AR) $(AR_FLAGS) rts/libgnat$(arext) \
1828            $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) prefix.o)
1829         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnat$(arext); else true; fi
1830         $(AR) $(AR_FLAGS) rts/libgnarl$(arext) \
1831            $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
1832         if $(RANLIB_TEST) ; then $(RANLIB) rts/libgnarl$(arext); else true; fi
1833         ifeq ($(GMEM_LIB),gmemlib)
1834                 $(AR) $(AR_FLAGS) rts/libgmem$(arext) rts/memtrack.o;
1835         endif
1836         $(CHMOD) a-wx rts/*.ali
1837         touch ../stamp-gnatlib
1838
1839 HIE_NONE_TARGET_PAIRS=\
1840  a-except.ads<1aexcept.ads \
1841  a-except.adb<1aexcept.adb \
1842  a-tags.adb<1atags.adb \
1843  s-secsta.ads<1ssecsta.ads \
1844  s-secsta.adb<1ssecsta.adb \
1845  i-c.ads<1ic.ads
1846
1847 HIE_SUBST:='s/High_Integrity_Mode.*/High_Integrity_Mode      : constant Boolean := True;/'
1848 # This target needs RTS_NAME, RTS_SRCS, RTS_TARGET_PAIRS to be set properly
1849 # it creates a rts with the proper structure and the right target dependent srcs
1850 prepare-rts:
1851         $(RMDIR) rts-$(RTS_NAME)
1852         $(MKDIR) rts-$(RTS_NAME)
1853         $(CHMOD) u+w rts-$(RTS_NAME)
1854         $(MKDIR) rts-$(RTS_NAME)/adalib
1855         $(MKDIR) rts-$(RTS_NAME)/adainclude
1856         $(CHMOD) u+w rts-$(RTS_NAME)/*
1857         $(LN) $(fsrcpfx)$(RTS_NAME).gpr rts-$(RTS_NAME)
1858 # Copy target independent sources
1859         $(foreach f,$(RTS_SRCS), \
1860           $(LN) $(fsrcpfx)$(f) rts-$(RTS_NAME)/adainclude ;) true
1861 # Remove files to be replaced by target dependent sources
1862         $(RM) $(foreach PAIR,$(RTS_TARGET_PAIRS), \
1863                  rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR))))
1864 # Copy new target dependent sources
1865         $(foreach PAIR,$(RTS_TARGET_PAIRS), \
1866             $(LN) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
1867                     rts-$(RTS_NAME)/adainclude/$(word 1,$(subst <, ,$(PAIR)));)
1868 # change system.High_Integrity_Mode to true for the none & ravenscar rts
1869         ifeq ($(filter-out none ravenscar,$(RTS_NAME)),)
1870           sed -e $(HIE_SUBST) rts-$(RTS_NAME)/adainclude/system.ads \
1871               > dummy
1872           $(MV) dummy rts-$(RTS_NAME)/adainclude/system.ads
1873         endif
1874
1875 install-rts: force
1876         $(CP) -r rts-$(RTS_NAME) $(DESTDIR)$(libsubdir)/
1877
1878 rts-none: force
1879         $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
1880            RTS_NAME=none RTS_SRCS="$(HIE_SOURCES)" \
1881            RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" 
1882         -$(GNATMAKE) -Prts-none/none.gpr
1883         $(RM) rts-none/adalib/*.o
1884         $(CHMOD) a-wx rts-none/adalib/*.ali
1885
1886 rts-ravenscar: force
1887         $(MAKE)  $(FLAGS_TO_PASS) prepare-rts \
1888            RTS_NAME=ravenscar RTS_SRCS="$(RAVEN_SOURCES)" \
1889            RTS_TARGET_PAIRS="$(HIE_RAVEN_TARGET_PAIRS)" 
1890         -$(GNATMAKE) -Prts-ravenscar/none.gpr
1891         $(CHMOD) a-wx rts-ravenscar/adalib/*.ali
1892
1893 internal-hielib: ../stamp-gnatlib1
1894         sed -e 's/High_Integrity_Mode.*/High_Integrity_Mode       : constant Boolean := True;/' rts/system.ads > rts/s.ads
1895         $(MV) rts/s.ads rts/system.ads
1896         $(MAKE) -C rts CC="../../xgcc -B../../" \
1897           ADA_INCLUDES="$(ADA_INCLUDES_FOR_SUBDIR)" \
1898           CFLAGS="$(GNATLIBCFLAGS)" \
1899           ADAFLAGS="$(GNATLIBFLAGS)" \
1900           srcdir=$(fsrcdir) VPATH=$(fsrcdir) \
1901           -f ../Makefile \
1902           $(HIE_OBJS)
1903         $(CHMOD) a-wx rts/*.ali
1904         $(RM) $(addprefix rts/,$(HIE_OBJS))
1905         touch ../stamp-gnatlib
1906
1907 hielib:
1908         $(MAKE) ADA_INCLUDE_SRCS="$(HIE_SOURCES)" LIBGNAT_SRCS="" \
1909           LIBGNAT_TARGET_PAIRS="a-except.ads<1aexcept.ads \
1910             a-except.adb<1aexcept.adb \
1911             a-tags.adb<1atags.adb \
1912             s-secsta.ads<1ssecsta.ads \
1913             s-secsta.adb<1ssecsta.adb \
1914             i-c.ads<1ic.ads" internal-hielib
1915
1916 internal-ravenlib: ../stamp-gnatlib1
1917         sed -e 's/High_Integrity_Mode.*/High_Integrity_Mode       : constant Boolean := True;/' rts/system.ads > rts/s.ads
1918         $(MV) rts/s.ads rts/system.ads
1919         $(MAKE) -C rts CC="../../xgcc -B../../" \
1920           ADA_INCLUDES="$(ADA_INCLUDES_FOR_SUBDIR)" \
1921           CFLAGS="$(GNATLIBCFLAGS)" \
1922           ADAFLAGS="$(GNATLIBFLAGS)" \
1923           srcdir=$(fsrcdir) VPATH=$(fsrcdir) \
1924           -f ../Makefile \
1925           $(RAVEN_OBJS)
1926         $(CHMOD) a-wx rts/*.ali
1927         touch ../stamp-gnatlib
1928
1929 # Target for building a ravenscar run time for VxWorks/Cert PPC
1930 ravenppclib:
1931         $(MAKE) ADA_INCLUDE_SRCS="$(RAVEN_SOURCES)" LIBGNAT_SRCS="" \
1932           LIBGNAT_TARGET_PAIRS="a-except.ads<1aexcept.ads \
1933             a-except.adb<1aexcept.adb \
1934             a-tags.adb<1atags.adb \
1935             s-secsta.ads<1ssecsta.ads \
1936             s-secsta.adb<1ssecsta.adb \
1937             i-c.ads<1ic.ads           \
1938             a-reatim.ads<1areatim.ads \
1939             a-reatim.adb<1areatim.adb \
1940             a-retide.adb<1aretide.adb \
1941             a-interr.adb<1ainterr.adb \
1942             s-interr.ads<1sinterr.ads \
1943             s-interr.adb<1sinterr.adb \
1944             s-taskin.ads<1staskin.ads \
1945             s-taskin.adb<1staskin.adb \
1946             s-tarest.adb<1starest.adb \
1947             s-tposen.ads<1stposen.ads \
1948             s-tposen.adb<1stposen.adb \
1949             s-osinte.adb<1sosinte.adb \
1950             s-taprop.ads<1staprop.ads \
1951             s-taprop.adb<1staprop.adb \
1952             a-sytaco.ads<1asytaco.ads \
1953             a-sytaco.adb<1asytaco.adb \
1954             a-intnam.ads<4zintnam.ads \
1955             s-osinte.adb<5zosinte.adb \
1956             s-osinte.ads<5zosinte.ads \
1957             s-taspri.ads<5ztaspri.ads \
1958             s-vxwork.ads<5pvxwork.ads \
1959             system.ads<5ysystem.ads" internal-ravenlib
1960
1961 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
1962 gnatlib-shared-default:
1963         $(MAKE) $(FLAGS_TO_PASS) \
1964              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1965              GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
1966              THREAD_KIND="$(THREAD_KIND)" \
1967              gnatlib
1968         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
1969         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1970                 -o libgnat-$(LIBRARY_VERSION)$(soext) \
1971                 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
1972                 $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) $(MISCLIB) -lm
1973         cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
1974                 -o libgnarl-$(LIBRARY_VERSION)$(soext) \
1975                 $(GNATRTL_TASKING_OBJS) \
1976                 $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) $(THREADSLIB)
1977         cd rts; $(LN_S) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
1978         cd rts; $(LN_S) libgnarl-$(LIBRARY_VERSION)$(soext) libgnarl$(soext)
1979
1980 gnatlib-shared-dual:
1981         $(MAKE) $(FLAGS_TO_PASS) \
1982              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1983              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1984              THREAD_KIND="$(THREAD_KIND)" \
1985              gnatlib
1986         $(MV) rts/libgnat$(arext) rts/libgnarl$(arext) .
1987         $(RM) ../stamp-gnatlib2
1988         $(MAKE) $(FLAGS_TO_PASS) \
1989              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1990              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1991              THREAD_KIND="$(THREAD_KIND)" \
1992              gnatlib-shared-default
1993         $(MV) libgnat$(arext) libgnarl$(arext) rts
1994
1995 gnatlib-shared-vms:
1996         $(MAKE) $(FLAGS_TO_PASS) \
1997              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
1998              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
1999              THREAD_KIND="$(THREAD_KIND)" \
2000              gnatlib
2001         $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
2002         rm -f rts/*.sym rts/gnatlib_symvec.opt 
2003         make -C rts -f ../Makefile.vms \
2004            $(patsubst %.obj,%.sym,$(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS)) 
2005         append /new [.rts]*.sym [.rts]gnatlib_symvec.opt 
2006         ../xgcc.exe -g -B../ -nostartfiles -shared --for-linker=/noinform \
2007            -o rts/libgnat.exe rts/libgnat.olb \
2008            --for-linker=rts/gnatlib_symvec.opt \
2009            --for-linker=gsmatch=equal,YY,MMDD
2010         rm -f rts/*.sym rts/gnatlib_symvec.opt 
2011         make -C rts -f ../Makefile.vms \
2012            $(patsubst %.obj,%.sym,$(GNATRTL_TASKING_OBJS)) 
2013         append /new [.rts]*.sym [.rts]gnatlib_symvec.opt 
2014         ../xgcc.exe -g -B../ -nostartfiles -shared --for-linker=/noinform \
2015            -o rts/libgnarl.exe rts/libgnarl.olb rts/libgnat.exe \
2016            --for-linker=rts/gnatlib_symvec.opt \
2017            --for-linker=gsmatch=equal,YY,MMDD
2018
2019 gnatlib-shared:
2020         $(MAKE) $(FLAGS_TO_PASS) \
2021              GNATLIBFLAGS="$(GNATLIBFLAGS)" \
2022              GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
2023              THREAD_KIND="$(THREAD_KIND)" \
2024              TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
2025              $(GNATLIB_SHARED)
2026
2027 # .s files for cross-building
2028 gnat-cross: force
2029         make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp" \
2030                 HOST_CFLAGS= HOST_CC=cc
2031
2032 # Compiling object files from source files.
2033
2034 # Ada language specific files.
2035
2036 b_gnatl.c : $(GNATLINK_OBJS)
2037         $(GNATBIND) $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
2038 b_gnatl.o : b_gnatl.c
2039
2040 b_gnatm.c : $(GNATMAKE_OBJS)
2041         $(GNATBIND) $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
2042 b_gnatm.o : b_gnatm.c
2043
2044 # force debugging information on s-tasdeb.o so that it is always
2045 # possible to set conditional breakpoints on tasks.
2046
2047 s-tasdeb.o  : s-tasdeb.adb s-tasdeb.ads
2048         $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) $(ADA_INCLUDES) $<
2049
2050 # force debugging information on s-vaflop.o so that it is always
2051 # possible to call the VAX float debug print routines.
2052 # force at least -O so that the inline assembly works.
2053
2054 s-vaflop.o  : s-vaflop.adb s-vaflop.ads
2055         $(ADAC) -c -O $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
2056          $(ADA_INCLUDES) $<
2057
2058 # force debugging information on a-except.o so that it is always
2059 # possible to set conditional breakpoints on exceptions.
2060 # use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
2061
2062 a-except.o  : a-except.adb a-except.ads
2063         $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
2064          $(ADA_INCLUDES) $<
2065
2066 # force debugging information on s-assert.o so that it is always
2067 # possible to set breakpoint on assert failures.
2068
2069 s-assert.o  : s-assert.adb s-assert.ads a-except.ads
2070         $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 \
2071          $(ADA_INCLUDES) $<
2072
2073 mdll.o : mdll.adb mdll.ads mdll-file.ads mdll-utl.ads
2074         $(CC) -c $(ALL_ADAFLAGS) -O2 $(ADA_INCLUDES) $< 
2075
2076 mdll-fil.o : mdll-fil.adb mdll.ads mdll-fil.ads
2077         $(CC) -c $(ALL_ADAFLAGS) -O2 $(ADA_INCLUDES) $< 
2078
2079 mdll-utl.o : mdll-utl.adb mdll.ads mdll-utl.ads sdefault.ads types.ads
2080         $(CC) -c $(ALL_ADAFLAGS) -O2 $(ADA_INCLUDES) $< 
2081   
2082 # force debugging information and no optimization on s-memory.o so that it 
2083 # is always possible to set breakpoint on __gnat_malloc and __gnat_free
2084 # this is important for gnatmem using GDB. memtrack.o is built from
2085 # memtrack.adb, and used by the post-mortem analysis with gnatmem.
2086
2087 s-memory.o  : s-memory.adb s-memory.ads memtrack.o
2088         $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \
2089          $(ADA_INCLUDES) $< 
2090
2091 memtrack.o  : memtrack.adb s-memory.ads
2092         $(ADAC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 \
2093          $(ADA_INCLUDES) $< 
2094
2095 # Need to keep the frame pointer in this file to pop the stack properly on
2096 # some targets.
2097
2098 traceb.o : traceb.c
2099         $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
2100               $< 
2101
2102
2103 aux-io.o  : aux-io.c
2104 argv.o    : argv.c
2105 cal.o     : cal.c
2106 deftarg.o  : deftarg.c
2107 errno.o   : errno.c
2108 exit.o    : raise.h exit.c
2109 expect.o  : expect.c
2110 adafinal.o   : raise.h adafinal.c
2111 gmem.o    : gmem.c
2112 link.o    : link.c
2113 mkdir.o   : mkdir.c
2114 sysdep.o  : sysdep.c
2115
2116 cio.o     : cio.c 
2117         $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \
2118                  $(ALL_CPPFLAGS) $(INCLUDES) $< 
2119
2120 init.o    : init.c ada.h types.h raise.h
2121         $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \
2122                  $(ALL_CPPFLAGS) $(INCLUDES) $< 
2123
2124 raise.o   : raise.c raise.h
2125         $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \
2126                  $(ALL_CPPFLAGS) $(INCLUDES) $< 
2127
2128 # Need to keep the frame pointer in this file to pop the stack properly on
2129 # some targets.
2130 tracebak.o  : tracebak.c
2131         $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
2132               -fno-omit-frame-pointer $< 
2133
2134 targtyps.o : targtyps.c $(CONFIG_H) ada.h types.h atree.h nlists.h elists.h \
2135    uintp.h sinfo.h einfo.h namet.h snames.h stringt.h urealp.h fe.h \
2136    $(ADA_TREE_H) gigi.h
2137
2138 # Rule to compile prefix.o for the run-time.
2139
2140 prefix.o : $(srcdir)/../prefix.c
2141         $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(RT_FLAGS) \
2142               $(ALL_CPPFLAGS) $(INCLUDES) -I$(srcdir)/../.. -I../.. \
2143               -DPREFIX=\"$(prefix)\" $< 
2144
2145 # In GNU Make, ignore whether `stage*' exists.
2146 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
2147 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
2148
2149 force:
2150
2151 # Gnatlbr is only used on VMS
2152
2153 GNATLBR_RTL_C_OBJS = adaint.o argv.o cio.o cstreams.o exit.o adafinal.o init.o \
2154   raise.o sysdep.o tracebak.o
2155 GNATLBR_C_OBJS = $(GNATLBR_RTL_C_OBJS)
2156
2157 ../gnatlbr$(exeext):: sdefault.o $(GNATLBR_C_OBJS) $(EXTRA_GNATTOOLS_OBJS)
2158         $(RM) $@
2159 ../gnatlbr$(exeext):: force
2160         $(GNATMAKE) -a --GCC="$(CC)" $(ALL_ADAFLAGS) $(ADA_INCLUDES) \
2161           --GNATBIND="$(GNATBIND)" --GNATLINK="$(GNATLINK)" \
2162           -nostdlib $(fsrcpfx)gnatlbr -o $@ \
2163           -largs --GCC="$(CC) $(ALL_CFLAGS) $(LDFLAGS)" \
2164           $(GNATLBR_C_OBJS) $(EXTRA_GNATTOOLS_OBJS)
2165