]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/ada/gcc-interface/Makefile.in
d4c9d157d1cccbd4c3baf5e48e3bcd340990c49b
[thirdparty/gcc.git] / gcc / ada / gcc-interface / Makefile.in
1 # Makefile for GNU Ada Compiler (GNAT).
2 # Copyright (C) 1994-2018 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 #<http://www.gnu.org/licenses/>.
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 FORCE_DEBUG_ADAFLAGS = -g
109 NO_INLINE_ADAFLAGS = -fno-inline
110 NO_OMIT_ADAFLAGS = -fno-omit-frame-pointer
111 NO_SIBLING_ADAFLAGS = -fno-optimize-sibling-calls
112 NO_REORDER_ADAFLAGS = -fno-toplevel-reorder
113 GNATLIBFLAGS = -W -Wall -gnatpg -nostdinc
114 GNATLIBCFLAGS = -g -O2
115 # Pretend that _Unwind_GetIPInfo is available for the target by default. This
116 # should be autodetected during the configuration of libada and passed down to
117 # here, but we need something for --disable-libada and hope for the best.
118 GNATLIBCFLAGS_FOR_C = \
119 -W -Wall $(GNATLIBCFLAGS) -fexceptions -DIN_RTS -DHAVE_GETIPINFO
120 PICFLAG_FOR_TARGET = @PICFLAG_FOR_TARGET@
121 ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
122 THREAD_KIND = native
123 THREADSLIB =
124 GMEM_LIB =
125 MISCLIB =
126 OUTPUT_OPTION = -o $@
127
128 objext = .o
129 exeext =
130 arext = .a
131 soext = .so
132 shext =
133 hyphen = -
134
135 # program_transform_name and objdir are set by configure.ac.
136 program_transform_name =
137 objdir = .
138
139 target_alias=@target_alias@
140 target=@target@
141 target_cpu=@target_cpu@
142 target_vendor=@target_vendor@
143 target_os=@target_os@
144 host_cpu=@host_cpu@
145 host_vendor=@host_vendor@
146 host_os=@host_os@
147 target_cpu_default = @target_cpu_default@
148 xmake_file = @xmake_file@
149 tmake_file = @tmake_file@
150 #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
151 #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
152
153 # Directory where sources are, from where we are.
154 VPATH = $(srcdir)/ada
155
156 # Full path to top source directory
157 # In particular this is used to access libgcc headers, so that references to
158 # these headers from GNAT runtime objects have path names in debugging info
159 # that are consistent with libgcc objects. Also used for other references to
160 # the top source directory for consistency.
161 ftop_srcdir := $(shell cd $(srcdir)/..;${PWD_COMMAND})
162
163 fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
164 fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
165 fcurdir := $(shell ${PWD_COMMAND})
166 fcurpfx := $(shell ${PWD_COMMAND})/
167
168 # Top build directory, relative to here.
169 top_builddir = ../..
170
171 # Internationalization library.
172 LIBINTL = @LIBINTL@
173 LIBINTL_DEP = @LIBINTL_DEP@
174
175 # Character encoding conversion library.
176 LIBICONV = @LIBICONV@
177 LIBICONV_DEP = @LIBICONV_DEP@
178
179 # Any system libraries needed just for GNAT.
180 SYSLIBS = @GNAT_LIBEXC@
181
182 # List extra gnattools
183 EXTRA_GNATTOOLS =
184
185 # List of target dependent sources, overridden below as necessary
186 TARGET_ADA_SRCS =
187
188 # Type of tools build we are doing; default is not compiling tools.
189 TOOLSCASE =
190
191 # main GNAT source directory
192 GNAT_SRC=$(fsrcpfx)ada
193
194 # Multilib handling
195 MULTISUBDIR =
196 RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
197
198 # Link flags used to build gnat tools. By default we prefer to statically
199 # link with libgcc to avoid a dependency on shared libgcc (which is tricky
200 # to deal with as it may conflict with the libgcc provided by the system).
201 GCC_LINK_FLAGS=-static-libstdc++ -static-libgcc
202
203 # End of variables for you to override.
204
205 all: all.indirect
206
207 # This tells GNU Make version 3 not to put all variables in the environment.
208 .NOEXPORT:
209
210 # target overrides
211 ifneq ($(tmake_file),)
212 include $(tmake_file)
213 endif
214
215 # host overrides
216 ifneq ($(xmake_file),)
217 include $(xmake_file)
218 endif
219 \f
220 # Now figure out from those variables how to compile and link.
221
222 all.indirect: Makefile ../gnat1$(exeext)
223
224 # IN_GCC is meant to distinguish between code compiled into GCC itself, i.e.
225 # for the host, and the rest. But we also use it for the tools (link.c) and
226 # even break the host/target wall by using it for the library (targext.c).
227 # autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
228 # compiler which does not use the native libraries and headers.
229 INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
230
231 # This is the variable actually used when we compile.
232 ALL_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS)
233
234 # Likewise.
235 ALL_CPPFLAGS = $(CPPFLAGS)
236
237 # Used with $(COMPILER).
238 ALL_COMPILERFLAGS = $(ALL_CFLAGS)
239
240 # This is where we get libiberty.a from.
241 LIBIBERTY = ../../libiberty/libiberty.a
242
243 # We need to link against libbacktrace because diagnostic.c in
244 # libcommon.a uses it.
245 LIBBACKTRACE = ../../libbacktrace/.libs/libbacktrace.a
246
247 # How to link with both our special library facilities
248 # and the system's installed libraries.
249 LIBS = $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) $(LIBIBERTY) $(SYSLIBS)
250 LIBDEPS = $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBBACKTRACE) $(LIBIBERTY)
251 # Default is no TGT_LIB; one might be passed down or something
252 TGT_LIB =
253 TOOLS_LIBS = ../link.o ../targext.o ../../ggc-none.o ../../libcommon-target.a \
254 ../../libcommon.a ../../../libcpp/libcpp.a $(LIBGNAT) $(LIBINTL) $(LIBICONV) \
255 ../$(LIBBACKTRACE) ../$(LIBIBERTY) $(SYSLIBS) $(TGT_LIB)
256
257 # Add -no-pie to TOOLS_LIBS since some of them are compiled with -fno-PIE.
258 TOOLS_LIBS += @NO_PIE_FLAG@
259
260 # Specify the directories to be searched for header files.
261 # Both . and srcdir are used, in that order,
262 # so that tm.h and config.h will be found in the compilation
263 # subdirectory rather than in the source directory.
264 INCLUDES = -iquote . -iquote .. -iquote $(srcdir)/ada -iquote $(srcdir) \
265 -I $(ftop_srcdir)/include $(GMPINC)
266
267 ADA_INCLUDES = -I- -I. -I$(srcdir)/ada
268
269 # Likewise, but valid for subdirectories of the current dir.
270 # FIXME: for VxWorks, we cannot add $(fsrcdir) because the regs.h file in
271 # that directory conflicts with a system header file.
272 ifneq ($(findstring vxworks,$(target_os)),)
273 INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
274 -iquote $(fsrcdir)/ada \
275 -I$(ftop_srcdir)/include $(GMPINC)
276 else
277 INCLUDES_FOR_SUBDIR = -iquote . -iquote .. -iquote ../.. \
278 -iquote $(fsrcdir)/ada -iquote $(fsrcdir) \
279 -I$(ftop_srcdir)/include $(GMPINC)
280 endif
281
282 ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)/ada
283
284 # Avoid a lot of time thinking about remaking Makefile.in and *.def.
285 .SUFFIXES: .in .def
286
287 # Say how to compile Ada programs.
288 .SUFFIXES: .ada .adb .ads .asm
289
290 # Always use -I$(srcdir)/config when compiling.
291 .asm.o:
292 $(CC) -c -x assembler $< $(OUTPUT_OPTION)
293
294 .c.o:
295 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
296 $(INCLUDES) $< $(OUTPUT_OPTION)
297
298 .adb.o:
299 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
300
301 .ads.o:
302 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
303
304 # how to regenerate this file
305 Makefile: ../config.status $(srcdir)/ada/gcc-interface/Makefile.in $(srcdir)/ada/Makefile.in $(srcdir)/version.c
306 cd ..; \
307 LANGUAGES="$(CONFIG_LANGUAGES)" \
308 CONFIG_HEADERS= \
309 CONFIG_FILES="ada/gcc-interface/Makefile ada/Makefile" $(SHELL) config.status
310
311 # This tells GNU make version 3 not to export all the variables
312 # defined in this file into the environment.
313 .NOEXPORT:
314 \f
315 # Lists of files for various purposes.
316
317 GNATLINK_OBJS = gnatlink.o \
318 a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o \
319 gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o \
320 osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
321 sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
322 types.o validsw.o widechar.o
323
324 GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \
325 atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o errout.o \
326 erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
327 gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
328 make.o makeusg.o make_util.o namet.o nlists.o opt.o osint.o osint-m.o \
329 output.o restrict.o rident.o s-exctab.o \
330 s-secsta.o s-stalib.o s-stoele.o scans.o scng.o sdefault.o sfn_scan.o \
331 s-purexc.o s-htable.o scil_ll.o sem_aux.o sinfo.o sinput.o sinput-c.o \
332 snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o \
333 switch.o switch-m.o table.o targparm.o tempdir.o tree_io.o types.o uintp.o \
334 uname.o urealp.o usage.o widechar.o \
335 $(EXTRA_GNATMAKE_OBJS)
336
337 # Make arch match the current multilib so that the RTS selection code
338 # picks up the right files. For a given target this must be coherent
339 # with MULTILIB_DIRNAMES defined in gcc/config/target/t-*.
340
341 ifeq ($(strip $(filter-out %x86_64, $(target_cpu))),)
342 ifeq ($(strip $(MULTISUBDIR)),/32)
343 target_cpu:=i686
344 else
345 ifeq ($(strip $(MULTISUBDIR)),/x32)
346 target_cpu:=x32
347 endif
348 endif
349 endif
350
351 # Configuration of host tools
352
353 # Under linux, host tools need to be linked with -ldl
354
355 ifeq ($(strip $(filter-out linux%,$(host_os))),)
356 TOOLS1_LIBS=-ldl
357 endif
358
359 include $(fsrcdir)/ada/Makefile.rtl
360
361 LIBGNAT=../$(RTSDIR)/libgnat.a
362
363 TOOLS_FLAGS_TO_PASS= \
364 "CC=$(CC)" \
365 "CFLAGS=$(CFLAGS)" \
366 "LDFLAGS=$(LDFLAGS)" \
367 "ADAFLAGS=$(ADAFLAGS)" \
368 "INCLUDES=$(INCLUDES_FOR_SUBDIR)"\
369 "ADA_INCLUDES=$(ADA_INCLUDES) $(ADA_INCLUDES_FOR_SUBDIR)"\
370 "libsubdir=$(libsubdir)" \
371 "exeext=$(exeext)" \
372 "fsrcdir=$(fsrcdir)" \
373 "srcdir=$(fsrcdir)" \
374 "TOOLS_LIBS=$(TOOLS_LIBS) $(TGT_LIB)" \
375 "GNATMAKE=$(GNATMAKE)" \
376 "GNATLINK=$(GNATLINK)" \
377 "GNATBIND=$(GNATBIND)"
378
379 GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(LDFLAGS)
380
381 # Build directory for the tools. Let's copy the target-dependent
382 # sources using the same mechanism as for gnatlib. The other sources are
383 # accessed using the vpath directive below
384
385 ../stamp-tools:
386 -$(RM) tools/*
387 -$(RMDIR) tools
388 -$(MKDIR) tools
389 -(cd tools; $(LN_S) ../sdefault.adb ../snames.ads ../snames.adb .)
390 -$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
391 $(RM) tools/$(word 1,$(subst <, ,$(PAIR)));\
392 $(LN_S) $(fsrcpfx)ada/$(word 2,$(subst <, ,$(PAIR))) \
393 tools/$(word 1,$(subst <, ,$(PAIR)));)
394 touch ../stamp-tools
395
396 # when compiling the tools, the runtime has to be first on the path so that
397 # it hides the runtime files lying with the rest of the sources
398 ifeq ($(TOOLSCASE),native)
399 vpath %.ads ../$(RTSDIR) ../
400 vpath %.adb ../$(RTSDIR) ../
401 vpath %.c ../$(RTSDIR) ../
402 vpath %.h ../$(RTSDIR) ../
403 endif
404
405 # in the cross tools case, everything is compiled with the native
406 # gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
407 ifeq ($(TOOLSCASE),cross)
408 vpath %.ads ../
409 vpath %.adb ../
410 vpath %.c ../
411 vpath %.h ../
412 endif
413
414 # gnatmake/link tools cannot always be built with gnatmake/link for bootstrap
415 # reasons: gnatmake should be built with a recent compiler, a recent compiler
416 # may not generate ALI files compatible with an old gnatmake so it is important
417 # to be able to build gnatmake without a version of gnatmake around. Once
418 # everything has been compiled once, gnatmake can be recompiled with itself
419 # (see target gnattools1-re)
420 gnattools1: ../stamp-tools ../stamp-gnatlib-$(RTSDIR)
421 $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
422 TOOLSCASE=native \
423 ../../gnatmake$(exeext) ../../gnatlink$(exeext)
424
425 # gnatmake/link can be built with recent gnatmake/link if they are available.
426 # This is especially convenient for building cross tools or for rebuilding
427 # the tools when the original bootstrap has already be done.
428 gnattools1-re: ../stamp-tools
429 $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
430 TOOLSCASE=cross INCLUDES="" gnatmake-re gnatlink-re
431
432 # these tools are built with gnatmake & are common to native and cross
433 gnattools2: ../stamp-tools
434 $(MAKE) -C tools -f ../Makefile $(TOOLS_FLAGS_TO_PASS) \
435 TOOLSCASE=native common-tools $(EXTRA_GNATTOOLS)
436
437 common-tools: ../stamp-tools
438 $(GNATMAKE) -j0 -c -b $(ADA_INCLUDES) \
439 --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
440 gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
441 gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
442 $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
443 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
444 $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
445 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
446 $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
447 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
448 $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
449 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
450 $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
451 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
452 $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
453 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
454 $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
455 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
456 $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
457 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
458 $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
459 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
460
461 ../../gnatdll$(exeext): ../stamp-tools
462 $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
463 $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
464 $(GNATLINK) -v gnatdll -o $@ \
465 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
466
467 gnatmake-re: ../stamp-tools
468 $(GNATMAKE) -j0 $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
469 $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
470 $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
471 $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
472 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
473
474 # Note the use of the "mv" command in order to allow gnatlink to be linked with
475 # with the former version of gnatlink itself which cannot override itself.
476 # gnatlink-re cannot be run at the same time as gnatmake-re, hence the
477 # dependency
478 gnatlink-re: ../stamp-tools gnatmake-re
479 $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
480 $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
481 $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
482 --GCC="$(CC) $(ADA_INCLUDES)" --LINK="$(GCC_LINK)" $(TOOLS_LIBS)
483 $(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
484
485 # Needs to be built with CC=gcc
486 # Since the RTL should be built with the latest compiler, remove the
487 # stamp target in the parent directory whenever gnat1 is rebuilt
488
489 # Likewise for the tools
490 ../../gnatmake$(exeext): b_gnatm.o $(GNATMAKE_OBJS)
491 +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) $(TOOLS_LIBS) $(TOOLS1_LIBS)
492
493 ../../gnatlink$(exeext): b_gnatl.o $(GNATLINK_OBJS)
494 +$(GCC_LINK) $(ALL_CFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) $(TOOLS_LIBS) $(TOOLS1_LIBS)
495
496 ../stamp-gnatlib-$(RTSDIR):
497 @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
498 then \
499 $(ECHO) You must first build the GNAT library: make gnatlib; \
500 false; \
501 else \
502 true; \
503 fi
504
505 install-gcc-specs:
506 # Install all the requested GCC spec files.
507
508 $(foreach f,$(GCC_SPEC_FILES), \
509 $(INSTALL_DATA_DATE) $(srcdir)/ada/$(f) $(DESTDIR)$(libsubdir)/;)
510
511 install-gnatlib: ../stamp-gnatlib-$(RTSDIR) install-gcc-specs
512 $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
513 $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
514 -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
515 -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
516 for file in $(RTSDIR)/*.ali; do \
517 $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
518 done
519 $(INSTALL_DATA_DATE) $(RTSDIR)/ada_target_properties \
520 $(DESTDIR)$(ADA_RTL_OBJ_DIR)/../
521 -cd $(RTSDIR); for file in *$(arext);do \
522 $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
523 $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
524 done
525 -$(foreach file, $(EXTRA_ADALIB_OBJS), \
526 $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
527 ) true
528 # Install the shared libraries, if any, using $(INSTALL) instead
529 # of $(INSTALL_DATA). The latter may force a mode inappropriate
530 # for shared libraries on some targets, e.g. on HP-UX where the x
531 # permission is required.
532 # Also install the .dSYM directories if they exist (these directories
533 # contain the debug information for the shared libraries on darwin)
534 for file in gnat gnarl; do \
535 if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
536 $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
537 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
538 fi; \
539 if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
540 $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
541 $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
542 fi; \
543 if [ -d $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM ]; then \
544 $(CP) -r $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext).dSYM \
545 $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
546 fi; \
547 done
548 # This copy must be done preserving the date on the original file.
549 for file in $(RTSDIR)/*.ad[sb]*; do \
550 $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
551 done
552 cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
553 cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
554
555 ../stamp-gnatlib2-$(RTSDIR):
556 $(RM) $(RTSDIR)/s-*.ali
557 $(RM) $(RTSDIR)/s-*$(objext)
558 $(RM) $(RTSDIR)/a-*.ali
559 $(RM) $(RTSDIR)/a-*$(objext)
560 $(RM) $(RTSDIR)/*.ali
561 $(RM) $(RTSDIR)/*$(objext)
562 $(RM) $(RTSDIR)/*$(arext)
563 $(RM) $(RTSDIR)/*$(soext)
564 touch ../stamp-gnatlib2-$(RTSDIR)
565 $(RM) ../stamp-gnatlib-$(RTSDIR)
566
567 ../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
568 $(MAKE) MULTISUBDIR="$(MULTISUBDIR)" THREAD_KIND="$(THREAD_KIND)" LN_S="$(LN_S)" setup-rts
569 # Copy tsystem.h
570 $(CP) $(srcdir)/tsystem.h $(RTSDIR)
571 $(RM) ../stamp-gnatlib-$(RTSDIR)
572 touch ../stamp-gnatlib1-$(RTSDIR)
573
574 # GCC_FOR_TARGET has paths relative to the gcc directory, so we need to adjust
575 # for running it from ada/rts
576
577 OSCONS_CC=$(subst ./xgcc,../../xgcc,$(subst -B./, -B../../,$(GCC_FOR_TARGET)))
578
579 # The main ada source directory must be on the include path for #include "..."
580 # because s-oscons-tmplt.c requires adaint.h, gsocket.h, and any file included
581 # by these headers. However note that we must use -iquote, not -I, so that
582 # ada/types.h does not conflict with a same-named system header (VxWorks
583 # has a <types.h> header).
584
585 OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -E -C \
586 -DTARGET=\"$(target)\" -iquote $(fsrcpfx)ada $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i
587 OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -S s-oscons-tmplt.i
588
589 # Note: if you need to build with a non-GNU compiler, you could adapt the
590 # following definitions (written for VMS DEC-C)
591 #OSCONS_CPP=../../../$(DECC) -E /comment=as_is -DNATIVE \
592 # -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c
593 #
594 #OSCONS_EXTRACT=../../../$(DECC) -DNATIVE \
595 # -DTARGET='""$(target)""' -I$(OSCONS_SRCDIR) s-oscons-tmplt.c ; \
596 # ld -o s-oscons-tmplt.exe s-oscons-tmplt.obj; \
597 # ./s-oscons-tmplt.exe > s-oscons-tmplt.s
598
599 ./bldtools/oscons/xoscons: xoscons.adb xutil.ads xutil.adb
600 -$(MKDIR) ./bldtools/oscons
601 $(RM) $(addprefix ./bldtools/oscons/,$(notdir $^))
602 $(CP) $^ ./bldtools/oscons
603 (cd ./bldtools/oscons ; gnatmake -q xoscons)
604
605 $(RTSDIR)/s-oscons.ads: ../stamp-gnatlib1-$(RTSDIR) s-oscons-tmplt.c gsocket.h ./bldtools/oscons/xoscons
606 $(RM) $(RTSDIR)/s-oscons-tmplt.i $(RTSDIR)/s-oscons-tmplt.s
607 (cd $(RTSDIR) ; \
608 $(OSCONS_CPP) ; \
609 $(OSCONS_EXTRACT) ; \
610 ../bldtools/oscons/xoscons s-oscons)
611
612 gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) $(RTSDIR)/s-oscons.ads
613 test -f $(RTSDIR)/s-oscons.ads || exit 1
614 # C files
615 $(MAKE) -C $(RTSDIR) \
616 CC="`echo \"$(GCC_FOR_TARGET)\" \
617 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
618 INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
619 CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
620 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
621 srcdir=$(fsrcdir) \
622 -f ../Makefile $(LIBGNAT_OBJS) $(EXTRA_ADALIB_OBJS)
623 # Ada files
624 $(MAKE) -C $(RTSDIR) \
625 CC="`echo \"$(GCC_FOR_TARGET)\" \
626 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
627 ADA_INCLUDES="" \
628 CFLAGS="$(GNATLIBCFLAGS)" \
629 ADAFLAGS="$(GNATLIBFLAGS)" \
630 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
631 srcdir=$(fsrcdir) \
632 -f ../Makefile $(GNATRTL_OBJS)
633 $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
634 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
635 $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
636 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
637 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
638 $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
639 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
640 ifeq ($(GMEM_LIB),gmemlib)
641 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
642 $(RTSDIR)/memtrack.o
643 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
644 endif
645 $(CHMOD) a-wx $(RTSDIR)/*.ali
646 touch ../stamp-gnatlib-$(RTSDIR)
647
648 # Warning: this target assumes that LIBRARY_VERSION has been set correctly.
649 gnatlib-shared-default:
650 $(MAKE) $(FLAGS_TO_PASS) \
651 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
652 GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
653 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \
654 MULTISUBDIR="$(MULTISUBDIR)" \
655 THREAD_KIND="$(THREAD_KIND)" \
656 LN_S="$(LN_S)" \
657 gnatlib
658 $(RM) $(RTSDIR)/libgna*$(soext)
659 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
660 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
661 $(PICFLAG_FOR_TARGET) \
662 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
663 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
664 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
665 $(MISCLIB) -lm
666 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
667 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared $(GNATLIBCFLAGS) \
668 $(PICFLAG_FOR_TARGET) \
669 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
670 $(GNATRTL_TASKING_OBJS) \
671 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
672 $(THREADSLIB)
673 cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
674 libgnat$(soext)
675 cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
676 libgnarl$(soext)
677
678 # Create static libgnat and libgnarl compiled with -fPIC
679 $(RM) $(RTSDIR)/libgnat_pic$(arext) $(RTSDIR)/libgnarl_pic$(arext)
680 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat_pic$(arext) \
681 $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
682 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat_pic$(arext)
683 $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl_pic$(arext) \
684 $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
685 $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl_pic$(arext)
686
687 gnatlib-shared-dual:
688 $(MAKE) $(FLAGS_TO_PASS) \
689 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
690 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
691 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
692 PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" \
693 MULTISUBDIR="$(MULTISUBDIR)" \
694 THREAD_KIND="$(THREAD_KIND)" \
695 LN_S="$(LN_S)" \
696 gnatlib-shared-default
697 $(MV) $(RTSDIR)/libgna*$(soext) .
698 $(MV) $(RTSDIR)/libgnat_pic$(arext) .
699 $(MV) $(RTSDIR)/libgnarl_pic$(arext) .
700 $(RM) ../stamp-gnatlib2-$(RTSDIR)
701 $(MAKE) $(FLAGS_TO_PASS) \
702 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
703 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
704 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
705 MULTISUBDIR="$(MULTISUBDIR)" \
706 THREAD_KIND="$(THREAD_KIND)" \
707 LN_S="$(LN_S)" \
708 gnatlib
709 $(MV) libgna*$(soext) $(RTSDIR)
710 $(MV) libgnat_pic$(arext) $(RTSDIR)
711 $(MV) libgnarl_pic$(arext) $(RTSDIR)
712
713 gnatlib-shared-dual-win32:
714 $(MAKE) $(FLAGS_TO_PASS) \
715 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
716 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
717 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
718 PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" \
719 MULTISUBDIR="$(MULTISUBDIR)" \
720 THREAD_KIND="$(THREAD_KIND)" \
721 LN_S="$(LN_S)" \
722 gnatlib-shared-win32
723 $(MV) $(RTSDIR)/libgna*$(soext) .
724 $(RM) ../stamp-gnatlib2-$(RTSDIR)
725 $(MAKE) $(FLAGS_TO_PASS) \
726 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
727 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
728 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
729 MULTISUBDIR="$(MULTISUBDIR)" \
730 THREAD_KIND="$(THREAD_KIND)" \
731 LN_S="$(LN_S)" \
732 gnatlib
733 $(MV) libgna*$(soext) $(RTSDIR)
734
735 # ??? we need to add the option to support auto-import of arrays/records to
736 # the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
737 # use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
738 # Windows.
739 gnatlib-shared-win32:
740 $(MAKE) $(FLAGS_TO_PASS) \
741 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
742 GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
743 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET)" \
744 MULTISUBDIR="$(MULTISUBDIR)" \
745 THREAD_KIND="$(THREAD_KIND)" \
746 LN_S="$(LN_S)" \
747 gnatlib
748 $(RM) $(RTSDIR)/libgna*$(soext)
749 $(CP) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnat_pic$(arext)
750 $(CP) $(RTSDIR)/libgnarl$(arext) $(RTSDIR)/libgnarl_pic$(arext)
751 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
752 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
753 $(PICFLAG_FOR_TARGET) \
754 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
755 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
756 $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
757 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
758 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -shared -shared-libgcc \
759 $(PICFLAG_FOR_TARGET) \
760 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
761 $(GNATRTL_TASKING_OBJS) \
762 $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
763 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
764
765 gnatlib-shared-darwin:
766 $(MAKE) $(FLAGS_TO_PASS) \
767 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
768 GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(PICFLAG_FOR_TARGET)" \
769 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C) $(PICFLAG_FOR_TARGET) -fno-common" \
770 MULTISUBDIR="$(MULTISUBDIR)" \
771 THREAD_KIND="$(THREAD_KIND)" \
772 LN_S="$(LN_S)" \
773 gnatlib
774 $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
775 $(CP) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnat_pic$(arext)
776 $(CP) $(RTSDIR)/libgnarl$(arext) $(RTSDIR)/libgnarl_pic$(arext)
777 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
778 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
779 -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
780 $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
781 $(SO_OPTS) \
782 -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
783 $(MISCLIB)
784 cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \
785 | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \
786 -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
787 $(GNATRTL_TASKING_OBJS) \
788 $(SO_OPTS) \
789 -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
790 $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
791 cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
792 libgnat$(soext)
793 cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
794 libgnarl$(soext)
795 cd $(RTSDIR); dsymutil libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
796 cd $(RTSDIR); dsymutil libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext)
797
798 gnatlib-shared:
799 $(MAKE) $(FLAGS_TO_PASS) \
800 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
801 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
802 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
803 MULTISUBDIR="$(MULTISUBDIR)" \
804 THREAD_KIND="$(THREAD_KIND)" \
805 LN_S="$(LN_S)" \
806 PICFLAG_FOR_TARGET="$(PICFLAG_FOR_TARGET)" \
807 $(GNATLIB_SHARED)
808
809 # When building a SJLJ runtime for VxWorks, we need to ensure that the extra
810 # linker options needed for ZCX are not passed to prevent the inclusion of
811 # useless objects and potential troubles from the presence of extra symbols
812 # and references in some configurations. The inhibition is performed by
813 # commenting the pragma instead of deleting the line, as the latter might
814 # result in getting multiple blank lines, hence possible style check errors.
815 gnatlib-sjlj:
816 $(MAKE) $(FLAGS_TO_PASS) \
817 EH_MECHANISM="" \
818 MULTISUBDIR="$(MULTISUBDIR)" \
819 THREAD_KIND="$(THREAD_KIND)" \
820 LN_S="$(LN_S)" \
821 ../stamp-gnatlib1-$(RTSDIR)
822 sed \
823 -e 's/Frontend_Exceptions.*/Frontend_Exceptions : constant Boolean := True;/' \
824 -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' \
825 $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
826 $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
827 $(MAKE) $(FLAGS_TO_PASS) \
828 EH_MECHANISM="" \
829 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
830 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
831 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
832 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
833 MULTISUBDIR="$(MULTISUBDIR)" \
834 THREAD_KIND="$(THREAD_KIND)" \
835 LN_S="$(LN_S)" \
836 gnatlib
837
838 gnatlib-zcx:
839 $(MAKE) $(FLAGS_TO_PASS) \
840 EH_MECHANISM="-gcc" \
841 MULTISUBDIR="$(MULTISUBDIR)" \
842 THREAD_KIND="$(THREAD_KIND)" \
843 LN_S="$(LN_S)" \
844 ../stamp-gnatlib1-$(RTSDIR)
845 sed \
846 -e 's/Frontend_Exceptions.*/Frontend_Exceptions : constant Boolean := False;/' \
847 -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' \
848 $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
849 $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
850 $(MAKE) $(FLAGS_TO_PASS) \
851 EH_MECHANISM="-gcc" \
852 GNATLIBFLAGS="$(GNATLIBFLAGS)" \
853 GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
854 GNATLIBCFLAGS_FOR_C="$(GNATLIBCFLAGS_FOR_C)" \
855 FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
856 MULTISUBDIR="$(MULTISUBDIR)" \
857 THREAD_KIND="$(THREAD_KIND)" \
858 LN_S="$(LN_S)" \
859 gnatlib
860
861 # Compiling object files from source files.
862
863 # Note that dependencies on obstack.h are not written
864 # because that file is not part of GCC.
865 # Dependencies on gvarargs.h are not written
866 # because all that file does, when not compiling with GCC,
867 # is include the system varargs.h.
868
869 b_gnatl.adb : $(GNATLINK_OBJS)
870 $(GNATBIND) $(ADA_INCLUDES) -o b_gnatl.adb gnatlink.ali
871
872 b_gnatl.o : b_gnatl.adb
873 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) -gnatws -gnatyN \
874 $< $(OUTPUT_OPTION)
875
876 b_gnatm.adb : $(GNATMAKE_OBJS)
877 $(GNATBIND) $(ADA_INCLUDES) -o b_gnatm.adb gnatmake.ali
878
879 b_gnatm.o : b_gnatm.adb
880 $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) -gnatws -gnatyN \
881 $< $(OUTPUT_OPTION)
882
883 ADA_INCLUDE_DIR = $(libsubdir)/adainclude
884 ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
885
886 # Special flags
887
888 # need to keep the frame pointer in tracebak.o to pop the stack properly on
889 # some targets.
890
891 tracebak.o : tracebak.c tb-gcc.c
892 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) \
893 $(INCLUDES) $(NO_OMIT_ADAFLAGS) $< $(OUTPUT_OPTION)
894
895 adadecode.o : adadecode.c adadecode.h
896 aux-io.o : aux-io.c
897 argv.o : argv.c
898 cal.o : cal.c
899 deftarg.o : deftarg.c
900 errno.o : errno.c
901 exit.o : adaint.h exit.c
902 expect.o : expect.c
903 final.o : final.c
904 rtfinal.o : rtfinal.c
905 rtinit.o : rtinit.c
906 locales.o : locales.c
907 mkdir.o : mkdir.c
908 socket.o : socket.c gsocket.h
909 sysdep.o : sysdep.c
910 raise.o : raise.c raise.h
911 sigtramp-armdroid.o : sigtramp-armdroid.c sigtramp.h
912 sigtramp-armvxworks.o : sigtramp-armvxworks.c sigtramp.h
913 sigtramp-ios.o : sigtramp-ios.c sigtramp.h
914 sigtramp-vxworks.o : sigtramp-vxworks.c $(VX_SIGTRAMP_EXTRA_SRCS)
915 sigtramp-vxworks-vxsim.o : sigtramp-vxworks-vxsim.c $(VX_SIGTRAMP_EXTRA_SRCS)
916 terminals.o : terminals.c
917 vx_stack_info.o : vx_stack_info.c
918
919 raise-gcc.o : raise-gcc.c raise.h
920 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
921 -iquote $(srcdir) -iquote $(ftop_srcdir)/libgcc \
922 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
923
924 cio.o : cio.c
925 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
926 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
927
928 init.o : init.c adaint.h raise.h
929 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
930 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
931
932 init-vxsim.o : init-vxsim.c
933 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
934 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
935
936 initialize.o : initialize.c raise.h
937 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
938 $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
939
940 link.o : link.c
941 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
942 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
943 $< $(OUTPUT_OPTION)
944
945 targext.o : targext.c
946 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
947 -iquote $(srcdir) \
948 $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
949 $< $(OUTPUT_OPTION)
950
951 # In GNU Make, ignore whether `stage*' exists.
952 .PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
953 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
954
955 force: