OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / libgcc / Makefile.in
1 # Makefile.in
2
3 # Copyright (C) 2005, 2006, 2009, 2010, 2011 Free Software Foundation
4 #
5 # This file is part of GCC.
6 #
7 # GCC is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU Library General Public License as published by the Free
9 # Software Foundation; either version 3 of the License, or (at your option)
10 # any later version.
11 #
12 # GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15 # more details.
16 #
17 # You should have received a copy of the GNU General Public License along
18 # with GCC; see the file COPYING3.  If not see
19 # <http://www.gnu.org/licenses/>.
20 #
21
22 libgcc_topdir = @libgcc_topdir@
23 host_subdir = @host_subdir@
24
25 gcc_srcdir = $(libgcc_topdir)/gcc
26 gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc
27
28 srcdir = @srcdir@
29
30 prefix = @prefix@
31
32 exec_prefix = @exec_prefix@
33 libdir = @libdir@
34 shlib_slibdir = @slibdir@
35
36 SHELL = @SHELL@
37
38 cpu_type = @cpu_type@
39 enable_shared = @enable_shared@
40 decimal_float = @decimal_float@
41 enable_decimal_float = @enable_decimal_float@
42 fixed_point = @fixed_point@
43
44 host_noncanonical = @host_noncanonical@
45 target_noncanonical = @target_noncanonical@
46
47 # List of extra object files that should be compiled for this target machine.
48 # The rules for compiling them should be in the t-* file for the machine.
49 EXTRA_PARTS = @extra_parts@
50
51 # Multilib support variables.
52 MULTISRCTOP =
53 MULTIBUILDTOP =
54 MULTIDIRS =
55 MULTISUBDIR =
56 MULTIDO = true
57 MULTICLEAN = true
58
59 INSTALL = @INSTALL@
60 INSTALL_PROGRAM = @INSTALL_PROGRAM@
61 INSTALL_DATA = @INSTALL_DATA@
62 mkinstalldirs = $(SHELL) $(libgcc_topdir)/mkinstalldirs
63
64 objext = .o
65
66 AR = @AR@
67 AR_FLAGS = rc
68
69 CC = @CC@
70 CFLAGS = @CFLAGS@
71 RANLIB = @RANLIB@
72 LN_S = @LN_S@
73
74 PWD_COMMAND = $${PWDCMD-pwd}
75
76 # Flags to pass to a recursive make.
77 FLAGS_TO_PASS = \
78         "AR=$(AR)" \
79         "AR_FLAGS=$(AR_FLAGS)" \
80         "CC=$(CC)" \
81         "CFLAGS=$(CFLAGS)" \
82         "DESTDIR=$(DESTDIR)" \
83         "EXTRA_OFILES=$(EXTRA_OFILES)" \
84         "HDEFINES=$(HDEFINES)" \
85         "INSTALL=$(INSTALL)" \
86         "INSTALL_DATA=$(INSTALL_DATA)" \
87         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
88         "LDFLAGS=$(LDFLAGS)" \
89         "LOADLIBES=$(LOADLIBES)" \
90         "RANLIB=$(RANLIB)" \
91         "SHELL=$(SHELL)" \
92         "prefix=$(prefix)" \
93         "exec_prefix=$(exec_prefix)" \
94         "libdir=$(libdir)" \
95         "libsubdir=$(libsubdir)" \
96         "tooldir=$(tooldir)"
97
98 # Dependencies for "all" are set later in the file.
99 all: all-multi
100         # Now that we have built all the objects, we need to copy
101         # them back to the GCC directory.  Too many things (other
102         # in-tree libraries, and DejaGNU) know about the layout
103         # of the build tree, for now.
104         $(MAKE) install-leaf DESTDIR=$(gcc_objdir) \
105           slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR)
106
107 .PHONY: all-multi
108 all-multi:
109         # If this is the top-level multilib, build all the other
110         # multilibs.
111         @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
112
113 .PHONY: check installcheck
114 check:
115 installcheck:
116
117 .PHONY: all clean
118
119 clean:
120         -rm -f config.h stamp-h stmp-ldirs libgcc.map
121         -rm -f *$(objext)
122         -rm -f *.dep
123         -rm -f *.a
124         -rm -f libunwind$(SHLIB_EXT)
125         -rm -f libgcc_s*
126         @$(MULTICLEAN) multi-clean DO=clean
127 distclean: clean
128         @$(MULTICLEAN) multi-clean DO=distclean
129         -rm -f *~ Makefile config.cache config.status multilib.out
130         -rm -f config.log
131 maintainer-clean realclean: distclean
132
133 Makefile: $(srcdir)/Makefile.in config.status
134         CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
135
136 # Depending on Makefile makes sure that config.status has been re-run
137 # if needed.  This prevents problems with parallel builds.
138 config.h: stamp-h ; @true
139 stamp-h: $(srcdir)/config.in config.status Makefile
140         CONFIG_FILES= CONFIG_HEADERS=config.h:$(srcdir)/config.in $(SHELL) ./config.status
141
142 config.status: $(srcdir)/configure $(srcdir)/config.host
143         $(SHELL) ./config.status --recheck
144
145 AUTOCONF = autoconf
146 configure_deps = \
147         $(srcdir)/../config/enable.m4 \
148         $(srcdir)/../config/tls.m4 \
149         $(srcdir)/../config/acx.m4 \
150         $(srcdir)/../config/no-executables.m4 \
151         $(srcdir)/../config/override.m4 \
152         $(srcdir)/../config/dfp.m4 \
153
154 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
155         cd $(srcdir) && $(AUTOCONF)
156
157 include $(gcc_objdir)/libgcc.mvars
158
159 # Flags to pass to recursive makes.
160
161 AR_FOR_TARGET = $(AR)
162 AR_FLAGS_FOR_TARGET =
163 AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
164 AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
165 AWK = @AWK@
166 GCC_FOR_TARGET = $(CC)
167 LIPO = @LIPO@
168 LIPO_FOR_TARGET = $(LIPO)
169 MACHMODE_H = machmode.h mode-classes.def insn-modes.h
170 NM = @NM@
171 NM_FOR_TARGET = $(NM)
172 RANLIB_FOR_TARGET = $(RANLIB)
173 STRIP = @STRIP@
174 STRIP_FOR_TARGET = $(STRIP)
175
176 # Directory in which the compiler finds libraries etc.
177 libsubdir = $(libdir)/gcc/$(host_noncanonical)/$(version)
178 # Used to install the shared libgcc.
179 slibdir = @slibdir@
180 # Maybe used for DLLs on Windows targets.
181 toolexecdir = @toolexecdir@
182 toolexeclibdir = @toolexeclibdir@
183
184 export AR_FOR_TARGET
185 export AR_CREATE_FOR_TARGET
186 export AR_FLAGS_FOR_TARGET
187 export AR_EXTRACT_FOR_TARGET
188 export AWK
189 export DESTDIR
190 export GCC_FOR_TARGET
191 export INCLUDES
192 export INSTALL_DATA
193 export LIB1ASMSRC
194 export LIBGCC2_CFLAGS
195 export LIPO_FOR_TARGET
196 export MACHMODE_H
197 export NM_FOR_TARGET
198 export STRIP_FOR_TARGET
199 export RANLIB_FOR_TARGET
200 export libsubdir
201 export slibdir
202 export toolexecdir
203 export toolexeclibdir
204
205 version := $(shell $(CC) -dumpversion)
206
207 ifeq ($(decimal_float),yes)
208 ifeq ($(enable_decimal_float),bid)
209 DECNUMINC = -I$(srcdir)/config/libbid -DENABLE_DECIMAL_BID_FORMAT
210 else
211 DECNUMINC = -I$(srcdir)/../libdecnumber/$(enable_decimal_float) \
212             -I$(srcdir)/../libdecnumber
213 endif
214 else
215 DECNUMINC =
216 endif
217
218 # Specify the directories to be searched for header files.
219 # Both . and srcdir are used, in that order,
220 # so that *config.h will be found in the compilation
221 # subdirectory rather than in the source directory.
222 # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file
223 # currently being compiled, in both source trees, to be examined as well.
224 INCLUDES = -I. -I$(@D) -I$(gcc_objdir) \
225            -I$(srcdir) -I$(srcdir)/$(@D) -I$(srcdir)/../gcc \
226            -I$(srcdir)/../include $(DECNUMINC)
227
228 # Forcibly remove any profiling-related flags.  There is no point
229 # in supporting profiled bootstrap in this library.
230 override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS))
231
232 # CFLAGS first is not perfect; normally setting CFLAGS should override any
233 # options in LIBGCC2_CFLAGS.  But LIBGCC2_CFLAGS may contain -g0, and CFLAGS
234 # will usually contain -g, so for the moment CFLAGS goes first.  We must
235 # include CFLAGS - that's where multilib options live.
236 INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
237                   $(INCLUDES) @set_have_cc_tls@ @set_use_emutls@
238
239 MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
240 MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
241
242 MULTIOSSUBDIR := $(shell if test $(MULTIOSDIR) != .; then echo /$(MULTIOSDIR); fi)
243 inst_libdir = $(libsubdir)$(MULTISUBDIR)
244 inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
245
246 gcc_compile_bare = $(CC) $(INTERNAL_CFLAGS)
247 compile_deps = -MT $@ -MD -MP -MF $(basename $@).dep
248 gcc_compile = $(gcc_compile_bare) -o $@ $(compile_deps)
249 gcc_s_compile = $(gcc_compile) -DSHARED
250
251 objects = $(filter %$(objext),$^)
252
253 # Collect any host-specific information from Makefile fragments.
254
255 LIBGCC_VER_GNU_PREFIX = __
256 LIBGCC_VER_SYMBOLS_PREFIX =
257
258 tmake_file = @tmake_file@
259 include $(srcdir)/empty.mk $(tmake_file)
260
261 # Only handle shared libraries if both:
262 #   - the user requested them
263 #   - we know how to build them
264 ifeq ($(SHLIB_LINK),)
265   enable_shared := no
266 endif
267
268 ifeq ($(enable_shared),yes)
269   iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/shared-object.mk,$(iter-items))
270
271   install-shared = install-shared
272
273   ifneq ($(LIBUNWIND),)
274     install-libunwind = install-libunwind
275   endif
276
277 # For -fvisibility=hidden.  We need both a -fvisibility=hidden on
278 # the command line, and a #define to prevent libgcc2.h etc from
279 # overriding that with #pragmas.
280 vis_hide = @vis_hide@
281
282 ifneq (,$(vis_hide))
283
284 # If we have -fvisibility=hidden, then we need to generate hide
285 # lists for object files implemented in assembly.
286 ASM_HIDDEN_OP = @asm_hidden_op@
287
288 define gen-hide-list
289 $(NM) -pg $< | \
290   $(AWK) 'NF == 3 && $$2 !~ /^[UN]$$/ && $$3 !~ /.*_compat/ \
291          && $$3 !~ /.*@.*/ \
292          { print "\t$(ASM_HIDDEN_OP)", $$3 }' > $@T
293 mv -f $@T $@
294 endef
295 else
296 gen-hide-list = echo > $@
297 endif
298
299 else
300 # Not enable_shared.
301 iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items))
302 vis_hide =
303 gen-hide-list = echo > \$@
304 endif
305
306 ifneq ($(EXTRA_PARTS),)
307   extra-parts = libgcc-extra-parts
308   INSTALL_PARTS = $(EXTRA_PARTS)
309 else
310 ifneq ($(GCC_EXTRA_PARTS),)
311   extra-parts = gcc-extra-parts
312   INSTALL_PARTS = $(GCC_EXTRA_PARTS)
313 endif
314 endif
315
316 LIB2ADD += enable-execute-stack.c
317
318 # Library members defined in libgcc2.c.
319 lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2    \
320             _clear_cache _trampoline __main _absvsi2 \
321             _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \
322             _negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2  \
323             _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2        \
324             _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2      \
325             _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3        \
326             _divtc3 _bswapsi2 _bswapdi2 _clrsbsi2 _clrsbdi2
327
328 # The floating-point conversion routines that involve a single-word integer.
329 # XX stands for the integer mode.
330 swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
331
332 # Likewise double-word routines.
333 dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \
334                $(patsubst %,_fixuns%XX,sf df xf tf) \
335                $(patsubst %,_floatXX%,sf df xf tf) \
336                $(patsubst %,_floatunXX%,sf df xf tf)
337
338 ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
339   lib2funcs += $(subst XX,si,$(swfloatfuncs))
340   lib2funcs += $(subst XX,di,$(dwfloatfuncs))
341 endif
342
343 # These might cause a divide overflow trap and so are compiled with
344 # unwinder info.
345 LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
346
347 # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
348 # defined as optimized assembly code in LIB1ASMFUNCS or as C code
349 # in LIB2FUNCS_EXCLUDE.
350 lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs))
351 LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \
352                        $(LIB2_DIVMOD_FUNCS))
353
354 # Build "libgcc1" (assembly) components.
355 ifeq ($(enable_shared),yes)
356
357 lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
358 $(lib1asmfuncs-o): %$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC) %.vis
359         $(gcc_compile) -DL$* -xassembler-with-cpp \
360           -c $(gcc_srcdir)/config/$(LIB1ASMSRC) -include $*.vis
361 $(patsubst %,%.vis,$(LIB1ASMFUNCS)): %.vis: %_s$(objext)
362         $(gen-hide-list)
363 libgcc-objects += $(lib1asmfuncs-o)
364
365 lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS))
366 $(lib1asmfuncs-s-o): %_s$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC)
367         $(gcc_s_compile) -DL$* -xassembler-with-cpp \
368           -c $(gcc_srcdir)/config/$(LIB1ASMSRC)
369 libgcc-s-objects += $(lib1asmfuncs-s-o)
370
371 else
372
373 lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
374 $(lib1asmfuncs-o): %$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC)
375         $(gcc_compile) -DL$* -xassembler-with-cpp \
376           -c $(gcc_srcdir)/config/$(LIB1ASMSRC)
377 libgcc-objects += $(lib1asmfuncs-o)
378
379 endif
380
381 # Build lib2funcs.  For the static library also include LIB2FUNCS_ST.
382 lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
383 $(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c
384         $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
385           $(vis_hide)
386 libgcc-objects += $(lib2funcs-o)
387
388 ifeq ($(enable_shared),yes)
389 lib2funcs-s-o = $(patsubst %,%_s$(objext),$(lib2funcs))
390 $(lib2funcs-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
391         $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c
392 libgcc-s-objects += $(lib2funcs-s-o)
393 endif
394
395 ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
396 # Build libgcc2.c for each conversion function, with a specific
397 # L<func> definition and LIBGCC2_UNITS_PER_WORD setting.  The DImode
398 # functions are built with a wordsize of 4; the TImode functions are
399 # built with the same labels, but a wordsize of 8.
400
401 sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs)))
402 difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs)))
403 tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs)))
404
405 iter-items := $(sifuncs) $(difuncs) $(tifuncs)
406 iter-labels := $(sifuncs) $(difuncs) $(difuncs)
407 iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs))
408
409 include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
410
411 libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs))
412 ifeq ($(enable_shared),yes)
413 libgcc-s-objects += $(patsubst %,%_s$(objext),$(sifuncs) $(difuncs) $(tifuncs))
414 endif
415 endif
416
417 # Build LIB2_DIVMOD_FUNCS.
418 lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
419 $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
420         $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
421           -fexceptions -fnon-call-exceptions $(vis_hide)
422 libgcc-objects += $(lib2-divmod-o)
423
424 ifeq ($(enable_shared),yes)
425 lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
426 $(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
427         $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
428           -fexceptions -fnon-call-exceptions
429 libgcc-s-objects += $(lib2-divmod-s-o)
430 endif
431
432 # $(FPBIT) et al. are pathnames relative to the GCC build
433 # directory; the supporting files are made by the GCC
434 # Makefile.
435 # FIXME: Soon we will be able to move this logic into this directory.
436
437 ifneq ($(fpbit-in-libgcc),yes)
438 FPBIT:=$(if $(FPBIT),$(gcc_objdir)/$(FPBIT),)
439 DPBIT:=$(if $(DPBIT),$(gcc_objdir)/$(DPBIT),)
440 TPBIT:=$(if $(TPBIT),$(gcc_objdir)/$(TPBIT),)
441 endif
442
443 ifeq ($(TPBIT),)
444 # _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
445 FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
446 DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
447 endif
448
449 # Build FPBIT.
450 ifneq ($(FPBIT),)
451 fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
452 $(fpbit-o): %$(objext): $(FPBIT)
453         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT) $(vis_hide)
454 libgcc-objects += $(fpbit-o)
455
456 ifeq ($(enable_shared),yes)
457 fpbit-s-o = $(patsubst %,%_s$(objext),$(FPBIT_FUNCS))
458 $(fpbit-s-o): %_s$(objext): $(FPBIT)
459         $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT)
460 libgcc-s-objects += $(fpbit-s-o)
461 endif
462 endif
463
464 # Build DPBIT.
465 ifneq ($(DPBIT),)
466 dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
467 $(dpbit-o): %$(objext): $(DPBIT)
468         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT) $(vis_hide)
469 libgcc-objects += $(dpbit-o)
470
471 ifeq ($(enable_shared),yes)
472 dpbit-s-o = $(patsubst %,%_s$(objext),$(DPBIT_FUNCS))
473 $(dpbit-s-o): %_s$(objext): $(DPBIT)
474         $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT)
475 libgcc-s-objects += $(dpbit-s-o)
476 endif
477 endif
478
479 # Build TPBIT.
480 ifneq ($(TPBIT),)
481 tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
482 $(tpbit-o): %$(objext): $(TPBIT)
483         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(TPBIT) $(vis_hide)
484 libgcc-objects += $(tpbit-o)
485
486 ifeq ($(enable_shared),yes)
487 tpbit-s-o = $(patsubst %,%_s$(objext),$(TPBIT_FUNCS))
488 $(tpbit-s-o): %_s$(objext): $(TPBIT)
489         $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(TPBIT)
490 libgcc-s-objects += $(tpbit-s-o)
491 endif
492 endif
493
494 # Build decimal floating point support.
495 ifeq ($(decimal_float),yes)
496
497 # If $DFP_ENABLE is set, then we want all data type sizes.
498 ifneq ($(DFP_ENABLE),)
499 D32PBIT = 1
500 D64PBIT = 1
501 D128PBIT = 1
502 endif
503
504 dfp-filenames =
505 ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),)
506 ifeq ($(enable_decimal_float),bid)
507 dfp-filenames += bid_decimal_globals bid_decimal_data \
508                  bid_binarydecimal bid_convert_data \
509                  _isinfd32 _isinfd64 _isinfd128 bid64_noncomp \
510                  bid128_noncomp bid128_fma bid_round bid_from_int \
511                  bid64_add bid128_add bid64_div bid128_div \
512                  bid64_mul bid128_mul bid64_compare bid128_compare \
513                  bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \
514                  bid64_to_int32 bid64_to_int64 \
515                  bid64_to_uint32 bid64_to_uint64 \
516                  bid128_to_int32 bid128_to_int64 \
517                  bid128_to_uint32 bid128_to_uint64
518 else
519 dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle
520 endif
521 endif
522
523 dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames))
524 ifeq ($(enable_decimal_float),bid)
525 $(dfp-objects): %$(objext): $(srcdir)/config/libbid/%.c
526 else
527 $(dfp-objects): %$(objext): $(srcdir)/../libdecnumber/%.c
528 endif
529         $(gcc_compile) -c $<
530 libgcc-objects += $(dfp-objects)
531
532 decbits-filenames =
533 ifneq ($(enable_decimal_float),bid)
534 ifneq ($(D32PBIT),)
535 decbits-filenames += decimal32
536 endif
537
538 ifneq ($(D64PBIT),)
539 decbits-filenames += decimal64
540 endif
541
542 ifneq ($(D128PBIT),)
543 decbits-filenames += decimal128
544 endif
545 endif
546
547 decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames))
548 ifeq ($(enable_decimal_float),bid)
549 $(decbits-objects): %$(objext): $(srcdir)/config/libbid/%.c
550 else
551 $(decbits-objects): %$(objext): $(srcdir)/../libdecnumber/$(enable_decimal_float)/%.c
552 endif
553         $(gcc_compile) -c $<
554 libgcc-objects += $(decbits-objects)
555
556 # Next build individual support functions.
557 D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
558         _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
559         _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
560         _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
561         _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
562         _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
563         _sd_to_dd _sd_to_td _unord_sd _conv_sd
564
565 D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
566         _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
567         _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
568         _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
569         _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
570         _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
571         _dd_to_sd _dd_to_td _unord_dd _conv_dd
572
573 D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
574         _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
575         _td_to_si _td_to_di _td_to_usi _td_to_udi \
576         _si_to_td _di_to_td _usi_to_td _udi_to_td \
577         _td_to_sf _td_to_df _td_to_xf _td_to_tf \
578         _sf_to_td _df_to_td _xf_to_td _tf_to_td \
579         _td_to_sd _td_to_dd _unord_td _conv_td
580
581 ifeq ($(enable_decimal_float),bid)
582 ifneq ($(D32PBIT),)
583 D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
584 endif
585
586 ifneq ($(D64PBIT),)
587 D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS))
588 endif
589
590 ifneq ($(D128PBIT),)
591 D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS))
592 endif
593 endif
594
595 ifneq ($(D32PBIT),)
596 d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS))
597 ifeq ($(enable_decimal_float),bid)
598 $(d32pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
599 else
600 $(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
601 endif
602         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $<
603 libgcc-objects += $(d32pbit-o)
604 endif
605
606 ifneq ($(D64PBIT),)
607 d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS))
608 ifeq ($(enable_decimal_float),bid)
609 $(d64pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
610 else
611 $(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
612 endif
613         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
614 libgcc-objects += $(d64pbit-o)
615 endif
616
617 ifneq ($(D128PBIT),)
618 d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS))
619 ifeq ($(enable_decimal_float),bid)
620 $(d128pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
621 else
622 $(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
623 endif
624         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
625 libgcc-objects += $(d128pbit-o)
626 endif
627
628 endif
629
630 ifeq ($(LIBGCC_SYNC),yes)
631 libgcc-sync-size-funcs := $(foreach op, add sub or and xor nand, \
632                             sync_fetch_and_$(op) \
633                             sync_$(op)_and_fetch) \
634                           sync_bool_compare_and_swap \
635                           sync_val_compare_and_swap \
636                           sync_lock_test_and_set
637
638 libgcc-sync-size-funcs := $(foreach prefix, $(libgcc-sync-size-funcs), \
639                             $(foreach suffix, 1 2 4 8 16, \
640                               $(prefix)_$(suffix)))
641
642 libgcc-sync-size-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-size-funcs))
643 $(libgcc-sync-size-funcs-o): %$(objext): $(gcc_srcdir)/config/sync.c
644         $(gcc_compile) $(LIBGCC_SYNC_CFLAGS) \
645           -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
646           -DSIZE=`echo "$*" | sed 's/.*_//'` \
647           -c $(gcc_srcdir)/config/sync.c $(vis_hide)
648 libgcc-objects += $(libgcc-sync-size-funcs-o)
649
650 libgcc-sync-funcs := sync_synchronize
651
652 libgcc-sync-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-funcs))
653 $(libgcc-sync-funcs-o): %$(objext): $(gcc_srcdir)/config/sync.c
654         $(gcc_compile) $(LIBGCC_SYNC_CFLAGS) \
655           -DL$* \
656           -c $(gcc_srcdir)/config/sync.c $(vis_hide)
657 libgcc-objects += $(libgcc-sync-funcs-o)
658
659 ifeq ($(enable_shared),yes)
660 libgcc-sync-size-funcs-s-o = $(patsubst %,%_s$(objext), \
661                                $(libgcc-sync-size-funcs))
662 $(libgcc-sync-size-funcs-s-o): %_s$(objext): $(gcc_srcdir)/config/sync.c
663         $(gcc_s_compile) $(LIBGCC_SYNC_CFLAGS) \
664           -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
665           -DSIZE=`echo "$*" | sed 's/.*_//'` \
666           -c $(gcc_srcdir)/config/sync.c
667 libgcc-s-objects += $(libgcc-sync-size-funcs-s-o)
668
669 libgcc-sync-funcs-s-o = $(patsubst %,%_s$(objext),$(libgcc-sync-funcs))
670 $(libgcc-sync-funcs-s-o): %_s$(objext): $(gcc_srcdir)/config/sync.c
671         $(gcc_s_compile) $(LIBGCC_SYNC_CFLAGS) \
672           -DL$* \
673           -c $(gcc_srcdir)/config/sync.c
674 libgcc-s-objects += $(libgcc-sync-funcs-s-o)
675 endif
676 endif
677
678 # Build fixed-point support.
679 ifeq ($(fixed_point),yes)
680
681 # Generate permutations of function name and mode
682 fixed-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith labels)
683 fixed-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith funcs)
684 fixed-modes := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith modes)
685
686 # Generate the rules for each arithmetic function
687 iter-items := $(fixed-funcs)
688 iter-labels := $(fixed-labels)
689 iter-from := $(fixed-modes)
690 iter-to := $(fixed-modes)
691 include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items))
692
693 # Add arithmetic functions to list of objects to be built
694 libgcc-objects += $(patsubst %,%$(objext),$(fixed-funcs))
695 ifeq ($(enable_shared),yes)
696 libgcc-s-objects += $(patsubst %,%_s$(objext),$(fixed-funcs))
697 endif
698
699 # Convert from or to fractional
700 fixed-conv-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv funcs)
701 fixed-conv-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv labels)
702 fixed-conv-from := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv from)
703 fixed-conv-to :=  $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv to)
704
705 # Generate the make rules for each conversion function
706 iter-items := $(fixed-conv-funcs)
707 iter-labels := $(fixed-conv-labels)
708 iter-from := $(fixed-conv-from)
709 iter-to := $(fixed-conv-to)
710 include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items))
711
712 # Add conversion functions to list of objects to be built
713 libgcc-objects += $(patsubst %,%$(objext),$(fixed-conv-funcs))
714 ifeq ($(enable_shared),yes)
715 libgcc-s-objects += $(patsubst %,%_s$(objext),$(fixed-conv-funcs))
716 endif
717
718 endif
719
720 # Build LIB2ADD and LIB2ADD_ST.
721 ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),)
722 $(error Unsupported files in LIB2ADD or LIB2ADD_ST.)
723 endif
724
725 libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD))))
726 libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST))))
727
728 c_flags :=
729 iter-items := $(LIB2ADD) $(LIB2ADD_ST)
730 include $(iterator)
731
732 ifeq ($(enable_shared),yes)
733 libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADD))))
734 endif
735
736 # Build LIB2ADDEH, LIB2ADDEHSTATIC, and LIB2ADDEHSHARED.  If we don't have
737 # libgcc_eh.a, only LIB2ADDEH matters.  If we do, only LIB2ADDEHSTATIC and
738 # LIB2ADDEHSHARED matter.  (Usually all three are identical.)
739
740 c_flags := -fexceptions
741
742 ifeq ($(enable_shared),yes)
743
744 libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEHSTATIC))))
745 libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADDEHSHARED))))
746
747 iter-items := $(sort $(LIB2ADDEHSTATIC) $(LIB2ADDEHSHARED))
748 include $(iterator)
749
750 else
751 # Not shared.  LIB2ADDEH are added to libgcc.a.
752
753 libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH))))
754
755 iter-items := $(LIB2ADDEH)
756 include $(iterator)
757
758 endif
759
760 # Build LIBUNWIND.
761
762 c_flags := -fexceptions
763
764 libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND))))
765
766 ifeq ($(enable_shared),yes)
767 libunwind-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIBUNWIND))))
768 endif
769
770 iter-items := $(LIBUNWIND)
771 include $(iterator)
772
773 # Build libgcov components.
774
775 # Defined in libgcov.c, included only in gcov library
776 LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \
777     _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \
778     _gcov_execv _gcov_execvp _gcov_execve \
779     _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler \
780     _gcov_indirect_call_profiler _gcov_average_profiler _gcov_ior_profiler \
781     _gcov_merge_ior
782
783 libgcov-objects = $(patsubst %,%$(objext),$(LIBGCOV))
784
785 $(libgcov-objects): %$(objext): $(srcdir)/libgcov.c
786         $(gcc_compile) -DL$* -c $(srcdir)/libgcov.c
787
788
789 # Static libraries.
790 libgcc.a: $(libgcc-objects)
791 libgcov.a: $(libgcov-objects)
792 libunwind.a: $(libunwind-objects)
793 libgcc_eh.a: $(libgcc-eh-objects)
794
795 libgcc.a libgcov.a libunwind.a libgcc_eh.a:
796         -rm -f $@
797
798         objects="$(objects)";                                   \
799         if test -z "$$objects"; then                            \
800           echo 'int __libgcc_eh_dummy;' > eh_dummy.c;           \
801           $(gcc_compile_bare) $(vis_hide) -c eh_dummy.c         \
802              -o eh_dummy$(objext);                              \
803           objects=eh_dummy$(objext);                            \
804         fi;                                                     \
805         $(AR_CREATE_FOR_TARGET) $@ $$objects
806
807         $(RANLIB) $@
808
809 all: libgcc.a libgcov.a
810
811 ifneq ($(LIBUNWIND),)
812 all: libunwind.a
813 libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
814 endif
815
816 ifeq ($(enable_shared),yes)
817 all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
818 ifneq ($(LIBUNWIND),)
819 all: libunwind$(SHLIB_EXT)
820 endif
821 endif
822
823 ifeq ($(enable_shared),yes)
824
825 # Map-file generation.
826 ifneq ($(SHLIB_MKMAP),)
827 libgcc.map: $(SHLIB_MKMAP) $(SHLIB_MAPFILES) $(libgcc-s-objects)
828         { $(NM) $(SHLIB_NM_FLAGS) $(libgcc-s-objects); echo %%; \
829           cat $(SHLIB_MAPFILES) \
830             | sed -e '/^[       ]*#/d' \
831                   -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
832             | $(gcc_compile_bare) -E -xassembler-with-cpp -; \
833         } | $(AWK) -f $(SHLIB_MKMAP) $(SHLIB_MKMAP_OPTS) > tmp-$@
834         mv tmp-$@ $@
835 libgcc_s$(SHLIB_EXT): libgcc.map
836 mapfile = libgcc.map
837 endif
838
839 libgcc-std.ver: $(srcdir)/libgcc-std.ver.in
840         sed -e 's/__PFX__/$(LIBGCC_VER_GNU_PREFIX)/g' < $< > $@
841
842 libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts)
843         # @multilib_flags@ is still needed because this may use
844         # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
845         # @multilib_dir@ is not really necessary, but sometimes it has
846         # more uses than just a directory name.
847         $(mkinstalldirs) $(MULTIDIR)
848         $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
849                 @multilib_dir@,$(MULTIDIR),$(subst \
850                 @shlib_objs@,$(objects),$(subst \
851                 @shlib_base_name@,libgcc_s,$(subst \
852                 @shlib_map_file@,$(mapfile),$(subst \
853                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
854                 @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
855
856 libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
857         # @multilib_flags@ is still needed because this may use
858         # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
859         # @multilib_dir@ is not really necessary, but sometimes it has
860         # more uses than just a directory name.
861         $(mkinstalldirs) $(MULTIDIR)
862         $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
863                 @multilib_dir@,$(MULTIDIR),$(subst \
864                 @shlib_objs@,$(objects),$(subst \
865                 @shlib_base_name@,libunwind,$(subst \
866                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_LINK))))))
867
868 endif
869
870 # Build the standard GCC startfiles and endfiles.
871 ALL_CRT_CFLAGS = $(CFLAGS) $(CRTSTUFF_CFLAGS) $(INCLUDES)
872 crt_compile = $(CC) $(ALL_CRT_CFLAGS) -o $@ $(compile_deps)
873
874 ifeq ($(CUSTOM_CRTSTUFF),)
875 crtbegin$(objext): $(gcc_srcdir)/crtstuff.c
876         $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
877           -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN
878
879 crtend$(objext): $(gcc_srcdir)/crtstuff.c
880         $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
881           -c $(gcc_srcdir)/crtstuff.c -DCRT_END
882
883 # These are versions of crtbegin and crtend for shared libraries.
884 crtbeginS$(objext): $(gcc_srcdir)/crtstuff.c
885         $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
886           -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O
887
888 crtendS$(objext): $(gcc_srcdir)/crtstuff.c
889         $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
890           -c $(gcc_srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O
891
892 # This is a version of crtbegin for -static links.
893 crtbeginT.o: $(gcc_srcdir)/crtstuff.c
894         $(crt_compile) $(CRTSTUFF_T_CFLAGS) \
895           -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
896 endif
897
898 # Build extra startfiles in the libgcc directory.
899 .PHONY: libgcc-extra-parts
900 libgcc-extra-parts: $(EXTRA_PARTS)
901 ifneq ($(GCC_EXTRA_PARTS),)
902 ifneq ($(sort $(EXTRA_PARTS)),$(GCC_EXTRA_PARTS))
903         # If the gcc directory specifies which extra parts to
904         # build for this target, and the libgcc configuration also
905         # specifies, make sure they match.  This can be removed
906         # when the gcc directory no longer holds libgcc configuration;
907         # it is useful when migrating a target.
908         @echo "Configuration mismatch!"
909         @echo "Extra parts from gcc directory: $(GCC_EXTRA_PARTS)"
910         @echo "Extra parts from libgcc: $(EXTRA_PARTS)"
911         exit 1
912 endif
913 endif
914
915         # Early copyback; see "all" above for the rationale.  The
916         # early copy is necessary so that the gcc -B options find
917         # the right startup files when linking shared libgcc.
918         $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR)
919         parts="$(EXTRA_PARTS)";                                 \
920         for file in $$parts; do                                 \
921           rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file;             \
922           $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/;  \
923           case $$file in                                        \
924             *.a)                                                \
925               $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;;   \
926           esac;                                                 \
927         done
928
929 # Build extra startfiles in the gcc directory, for unconverted
930 # targets.
931 .PHONY: gcc-extra-parts
932 gcc-extra-parts:
933         # Recursively invoke make in the GCC directory to build any
934         # startfiles (for now).  We must do this just once, passing
935         # it all the GCC_EXTRA_PARTS as simultaneous goal targets,
936         # so that rules which cannot execute simultaneously are properly
937         # serialized.  We indirect through T_TARGET in case any multilib
938         # directories contain an equals sign, to prevent make from
939         # interpreting any of the goals as variable assignments.
940
941         # We must use cd && make rather than make -C, or else the stage
942         # number will be embedded in debug information.
943
944         T=`$(PWD_COMMAND)`/ \
945         && cd $(gcc_objdir) \
946         && $(MAKE) GCC_FOR_TARGET="$(CC)" \
947           MULTILIB_CFLAGS="$(CFLAGS)" \
948           T=$$T \
949           T_TARGET="$(patsubst %,$${T}%,$(GCC_EXTRA_PARTS))" \
950           T_TARGET
951
952         # Early copyback; see "all" above for the rationale.  The
953         # early copy is necessary so that the gcc -B options find
954         # the right startup files when linking shared libgcc.
955         $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR)
956         parts="$(GCC_EXTRA_PARTS)";                             \
957         for file in $$parts; do                                 \
958           rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file;             \
959           $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/;  \
960           case $$file in                                        \
961             *.a)                                                \
962               $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;;   \
963           esac;                                                 \
964         done
965
966 all: $(extra-parts)
967
968 # Documentation targets (empty).
969 .PHONY: info html dvi pdf install-info install-html install-pdf
970
971 info:
972 install-info:
973 html:
974 install-html:
975 dvi:
976 pdf:
977 install-pdf:
978
979 # Install rules.  These do not depend on "all", so that they can be invoked
980 # recursively from it.
981 install-libunwind:
982         $(mkinstalldirs) $(DESTDIR)$(inst_slibdir)
983
984         # NOTE: Maybe this should go into $(inst_libdir), but this
985         # is where the old mklibgcc.in put it.
986         $(INSTALL_DATA) libunwind.a $(DESTDIR)$(inst_slibdir)/
987         chmod 644 $(DESTDIR)$(inst_slibdir)/libunwind.a
988         $(RANLIB) $(DESTDIR)$(inst_slibdir)/libunwind.a
989
990         $(subst @multilib_dir@,$(MULTIDIR),$(subst \
991                 @shlib_base_name@,libunwind,$(subst \
992                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_INSTALL))))
993
994 install-shared:
995         $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
996
997         $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
998         chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
999         $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
1000
1001         $(subst @multilib_dir@,$(MULTIDIR),$(subst \
1002                 @shlib_base_name@,libgcc_s,$(subst \
1003                 @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
1004
1005 install-leaf: $(install-shared) $(install-libunwind)
1006         $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
1007
1008         $(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/
1009         chmod 644 $(DESTDIR)$(inst_libdir)/libgcc.a
1010         $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc.a
1011         $(INSTALL_DATA) libgcov.a $(DESTDIR)$(inst_libdir)/
1012         chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
1013         $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
1014
1015         parts="$(INSTALL_PARTS)";                               \
1016         for file in $$parts; do                                 \
1017           rm -f $(DESTDIR)$(inst_libdir)/$$file;                \
1018           $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/;     \
1019           case $$file in                                        \
1020             *.a)                                                \
1021               $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;;   \
1022           esac;                                                 \
1023         done
1024
1025 install: install-leaf
1026         @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
1027
1028 install-strip: install
1029
1030 .PHONY: install install-shared install-libunwind install-strip
1031
1032 # Don't export variables to the environment, in order to not confuse
1033 # configure.
1034 .NOEXPORT:
1035
1036 include $(srcdir)/empty.mk $(wildcard *.dep)
1037
1038 # TODO QUEUE:
1039 #   Garbage collect in gcc/:
1040 #     $(LIBGCC) settings in t-* are now unused
1041 #
1042 #   Remove use of $(gcc_srcdir).  Source files referenced using $(gcc_srcdir)
1043 #   should move into the libgcc directory.
1044