2 # Construct makefile for libgcc.
3 # Copyright (C) 2000, 2002, 2003 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
44 # Make needs VPATH to be literal.
45 echo 'srcdir = @srcdir@'
46 echo 'VPATH = @srcdir@'
48 echo 'objects = $(filter %'$objext',$^)'
50 echo '# Dependencies are accumulated as we go.'
55 # Library members defined in libgcc2.c.
56 lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3
57 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi
58 _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi
59 _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf _clear_cache
60 _enable_execute_stack _trampoline __main _absvsi2 _absvdi2 _addvsi3
61 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2 _ctors
62 _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab
63 _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2
64 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3
67 # Disable SHLIB_LINK if shared libgcc not enabled.
68 if [ "@enable_shared@" = "no" ]; then
74 gcc_compile='$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES)'
75 make_compile='$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
76 AR_FOR_TARGET="$(AR_FOR_TARGET)" \
77 AR_CREATE_FOR_TARGET="$(AR_CREATE_FOR_TARGET)" \
78 AR_EXTRACT_FOR_TARGET="$(AR_EXTRACT_FOR_TARGET)" \
79 AR_FLAGS_FOR_TARGET="$(AR_FLAGS_FOR_TARGET)" \
80 CC="$(CC)" CFLAGS="$(CFLAGS)" \
81 BUILD_PREFIX="$(BUILD_PREFIX)" \
82 BUILD_PREFIX_1="$(BUILD_PREFIX_1)" \
83 LANGUAGES="$(LANGUAGES)"'
85 # Generic dependencies for libgcc
86 libgcc_dep='$(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h'
88 # Dependencies for libgcc2.c
89 libgcc2_c_dep='stmp-dirs $(srcdir)/libgcc2.c $(srcdir)/libgcc2.h gbl-ctors.h'" $libgcc_dep"
91 # Dependencies for libgcov.c
92 libgcov_c_dep='stmp-dirs $(srcdir)/libgcov.c $(srcdir)/gcov-io.h $(srcdir)/gcov-io.c gcov-iov.h'" $libgcc_dep"
94 # Dependencies for fp-bit.c
95 fpbit_c_dep='stmp-dirs config.status tsystem.h'
97 if [ "$SHLIB_LINK" ]; then
98 # Test -fvisibility=hidden. We need both a -fvisibility=hidden on
99 # the command line, and a #define to prevent libgcc2.h etc from
100 # overriding that with #pragmas. The dance with @ is to prevent
101 # echo from seeing anything it might take for an option.
102 # echo turns the \$\$\$\$ into $$$$ and when make sees it it
103 # becomes $$ and the shell substitutes the pid. Makes for a
104 # slightly safer temp file.
105 echo "vis_hide := \$(strip \$(subst @,-,\\"
106 echo " \$(shell if echo 'void foo(void); void foo(void) {}' | \\"
107 echo " $gcc_compile -fvisibility=hidden -Werror \\"
108 echo " -c -xc - -o vis_temp_file\$\$\$\$.o 2> /dev/null; \\"
109 echo " then echo @fvisibility=hidden @DHIDE_EXPORTS; \\"
110 echo " rm vis_temp_file\$\$\$\$.o 2> /dev/null; \\"
114 # If we have -fvisibility=hidden, then we need to generate hide
115 # lists for object files implemented in assembly. The default
116 # pseudo-op for this is ".hidden", but can be overridden with
118 [ "$ASM_HIDDEN_OP" ] || ASM_HIDDEN_OP=".hidden"
120 echo "ifneq (,\$(vis_hide))"
121 echo "define gen-hide-list"
122 echo "\$(NM_FOR_TARGET) ${SHLIB_NM_FLAGS} \$< | \\"
123 # non-GNU nm emits three fields even for undefined and typeless symbols,
124 # so explicitly omit them
125 echo " \$(AWK) 'NF == 3 && \$\$2 !~ /^[UN]\$\$/ { print \"\\t${ASM_HIDDEN_OP}\", \$\$3 }' > \$@T"
126 echo "mv -f \$@T \$@"
129 echo "gen-hide-list = echo > \$@"
133 # It is too hard to guarantee that vis_hide and gen-hide-list will never
134 # be referenced if SHLIB_LINK is not set, so set them to the values they'd
135 # have if SHLIB_LINK were set and we didn't have visibility support.
137 echo "gen-hide-list = echo > \$@"
140 # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
141 # defined as optimized assembly code in LIB1ASMFUNCS.
142 for name in $LIB1ASMFUNCS; do
143 lib2funcs=`echo $lib2funcs | sed -e 's/^'$name' //' \
144 -e 's/ '$name' / /' \
146 LIB2_DIVMOD_FUNCS=`echo $LIB2_DIVMOD_FUNCS | sed -e 's/^'$name' //' \
147 -e 's/ '$name' / /' \
152 # Rules to generate object files.
155 for ml in $MULTILIBS; do
157 # Work out relevant parameters that depend only on the multilib.
158 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
159 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
161 libgcc_a=$dir/libgcc.a
162 libgcov_a=$dir/libgcov.a
168 if [ "$LIBUNWIND" ]; then
169 libunwind_a=$dir/libunwind.a
171 if [ "$SHLIB_LINK" ]; then
172 libgcc_eh_a=$dir/libgcc_eh.a
173 libgcc_s_so=$dir/libgcc_s${SHLIB_EXT}
174 if [ "$LIBUNWIND" ]; then
175 libunwind_so=$dir/libunwind${SHLIB_EXT}
177 os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
178 if [ "$os_multilib_dir" != . ]; then
179 shlib_slibdir_qual="/$os_multilib_dir"
190 echo \# flags: $flags
191 echo \# libgcc_a: $libgcc_a
192 echo \# libgcov_a: $libgcov_a
193 echo \# libgcc_eh_a: $libgcc_eh_a
194 echo \# libunwind_a: $libunwind_a
196 echo \# shlib_slibdir_qual: $shlib_slibdir_qual
197 echo \# libgcc_s_so: $libgcc_s_so
198 echo \# libunwind_so: $libunwind_so
202 # Update list of directories.
203 if [ $dir != . ]; then
204 echo "dirs += ${dir} libgcc/${dir}"
209 # Build libgcc1 components.
211 for name in $LIB1ASMFUNCS; do
212 if [ "$libgcc_s_so" ]; then
213 out="libgcc/${dir}/${name}${objext}"
214 outS="libgcc/${dir}/${name}_s${objext}"
215 outV="libgcc/${dir}/${name}.vis"
217 echo ${outS}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
218 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
219 -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $outS
221 echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)' ${outV}
222 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
223 -c '$(srcdir)/config/$(LIB1ASMSRC)' -include $outV -o $out
225 echo "${outV}: ${outS}; \$(gen-hide-list)"
228 echo $libgcc_s_so: $outS
229 if [ "$SHLIB_MKMAP" ]; then
230 echo libgcc/${dir}/libgcc.map: $outS
233 out="libgcc/${dir}/${name}${objext}"
234 echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
235 echo " $gcc_compile" $flags -DL$name -xassembler-with-cpp \
236 -c '$(srcdir)/config/$(LIB1ASMSRC)' -o $out
242 # Build libgcc2 components.
245 for name in $lib2funcs; do
246 if [ "$libgcc_s_so" ]; then
247 out="libgcc/${dir}/${name}${objext}"
248 outS="libgcc/${dir}/${name}_s${objext}"
250 echo $outS: $libgcc2_c_dep
251 echo " $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $outS
253 echo $out: $libgcc2_c_dep
254 echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
255 -c '$(srcdir)/libgcc2.c' -o $out
258 echo $libgcc_s_so: $outS
259 if [ "$SHLIB_MKMAP" ]; then
260 echo libgcc/${dir}/libgcc.map: $outS
263 out="libgcc/${dir}/${name}${objext}"
264 echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
265 echo " $gcc_compile" $flags -DL$name -c '$(srcdir)/libgcc2.c' -o $out
270 for name in $LIB2FUNCS_ST; do
271 out="libgcc/${dir}/${name}${objext}"
273 echo $out: $libgcc2_c_dep
274 echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
275 -c '$(srcdir)/libgcc2.c' -o $out
276 echo ${dir}/libgcc.a: $out
279 for name in $LIB2_DIVMOD_FUNCS; do
280 if [ "$libgcc_s_so" ]; then
281 out="libgcc/${dir}/${name}${objext}"
282 outS="libgcc/${dir}/${name}_s${objext}"
284 echo $outS: $libgcc2_c_dep
285 echo " $gcc_compile" $flags -DL$name \
286 -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $outS
288 echo $out: $libgcc2_c_dep
289 echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
290 -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
293 echo $libgcc_s_so: $outS
294 if [ "$SHLIB_MKMAP" ]; then
295 echo libgcc/${dir}/libgcc.map: $outS
298 out="libgcc/${dir}/${name}${objext}"
299 echo ${out}: stmp-dirs '$(srcdir)/config/$(LIB1ASMSRC)'
300 echo " $gcc_compile" $flags -DL$name \
301 -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
307 # Build software floating point functions.
310 if [ "$FPBIT" ]; then
311 for name in $FPBIT_FUNCS; do
312 if [ "$libgcc_s_so" ]; then
313 out="libgcc/${dir}/${name}${objext}"
314 outS="libgcc/${dir}/${name}_s${objext}"
316 echo $outS: $FPBIT $fpbit_c_dep
317 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
320 echo $out: $FPBIT $fpbit_c_dep
321 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
322 '$(vis_hide)' -c $FPBIT -o $out
325 echo $libgcc_s_so: $outS
326 if [ "$SHLIB_MKMAP" ]; then
327 echo libgcc/${dir}/libgcc.map: $outS
330 out="libgcc/${dir}/${name}${objext}"
331 echo $out: $FPBIT $fpbit_c_dep
332 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
340 if [ "$DPBIT" ]; then
341 for name in $DPBIT_FUNCS; do
342 if [ "$libgcc_s_so" ]; then
343 out="libgcc/${dir}/${name}${objext}"
344 outS="libgcc/${dir}/${name}_s${objext}"
346 echo $outS: $DPBIT $fpbit_c_dep
347 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
350 echo $out: $DPBIT $fpbit_c_dep
351 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
352 '$(vis_hide)' -c $DPBIT -o $out
355 echo $libgcc_s_so: $outS
356 if [ "$SHLIB_MKMAP" ]; then
357 echo libgcc/${dir}/libgcc.map: $outS
360 out="libgcc/${dir}/${name}${objext}"
361 echo $out: $DPBIT $fpbit_c_dep
362 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
370 if [ "$TPBIT" ]; then
371 for name in $TPBIT_FUNCS; do
372 if [ "$libgcc_s_so" ]; then
373 out="libgcc/${dir}/${name}${objext}"
374 outS="libgcc/${dir}/${name}_s${objext}"
376 echo $outS: $TPBIT $fpbit_c_dep
377 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
380 echo $out: $TPBIT $fpbit_c_dep
381 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
382 '$(vis_hide)' -c $TPBIT -o $out
385 echo $libgcc_s_so: $outS
386 if [ "$SHLIB_MKMAP" ]; then
387 echo libgcc/${dir}/libgcc.map: $outS
390 out="libgcc/${dir}/${name}${objext}"
391 echo $out: $TPBIT $fpbit_c_dep
392 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
400 for file in $LIB2ADD; do
401 name=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`
402 oname=`echo $name | sed -e 's,.*/,,'`
404 if [ "$libgcc_s_so" ]; then
405 out="libgcc/${dir}/${oname}${objext}"
406 outS="libgcc/${dir}/${oname}_s${objext}"
410 echo $outS: stmp-dirs $file $libgcc_dep
411 echo " $gcc_compile" $flags -c $file -o $outS
413 echo $out: stmp-dirs $file $libgcc_dep
414 echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
418 outV="libgcc/${dir}/${oname}.vis"
420 echo $outS: stmp-dirs $file $libgcc_dep
421 echo " $gcc_compile" $flags -xassembler-with-cpp \
424 echo $out: stmp-dirs $file $libgcc_dep $outV
425 echo " $gcc_compile" $flags -xassembler-with-cpp \
426 -include $outV -c $file -o $out
427 echo "${outV}: ${outS}; \$(gen-hide-list)"
431 echo "Unhandled extension: $file" >&2
437 echo $libgcc_s_so: $outS
438 if [ "$SHLIB_MKMAP" ]; then
439 echo libgcc/${dir}/libgcc.map: $outS
442 out="libgcc/${dir}/${oname}${objext}"
445 echo $out: stmp-dirs $file $libgcc_dep
446 echo " $gcc_compile" $flags -c $file -o $out
450 echo $out: stmp-dirs $file $libgcc_dep
451 echo " $gcc_compile" $flags -xassembler-with-cpp \
456 echo "Unhandled extension: $file" >&2
466 for file in $LIB2ADD_ST; do
467 name=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
468 oname=`echo $name | sed -e 's,.*/,,'`
469 out="libgcc/${dir}/${oname}${objext}"
473 echo $out: stmp-dirs $file $libgcc_dep
474 echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
478 # We may have to compile it twice in order to establish the list
479 # of symbols to be marked hidden.
480 if [ "$libgcc_so" ]; then
481 outV="libgcc/${dir}/${oname}.vis"
482 outT="libgcc/${dir}/${oname}_t${objext}"
483 echo ${outT}: stmp-dirs $file $libgcc_dep
484 echo " $gcc_compile" $flags -xassembler-with-cpp \
486 echo $out: stmp-dirs $file $libgcc_dep $outV
487 echo " $gcc_compile" $flags -xassembler-with-cpp \
488 -include $outV -c $file -o $out
489 echo "${outV}: ${outT}; \$(gen-hide-list)"
491 echo $out: stmp-dirs $file $libgcc_dep
492 echo " $gcc_compile" $flags -xassembler-with-cpp \
498 echo "Unhandled extension: $file" >&2
505 # If we don't have libgcc_eh.a, only LIB2ADDEH matters. If we do, only
506 # LIB2ADDEHSTATIC and LIB2ADDEHSHARED matter. (Usually all three are
507 # identical.) We do _not_ handle assembly files in this context.
509 if [ "$libgcc_eh_a" ]; then
510 for file in $LIB2ADDEHSTATIC; do
513 *) echo "Unhandled extension: $file">&2; exit 1 ;;
516 name=`echo $file | sed -e 's/[.]c$//'`
517 oname=`echo $name | sed -e 's,.*/,,'`
518 out="libgcc/${dir}/${oname}${objext}"
520 echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
521 echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
522 echo $libgcc_eh_a: $out
525 for file in $LIB2ADDEHSHARED; do
528 *) echo "Unhandled extension: $file">&2; exit 1 ;;
531 name=`echo $file | sed -e 's/[.]c$//'`
532 oname=`echo $name | sed -e 's,.*/,,'`
533 out="libgcc/${dir}/${oname}_s${objext}"
535 echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
536 echo " $gcc_compile" $flags -fexceptions -c $file -o $out
537 echo $libgcc_s_so: $out
538 if [ "$SHLIB_MKMAP" ]; then
539 echo libgcc/${dir}/libgcc.map: $out
543 else # no libgcc_eh.a
544 for file in $LIB2ADDEH; do
547 *) echo "Unhandled extension: $file">&2; exit 1 ;;
550 name=`echo $file | sed -e 's/[.]c$//'`
551 oname=`echo $name | sed -e 's,.*/,,'`
552 out="libgcc/${dir}/${oname}${objext}"
554 echo $out: stmp-dirs $file $LIB2ADDEHDEP $libgcc_dep
555 echo " $gcc_compile" $flags -fexceptions '$(vis_hide)' -c $file -o $out
560 # Again, this does not handle assembly.
561 if [ "$LIBUNWIND" ]; then
562 for file in $LIBUNWIND; do
565 *) echo "Unhandled extension: $file">&2; exit 1 ;;
568 name=`echo $file | sed -e 's/[.]c$//'`
569 oname=`echo $name | sed -e 's,.*/,,'`
571 if [ "$libunwind_so" ]; then
572 out="libgcc/${dir}/${oname}${objext}"
573 outS="libgcc/${dir}/${oname}_s${objext}"
575 echo $out: stmp-dirs $file $LIBUNWINDDEP
576 echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
578 echo $outS: stmp-dirs $file $LIBUNWINDDEP
579 echo " $gcc_compile $flags -fexceptions -DSHARED -c $file -o $outS"
581 echo $libunwind_a: $out
582 echo $libunwind_so: $outS
584 out="libgcc/${dir}/${oname}${objext}"
585 echo $out: stmp-dirs $file $LIBUNWINDDEP
586 echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
587 echo $libunwind_a: $out
593 # build libgcov components
595 for name in $LIBGCOV; do
596 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
597 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
598 out="libgcc/${dir}/${name}${objext}"
600 echo $out: $libgcov_c_dep
601 echo " $gcc_compile $flags -DL$name -c \$(srcdir)/libgcov.c -o $out"
602 echo $libgcov_a: $out
605 # EXTRA_MULTILIB_PARTS.
606 if [ -n "$EXTRA_MULTILIB_PARTS" ]; then
607 # Each of the EXTRA_MULTILIB_PARTS is built by recursive invocation
608 # of the parent Makefile. We must do this just once for each
609 # multilib, passing it all the EXTRA_MULTILIB_PARTS as
610 # simultaneous goal targets, so that rules which cannot execute
611 # simultaneously are properly serialized.
615 for f in $EXTRA_MULTILIB_PARTS; do
618 *) out=$dir/$f ; t=$dir/ ;;
621 # Prevent `make' from interpreting $out as a macro assignment
622 *'$(EQ)'*) targ="T_TARGET=$out T_TARGET" ;;
628 if [ "$dir" = . ]; then
631 suffix=`echo $dir | sed s,/,_,g`
633 echo extra$suffix: stmp-dirs
634 echo " $make_compile" \\
635 echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
636 echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $extra
637 echo "all: extra$suffix"
639 # Make libunwind.so and libgcc_s.so depend on these, since they
640 # are likely to be implicitly used by the link process.
641 if [ "$libgcc_s_so" ]; then
642 echo "$libgcc_s_so: extra$suffix"
644 if [ "$libunwind_so" ]; then
645 echo "$libunwind_so: extra$suffix"
649 # Library build rules.
650 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
651 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
653 # Map-file generation.
654 if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
655 mapfile="libgcc/${dir}/libgcc.map"
656 tmpmapfile="libgcc/${dir}/tmp-libgcc.map"
657 # This uses a here document instead of echos because some shells
658 # will convert the \1 in the second sed command to a control-A.
659 # The behavior of here documents is more predictable.
662 ${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES
663 { \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS \$(objects); echo %%; \\
664 cat $SHLIB_MAPFILES \\
665 | sed -e '/^[ ]*#/d' \\
666 -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\
667 | $gcc_compile $flags -E -xassembler-with-cpp -; \\
668 } | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile}
670 $libgcc_s_so: ${mapfile}
676 # Each of these .a files depends on stmp-dirs. It would seem that
677 # this dependency is redundant, since each of the object files
678 # itself depends on stmp-dirs. However, it is possible that there
679 # are in fact no object files. In that case, the stmp-dirs
680 # dependency is required; the directory containing the archive must
681 # exist before the archive itself can be created.
683 echo "$libgcc_a: stmp-dirs"
684 echo " -rm -f $libgcc_a"
685 echo ' $(AR_CREATE_FOR_TARGET)' $libgcc_a '$(objects)'
686 echo ' $(RANLIB_FOR_TARGET)' $libgcc_a
687 echo "all: $libgcc_a"
690 echo "$libgcov_a: stmp-dirs"
691 echo " -rm -f $libgcov_a"
692 echo ' $(AR_CREATE_FOR_TARGET)' $libgcov_a '$(objects)'
693 echo ' $(RANLIB_FOR_TARGET)' $libgcov_a
694 echo "all: $libgcov_a"
696 # These libraries are not always built.
697 if [ "$libunwind_a" ]; then
699 echo "$libunwind_a: stmp-dirs"
700 echo " -rm -f $libunwind_a"
701 echo ' $(AR_CREATE_FOR_TARGET)' $libunwind_a '$(objects)'
702 echo ' $(RANLIB_FOR_TARGET)' $libunwind_a
703 echo "all: $libunwind_a"
706 if [ "$libgcc_eh_a" ]; then
708 echo "${dir}/libgcc_eh.a: stmp-dirs"
709 echo " -rm -f ${dir}/libgcc_eh.a"
710 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a '$(objects)'
711 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
712 echo "all: $libgcc_eh_a"
716 if [ "$libgcc_s_so" ]; then
718 echo "$libgcc_s_so: stmp-dirs $libunwind_so"
719 echo " $SHLIB_LINK" \
720 | sed -e "s%@multilib_flags@%$flags%g" \
721 -e "s%@multilib_dir@%$dir%g" \
722 -e "s%@shlib_objs@%\$(objects)%g" \
723 -e "s%@shlib_base_name@%libgcc_s%g" \
724 -e "s%@shlib_map_file@%$mapfile%g" \
725 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
726 echo "all: $libgcc_s_so"
729 if [ "$libunwind_so" ]; then
731 echo "$libunwind_so: stmp-dirs"
732 echo " $SHLIBUNWIND_LINK" \
733 | sed -e "s%@multilib_flags@%$flags%g" \
734 -e "s%@multilib_dir@%$dir%g" \
735 -e "s%@shlib_objs@%\$(objects)%g" \
736 -e "s%@shlib_base_name@%libunwind%g" \
737 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
738 echo "all: $libunwind_so"
741 done # ml in MULTILIBS
744 echo "libgcc-stage-start:"
745 echo " for dir in \$(dirs); do \\"
746 echo " if [ -d \$(stage)/\$\$dir ]; then :; \\"
747 echo " else $mkinstalldirs \$(stage)/\$\$dir; fi; \\"
749 echo " -for dir in \$(dirs); do \\"
750 echo " mv \$\$dir/*${objext} \$(stage)/\$\$dir; \\"
751 echo " mv \$\$dir/*.vis \$(stage)/\$\$dir; \\"
752 echo " mv \$\$dir/*.map \$(stage)/\$\$dir; \\"
753 echo " test ! -f \$\$dir/libgcc.a || mv \$\$dir/lib* \$(stage)/\$\$dir; \\"
758 echo " for d in \$(dirs); do \\"
759 echo " if [ -d \$\$d ]; then true; else $mkinstalldirs \$\$d; fi; \\"
761 echo " if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi"
765 for ml in $MULTILIBS; do
766 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
767 flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
768 if [ $dir != . ]; then
769 ldir='$(DESTDIR)$(libsubdir)'/$dir
770 echo " if [ -d $ldir ]; then true; else $mkinstalldirs $ldir; chmod a+rx $ldir; fi;"
772 ldir='$(DESTDIR)$(libsubdir)'
774 echo ' $(INSTALL_DATA)' ${dir}/libgcc.a ${ldir}/
775 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc.a
776 echo ' $(INSTALL_DATA)' ${dir}/libgcov.a ${ldir}/
777 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
779 if [ "$SHLIB_LINK" ]; then
780 echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
781 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
784 os_multilib_dir=`./xgcc -B./ $flags --print-multi-os-directory`
785 if [ "$os_multilib_dir" != . ]; then
786 shlib_slibdir_qual="/$os_multilib_dir"
788 echo " $SHLIB_INSTALL" \
789 | sed -e "s%@multilib_dir@%$dir%g" \
790 -e "s%@shlib_base_name@%libgcc_s%g" \
791 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
792 if [ "$LIBUNWIND" ]; then
793 echo " $SHLIBUNWIND_INSTALL" \
794 | sed -e "s%@multilib_dir@%$dir%g" \
795 -e "s%@shlib_base_name@%libunwind%g" \
796 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
797 libunwinddir='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
798 echo ' $(INSTALL_DATA)' ${dir}/libunwind.a ${libunwinddir}/
799 echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
803 for f in $EXTRA_MULTILIB_PARTS; do
804 for ml in $MULTILIBS; do
805 dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
806 if [ $dir != . ]; then
808 ldir='$(DESTDIR)$(libsubdir)'/$dir
811 ldir='$(DESTDIR)$(libsubdir)'
813 echo ' $(INSTALL_DATA)' $out $ldir/
817 echo '.PHONY: all install'