2 # Construct makefile for libgcc.
3 # Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 # This file is part of GCC.
7 # Arguments, taken from the environment, since there are a lot
8 # of them, and positional args becomes quite ugly.
33 # EXTRA_MULTILIB_PARTS
45 # Make needs VPATH to be literal.
46 echo 'srcdir = @srcdir@'
47 echo 'VPATH = @srcdir@'
49 echo 'objects = $(filter %'$objext',$^)'
51 echo '# Dependencies are accumulated as we go.'
56 # Library members defined in libgcc2.c.
57 lib2funcs
='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
58 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
59 _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
60 _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
61 _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
62 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
63 _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
64 _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2
65 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3
66 _divxc3 _divtc3 _floatundidf _floatundisf _floatundixf _floatunditf'
68 # Disable SHLIB_LINK if shared libgcc not enabled.
69 if [ "@enable_shared@" = "no" ]; then
75 gcc_compile
='$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES)'
76 gcc_s_compile
="$gcc_compile -DSHARED"
77 make_compile
='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
78 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
79 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
80 AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
81 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
82 CC="$(CC)" CFLAGS="$(CFLAGS)" \
83 BUILD_PREFIX="$(BUILD_PREFIX)" \
84 BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
85 LANGUAGES="$(LANGUAGES)"'
87 # Generic dependencies for libgcc
88 libgcc_dep
='$(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h'
90 # Dependencies for libgcc2.c
91 libgcc2_c_dep
='stmp-dirs $(srcdir)/libgcc2.c $(srcdir)/libgcc2.h gbl-ctors.h'" $libgcc_dep"
93 # Dependencies for libgcov.c
94 libgcov_c_dep
='stmp-dirs $(srcdir)/libgcov.c $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h'" $libgcc_dep"
96 # Dependencies for fp-bit.c
97 fpbit_c_dep
='stmp-dirs config.status tsystem.h'
99 # Flag whether we need eh_dummy.c
102 if [ "$SHLIB_LINK" ]; then
103 # Test -fvisibility=hidden. We need both a -fvisibility=hidden on
104 # the command line, and a #define to prevent libgcc2.h etc from
105 # overriding that with #pragmas. The dance with @ is to prevent
106 # echo from seeing anything it might take for an option.
107 # echo turns the \$\$\$\$ into $$$$ and when make sees it it
108 # becomes $$ and the shell substitutes the pid. Makes for a
109 # slightly safer temp file.
110 echo "vis_hide := \$(strip \$(subst @,-,\\"
111 echo " \$(shell if echo 'void foo(void); void foo(void) {}' | \\"
112 echo " $gcc_compile -fvisibility=hidden -Werror \\"
113 echo " -c -xc - -o vis_temp_file\$\$\$\$.o 2> /dev/null; \\"
114 echo " then echo @fvisibility=hidden @DHIDE_EXPORTS; \\"
115 echo " rm vis_temp_file\$\$\$\$.o 2> /dev/null; \\"
119 # If we have -fvisibility=hidden, then we need to generate hide
120 # lists for object files implemented in assembly. The default
121 # pseudo-op for this is ".hidden", but can be overridden with
123 [ "$ASM_HIDDEN_OP" ] || ASM_HIDDEN_OP
=".hidden"
125 echo "ifneq (,\$(vis_hide))"
126 echo "define gen-hide-list"
127 echo "\$(NM_FOR_TARGET) ${SHLIB_NM_FLAGS} \$< | \\"
128 # non-GNU nm emits three fields even for undefined and typeless symbols,
129 # so explicitly omit them
130 echo " \$(AWK) 'NF == 3 && \$\$2 !~ /^[UN]\$\$/ { print \"\\t${ASM_HIDDEN_OP}\", \$\$3 }' > \$@T"
131 echo "mv -f \$@T \$@"
134 echo "gen-hide-list = echo > \$@"
138 # It is too hard to guarantee that vis_hide and gen-hide-list will never
139 # be referenced if SHLIB_LINK is not set, so set them to the values they'd
140 # have if SHLIB_LINK were set and we didn't have visibility support.
142 echo "gen-hide-list = echo > \$@"
145 # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
146 # defined as optimized assembly code in LIB1ASMFUNCS.
147 for name
in $LIB1ASMFUNCS; do
148 lib2funcs
=`echo $lib2funcs | sed -e 's/^'$name' //' \
149 -e 's/ '$name' / /' \
151 LIB2_DIVMOD_FUNCS
=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
152 -e 's/ '$name' / /' \
157 # Rules to generate object files.
160 for ml
in $MULTILIBS; do
162 # Work out relevant parameters that depend only on the multilib.
163 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
164 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
166 libgcc_a
=$dir/libgcc.a
167 libgcov_a
=$dir/libgcov.a
173 if [ "$LIBUNWIND" ]; then
174 libunwind_a
=$dir/libunwind.a
176 if [ "$SHLIB_LINK" ]; then
177 libgcc_eh_a
=$dir/libgcc_eh.a
178 libgcc_s_so
=$dir/libgcc_s
${SHLIB_EXT}
179 if [ "$LIBUNWIND" ]; then
180 libunwind_so
=$dir/libunwind
${SHLIB_EXT}
182 os_multilib_dir
=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
183 if [ "$os_multilib_dir" != .
]; then
184 shlib_slibdir_qual
="/$os_multilib_dir"
195 echo \
# flags: $flags
196 echo \
# libgcc_a: $libgcc_a
197 echo \
# libgcov_a: $libgcov_a
198 echo \
# libgcc_eh_a: $libgcc_eh_a
199 echo \
# libunwind_a: $libunwind_a
201 echo \
# shlib_slibdir_qual: $shlib_slibdir_qual
202 echo \
# libgcc_s_so: $libgcc_s_so
203 echo \
# libunwind_so: $libunwind_so
207 # Update list of directories.
208 if [ $dir != .
]; then
209 echo "dirs += ${dir} libgcc/${dir}"
214 # Build libgcc1 components.
216 for name
in $LIB1ASMFUNCS; do
217 if [ "$libgcc_s_so" ]; then
218 out
="libgcc/${dir}/${name}${objext}"
219 outS
="libgcc/${dir}/${name}_s${objext}"
220 outV
="libgcc/${dir}/${name}.vis"
222 echo ${outS}: stmp-dirs
'$(srcdir)/config/$(LIB1ASMSRC)'
223 echo " $gcc_s_compile" $flags -DL$name -xassembler-with-cpp \
224 -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $outS
226 echo ${out}: stmp-dirs
'$(srcdir)/config/$(LIB1ASMSRC)' ${outV}
227 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
228 -c '$(srcdir)/config/$(LIB1ASMSRC)' -include $outV -o $out
230 echo "${outV}: ${outS}; \$(gen-hide-list)"
233 echo $libgcc_s_so: $outS
234 if [ "$SHLIB_MKMAP" ]; then
235 echo libgcc
/${dir}/libgcc.map
: $outS
238 out
="libgcc/${dir}/${name}${objext}"
239 echo ${out}: stmp-dirs
'$(srcdir)/config/$(LIB1ASMSRC)'
240 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
241 -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
247 # Build libgcc2 components.
250 for name
in $lib2funcs; do
251 if [ "$libgcc_s_so" ]; then
252 out
="libgcc/${dir}/${name}${objext}"
253 outS
="libgcc/${dir}/${name}_s${objext}"
255 echo $outS: $libgcc2_c_dep
256 echo " $gcc_s_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' \
259 echo $out: $libgcc2_c_dep
260 echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
261 -c '$(srcdir)/libgcc2.c' -o $out
264 echo $libgcc_s_so: $outS
265 if [ "$SHLIB_MKMAP" ]; then
266 echo libgcc
/${dir}/libgcc.map
: $outS
269 out
="libgcc/${dir}/${name}${objext}"
270 echo ${out}: stmp-dirs
'$(srcdir)/config/$(LIB1ASMSRC)'
271 echo " $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $out
276 for name
in $LIB2FUNCS_ST; do
277 out
="libgcc/${dir}/${name}${objext}"
279 echo $out: $libgcc2_c_dep
280 echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
281 -c '$(srcdir)/libgcc2.c' -o $out
282 echo ${dir}/libgcc.a
: $out
285 for name
in $LIB2_DIVMOD_FUNCS; do
286 if [ "$libgcc_s_so" ]; then
287 out
="libgcc/${dir}/${name}${objext}"
288 outS
="libgcc/${dir}/${name}_s${objext}"
290 echo $outS: $libgcc2_c_dep
291 echo " $gcc_s_compile" $flags -DL$name \
292 -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $outS
294 echo $out: $libgcc2_c_dep
295 echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
296 -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
299 echo $libgcc_s_so: $outS
300 if [ "$SHLIB_MKMAP" ]; then
301 echo libgcc
/${dir}/libgcc.map
: $outS
304 out
="libgcc/${dir}/${name}${objext}"
305 echo ${out}: stmp-dirs
'$(srcdir)/config/$(LIB1ASMSRC)'
306 echo " $gcc_compile" $flags -DL$name \
307 -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
313 # Build software floating point functions.
316 for fpbit_var
in FPBIT DPBIT TPBIT
; do
317 fpfuncs_var
="${fpbit_var}_FUNCS"
318 eval fpbit
=\$
$fpbit_var
319 eval fpfuncs
=\$
$fpfuncs_var
321 if [ "$fpbit" ] ; then
322 for name
in $fpfuncs; do
323 if [ "$libgcc_s_so" ]; then
324 out
="libgcc/${dir}/${name}${objext}"
325 outS
="libgcc/${dir}/${name}_s${objext}"
327 echo $outS: $fpbit $fpbit_c_dep
328 echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
331 echo $out: $fpbit $fpbit_c_dep
332 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
333 '$(vis_hide)' -c $fpbit -o $out
336 echo $libgcc_s_so: $outS
337 if [ "$SHLIB_MKMAP" ]; then
338 echo libgcc
/${dir}/libgcc.map
: $outS
341 out
="libgcc/${dir}/${name}${objext}"
342 echo $out: $fpbit $fpbit_c_dep
343 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
352 for file in $LIB2ADD; do
353 name
=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`
354 oname
=`echo $name | sed -e 's,.*/,,'`
356 if [ "$libgcc_s_so" ]; then
357 out
="libgcc/${dir}/${oname}${objext}"
358 outS
="libgcc/${dir}/${oname}_s${objext}"
362 echo $outS: stmp-dirs
$file $libgcc_dep
363 echo " $gcc_s_compile" $flags -c $file -o $outS
365 echo $out: stmp-dirs
$file $libgcc_dep
366 echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
370 outV
="libgcc/${dir}/${oname}.vis"
372 echo $outS: stmp-dirs
$file $libgcc_dep
373 echo " $gcc_s_compile" $flags -xassembler-with-cpp \
376 echo $out: stmp-dirs
$file $libgcc_dep $outV
377 echo " $gcc_compile" $flags -xassembler-with-cpp \
378 -include $outV -c $file -o $out
379 echo "${outV}: ${outS}; \$(gen-hide-list)"
383 echo "Unhandled extension: $file" >&2
389 echo $libgcc_s_so: $outS
390 if [ "$SHLIB_MKMAP" ]; then
391 echo libgcc
/${dir}/libgcc.map
: $outS
394 out
="libgcc/${dir}/${oname}${objext}"
397 echo $out: stmp-dirs
$file $libgcc_dep
398 echo " $gcc_compile" $flags -c $file -o $out
402 echo $out: stmp-dirs
$file $libgcc_dep
403 echo " $gcc_compile" $flags -xassembler-with-cpp \
408 echo "Unhandled extension: $file" >&2
418 for file in $LIB2ADD_ST; do
419 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
420 oname
=`echo $name | sed -e 's,.*/,,'`
421 out
="libgcc/${dir}/${oname}${objext}"
425 echo $out: stmp-dirs
$file $libgcc_dep
426 echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
430 # We may have to compile it twice in order to establish the list
431 # of symbols to be marked hidden.
432 if [ "$libgcc_so" ]; then
433 outV
="libgcc/${dir}/${oname}.vis"
434 outT
="libgcc/${dir}/${oname}_t${objext}"
435 echo ${outT}: stmp-dirs
$file $libgcc_dep
436 echo " $gcc_compile" $flags -xassembler-with-cpp \
438 echo $out: stmp-dirs
$file $libgcc_dep $outV
439 echo " $gcc_compile" $flags -xassembler-with-cpp \
440 -include $outV -c $file -o $out
441 echo "${outV}: ${outT}; \$(gen-hide-list)"
443 echo $out: stmp-dirs
$file $libgcc_dep
444 echo " $gcc_compile" $flags -xassembler-with-cpp \
450 echo "Unhandled extension: $file" >&2
457 # If we don't have libgcc_eh.a, only LIB2ADDEH matters. If we do, only
458 # LIB2ADDEHSTATIC and LIB2ADDEHSHARED matter. (Usually all three are
461 if [ "$libgcc_eh_a" ]; then
462 for file in $LIB2ADDEHSTATIC; do
463 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
464 oname
=`echo $name | sed -e 's,.*/,,'`
465 out
="libgcc/${dir}/${oname}${objext}"
469 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
470 echo " $gcc_compile" $flags -fexceptions '$(vis_hide)' -c $file -o $out
473 # We have to compile it twice in order to establish the list
474 # of symbols to be marked hidden.
475 outV
="libgcc/${dir}/${oname}.vis"
476 outT
="libgcc/${dir}/${oname}_t${objext}"
477 echo ${outT}: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
478 echo " $gcc_compile" $flags -xassembler-with-cpp \
480 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep $outV
481 echo " $gcc_compile" $flags -xassembler-with-cpp \
482 -include $outV -c $file -o $out
483 echo "${outV}: ${outT}; \$(gen-hide-list)"
485 *) echo "Unhandled extension: $file">&2; exit 1 ;;
488 echo $libgcc_eh_a: $out
491 for file in $LIB2ADDEHSHARED; do
492 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
493 oname
=`echo $name | sed -e 's,.*/,,'`
494 outS
="libgcc/${dir}/${oname}_s${objext}"
498 echo $outS: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
499 echo " $gcc_s_compile" $flags -fexceptions -c $file -o $outS
502 echo $outS: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
503 echo " $gcc_s_compile" $flags -xassembler-with-cpp -c $file -o $outS
505 *) echo "Unhandled extension: $file">&2; exit 1 ;;
508 echo $libgcc_s_so: $outS
509 if [ "$SHLIB_MKMAP" ]; then
510 echo libgcc
/${dir}/libgcc.map
: $outS
514 # If nothing went into libgcc_eh.a, create a dummy object -
515 # some linkers don't like totally empty archives.
516 if [ -z "$LIB2ADDEHSTATIC" ]; then
518 out
="libgcc/${dir}/eh_dummy${objext}"
521 echo $out: stmp-dirs
$file
522 echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
523 echo $libgcc_eh_a: $out
527 else # no libgcc_eh.a
528 for file in $LIB2ADDEH; do
529 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
530 oname
=`echo $name | sed -e 's,.*/,,'`
531 out
="libgcc/${dir}/${oname}${objext}"
535 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
536 echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
539 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
540 echo " $gcc_compile" $flags -xassembler-with-cpp \
543 *) echo "Unhandled extension: $file">&2; exit 1 ;;
550 # We do _not_ handle assembly files in this context.
551 if [ "$LIBUNWIND" ]; then
552 for file in $LIBUNWIND; do
555 *) echo "Unhandled extension: $file">&2; exit 1 ;;
558 name
=`echo $file | sed -e 's/[.]c$//'`
559 oname
=`echo $name | sed -e 's,.*/,,'`
561 if [ "$libunwind_so" ]; then
562 out
="libgcc/${dir}/${oname}${objext}"
563 outS
="libgcc/${dir}/${oname}_s${objext}"
565 echo $out: stmp-dirs
$file $LIBUNWINDDEP
566 echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
568 echo $outS: stmp-dirs
$file $LIBUNWINDDEP
569 echo " $gcc_s_compile $flags -fexceptions -c $file -o $outS"
571 echo $libunwind_a: $out
572 echo $libunwind_so: $outS
574 out
="libgcc/${dir}/${oname}${objext}"
575 echo $out: stmp-dirs
$file $LIBUNWINDDEP
576 echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
577 echo $libunwind_a: $out
583 # build libgcov components
585 for name
in $LIBGCOV; do
586 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
587 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
588 out
="libgcc/${dir}/${name}${objext}"
590 echo $out: $libgcov_c_dep
591 echo " $gcc_compile $flags -DL$name -c \$(srcdir)/libgcov.c -o $out"
592 echo $libgcov_a: $out
595 # EXTRA_MULTILIB_PARTS.
596 if [ -n "$EXTRA_MULTILIB_PARTS" ]; then
597 # Each of the EXTRA_MULTILIB_PARTS is built by recursive invocation
598 # of the parent Makefile. We must do this just once for each
599 # multilib, passing it all the EXTRA_MULTILIB_PARTS as
600 # simultaneous goal targets, so that rules which cannot execute
601 # simultaneously are properly serialized.
605 for f
in $EXTRA_MULTILIB_PARTS; do
608 *) out
=$dir/$f ; t
=$dir/ ;;
611 # Prevent `make' from interpreting $out as a macro assignment
612 *'$(EQ)'*) targ
="T_TARGET=$out T_TARGET" ;;
618 if [ "$dir" = .
]; then
621 suffix
=`echo $dir | sed s,/,_,g`
623 echo extra
$suffix: stmp-dirs
624 echo " $make_compile" \\
625 echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
626 echo ' MULTILIB_CFLAGS="'$flags'"' T
=$t $extra
627 echo "all: extra$suffix"
629 # Make libunwind.so and libgcc_s.so depend on these, since they
630 # are likely to be implicitly used by the link process.
631 if [ "$libgcc_s_so" ]; then
632 echo "$libgcc_s_so: extra$suffix"
634 if [ "$libunwind_so" ]; then
635 echo "$libunwind_so: extra$suffix"
639 # Library build rules.
640 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
641 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
643 # Map-file generation.
644 if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
645 mapfile
="libgcc/${dir}/libgcc.map"
646 tmpmapfile
="libgcc/${dir}/tmp-libgcc.map"
647 # This uses a here document instead of echos because some shells
648 # will convert the \1 in the second sed command to a control-A.
649 # The behavior of here documents is more predictable.
652 ${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES
653 { \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS \$(objects); echo %%; \\
654 cat $SHLIB_MAPFILES \\
655 | sed -e '/^[ ]*#/d' \\
656 -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\
657 | $gcc_compile $flags -E -xassembler-with-cpp -; \\
658 } | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile}
660 $libgcc_s_so: ${mapfile}
666 # Each of these .a files depends on stmp-dirs. It would seem that
667 # this dependency is redundant, since each of the object files
668 # itself depends on stmp-dirs. However, it is possible that there
669 # are in fact no object files. In that case, the stmp-dirs
670 # dependency is required; the directory containing the archive must
671 # exist before the archive itself can be created.
673 echo "$libgcc_a: stmp-dirs"
674 echo " -rm -f $libgcc_a"
675 echo ' $(AR_CREATE_FOR_TARGET)' $libgcc_a '$(objects)'
676 echo ' $(RANLIB_FOR_TARGET)' $libgcc_a
677 echo "all: $libgcc_a"
680 echo "$libgcov_a: stmp-dirs"
681 echo " -rm -f $libgcov_a"
682 echo ' $(AR_CREATE_FOR_TARGET)' $libgcov_a '$(objects)'
683 echo ' $(RANLIB_FOR_TARGET)' $libgcov_a
684 echo "all: $libgcov_a"
686 # These libraries are not always built.
687 if [ "$libunwind_a" ]; then
689 echo "$libunwind_a: stmp-dirs"
690 echo " -rm -f $libunwind_a"
691 echo ' $(AR_CREATE_FOR_TARGET)' $libunwind_a '$(objects)'
692 echo ' $(RANLIB_FOR_TARGET)' $libunwind_a
693 echo "all: $libunwind_a"
696 if [ "$libgcc_eh_a" ]; then
698 echo "${dir}/libgcc_eh.a: stmp-dirs"
699 echo " -rm -f ${dir}/libgcc_eh.a"
700 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a
'$(objects)'
701 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
702 echo "all: $libgcc_eh_a"
706 if [ "$libgcc_s_so" ]; then
708 echo "$libgcc_s_so: stmp-dirs $libunwind_so"
709 echo " $SHLIB_LINK" \
710 |
sed -e "s%@multilib_flags@%$flags%g" \
711 -e "s%@multilib_dir@%$dir%g" \
712 -e "s%@shlib_objs@%\$(objects)%g" \
713 -e "s%@shlib_base_name@%libgcc_s%g" \
714 -e "s%@shlib_map_file@%$mapfile%g" \
715 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
716 echo "all: $libgcc_s_so"
719 if [ "$libunwind_so" ]; then
721 echo "$libunwind_so: stmp-dirs"
722 echo " $SHLIBUNWIND_LINK" \
723 |
sed -e "s%@multilib_flags@%$flags%g" \
724 -e "s%@multilib_dir@%$dir%g" \
725 -e "s%@shlib_objs@%\$(objects)%g" \
726 -e "s%@shlib_base_name@%libunwind%g" \
727 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
728 echo "all: $libunwind_so"
731 done # ml in MULTILIBS
734 echo "libgcc-stage-start:"
735 echo " for dir in \$(dirs); do \\"
736 echo " if [ -d \$(stage)/\$\$dir ]; then :; \\"
737 echo " else $mkinstalldirs \$(stage)/\$\$dir; fi; \\"
739 echo " -for dir in \$(dirs); do \\"
740 echo " mv \$\$dir/*${objext} \$(stage)/\$\$dir; \\"
741 echo " mv \$\$dir/*.vis \$(stage)/\$\$dir; \\"
742 echo " mv \$\$dir/*.map \$(stage)/\$\$dir; \\"
743 echo " test ! -f \$\$dir/libgcc.a || mv \$\$dir/lib* \$(stage)/\$\$dir; \\"
748 echo " for d in \$(dirs); do \\"
749 echo " if [ -d \$\$d ]; then true; else $mkinstalldirs \$\$d; fi; \\"
751 echo " if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi"
753 if [ "$need_eh_dummy" ]; then
755 echo " echo 'int __libgcc_eh_dummy;' > \$@"
760 for ml
in $MULTILIBS; do
761 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
762 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
763 if [ $dir != .
]; then
764 ldir
='$(DESTDIR)$(libsubdir)'/$dir
765 echo " if [ -d $ldir ]; then true; else $mkinstalldirs $ldir; chmod a+rx $ldir; fi;"
767 ldir
='$(DESTDIR)$(libsubdir)'
769 echo ' $(INSTALL_DATA)' ${dir}/libgcc.a
${ldir}/
770 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc.a
771 echo ' $(INSTALL_DATA)' ${dir}/libgcov.a
${ldir}/
772 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
774 if [ "$SHLIB_LINK" ]; then
775 echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a
${ldir}/
776 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
779 os_multilib_dir
=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
780 if [ "$os_multilib_dir" != .
]; then
781 shlib_slibdir_qual
="/$os_multilib_dir"
783 echo " $SHLIB_INSTALL" \
784 |
sed -e "s%@multilib_dir@%$dir%g" \
785 -e "s%@shlib_base_name@%libgcc_s%g" \
786 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
787 if [ "$LIBUNWIND" ]; then
788 echo " $SHLIBUNWIND_INSTALL" \
789 |
sed -e "s%@multilib_dir@%$dir%g" \
790 -e "s%@shlib_base_name@%libunwind%g" \
791 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
792 libunwinddir
='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
793 echo ' $(INSTALL_DATA)' ${dir}/libunwind.a
${libunwinddir}/
794 echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
798 for f
in $EXTRA_MULTILIB_PARTS; do
799 for ml
in $MULTILIBS; do
800 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
801 if [ $dir != .
]; then
803 ldir
='$(DESTDIR)$(libsubdir)'/$dir
806 ldir
='$(DESTDIR)$(libsubdir)'
808 echo ' $(INSTALL_DATA)' $out $ldir/
812 echo '.PHONY: all install'