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
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 if [ "$FPBIT" ]; then
317 for name
in $FPBIT_FUNCS; do
318 if [ "$libgcc_s_so" ]; then
319 out
="libgcc/${dir}/${name}${objext}"
320 outS
="libgcc/${dir}/${name}_s${objext}"
322 echo $outS: $FPBIT $fpbit_c_dep
323 echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
326 echo $out: $FPBIT $fpbit_c_dep
327 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
328 '$(vis_hide)' -c $FPBIT -o $out
331 echo $libgcc_s_so: $outS
332 if [ "$SHLIB_MKMAP" ]; then
333 echo libgcc
/${dir}/libgcc.map
: $outS
336 out
="libgcc/${dir}/${name}${objext}"
337 echo $out: $FPBIT $fpbit_c_dep
338 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
346 if [ "$DPBIT" ]; then
347 for name
in $DPBIT_FUNCS; do
348 if [ "$libgcc_s_so" ]; then
349 out
="libgcc/${dir}/${name}${objext}"
350 outS
="libgcc/${dir}/${name}_s${objext}"
352 echo $outS: $DPBIT $fpbit_c_dep
353 echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
356 echo $out: $DPBIT $fpbit_c_dep
357 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
358 '$(vis_hide)' -c $DPBIT -o $out
361 echo $libgcc_s_so: $outS
362 if [ "$SHLIB_MKMAP" ]; then
363 echo libgcc
/${dir}/libgcc.map
: $outS
366 out
="libgcc/${dir}/${name}${objext}"
367 echo $out: $DPBIT $fpbit_c_dep
368 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
376 if [ "$TPBIT" ]; then
377 for name
in $TPBIT_FUNCS; do
378 if [ "$libgcc_s_so" ]; then
379 out
="libgcc/${dir}/${name}${objext}"
380 outS
="libgcc/${dir}/${name}_s${objext}"
382 echo $outS: $TPBIT $fpbit_c_dep
383 echo " $gcc_s_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
386 echo $out: $TPBIT $fpbit_c_dep
387 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
388 '$(vis_hide)' -c $TPBIT -o $out
391 echo $libgcc_s_so: $outS
392 if [ "$SHLIB_MKMAP" ]; then
393 echo libgcc
/${dir}/libgcc.map
: $outS
396 out
="libgcc/${dir}/${name}${objext}"
397 echo $out: $TPBIT $fpbit_c_dep
398 echo " $gcc_compile" -DFINE_GRAINED_LIBRARIES $flags -DL$name \
406 for file in $LIB2ADD; do
407 name
=`echo $file | sed -e 's/[.][cS]$//' -e 's/[.]asm$//'`
408 oname
=`echo $name | sed -e 's,.*/,,'`
410 if [ "$libgcc_s_so" ]; then
411 out
="libgcc/${dir}/${oname}${objext}"
412 outS
="libgcc/${dir}/${oname}_s${objext}"
416 echo $outS: stmp-dirs
$file $libgcc_dep
417 echo " $gcc_s_compile" $flags -c $file -o $outS
419 echo $out: stmp-dirs
$file $libgcc_dep
420 echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
424 outV
="libgcc/${dir}/${oname}.vis"
426 echo $outS: stmp-dirs
$file $libgcc_dep
427 echo " $gcc_s_compile" $flags -xassembler-with-cpp \
430 echo $out: stmp-dirs
$file $libgcc_dep $outV
431 echo " $gcc_compile" $flags -xassembler-with-cpp \
432 -include $outV -c $file -o $out
433 echo "${outV}: ${outS}; \$(gen-hide-list)"
437 echo "Unhandled extension: $file" >&2
443 echo $libgcc_s_so: $outS
444 if [ "$SHLIB_MKMAP" ]; then
445 echo libgcc
/${dir}/libgcc.map
: $outS
448 out
="libgcc/${dir}/${oname}${objext}"
451 echo $out: stmp-dirs
$file $libgcc_dep
452 echo " $gcc_compile" $flags -c $file -o $out
456 echo $out: stmp-dirs
$file $libgcc_dep
457 echo " $gcc_compile" $flags -xassembler-with-cpp \
462 echo "Unhandled extension: $file" >&2
472 for file in $LIB2ADD_ST; do
473 name
=`echo $file | sed -e 's/[.][cSo]$//' -e 's/[.]asm$//'`
474 oname
=`echo $name | sed -e 's,.*/,,'`
475 out
="libgcc/${dir}/${oname}${objext}"
479 echo $out: stmp-dirs
$file $libgcc_dep
480 echo " $gcc_compile" $flags '$(vis_hide)' -c $file -o $out
484 # We may have to compile it twice in order to establish the list
485 # of symbols to be marked hidden.
486 if [ "$libgcc_so" ]; then
487 outV
="libgcc/${dir}/${oname}.vis"
488 outT
="libgcc/${dir}/${oname}_t${objext}"
489 echo ${outT}: stmp-dirs
$file $libgcc_dep
490 echo " $gcc_compile" $flags -xassembler-with-cpp \
492 echo $out: stmp-dirs
$file $libgcc_dep $outV
493 echo " $gcc_compile" $flags -xassembler-with-cpp \
494 -include $outV -c $file -o $out
495 echo "${outV}: ${outT}; \$(gen-hide-list)"
497 echo $out: stmp-dirs
$file $libgcc_dep
498 echo " $gcc_compile" $flags -xassembler-with-cpp \
504 echo "Unhandled extension: $file" >&2
511 # If we don't have libgcc_eh.a, only LIB2ADDEH matters. If we do, only
512 # LIB2ADDEHSTATIC and LIB2ADDEHSHARED matter. (Usually all three are
513 # identical.) We do _not_ handle assembly files in this context.
515 if [ "$libgcc_eh_a" ]; then
516 for file in $LIB2ADDEHSTATIC; do
519 *) echo "Unhandled extension: $file">&2; exit 1 ;;
522 name
=`echo $file | sed -e 's/[.]c$//'`
523 oname
=`echo $name | sed -e 's,.*/,,'`
524 out
="libgcc/${dir}/${oname}${objext}"
526 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
527 echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
528 echo $libgcc_eh_a: $out
531 for file in $LIB2ADDEHSHARED; do
534 *) echo "Unhandled extension: $file">&2; exit 1 ;;
537 name
=`echo $file | sed -e 's/[.]c$//'`
538 oname
=`echo $name | sed -e 's,.*/,,'`
539 outS
="libgcc/${dir}/${oname}_s${objext}"
541 echo $outS: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
542 echo " $gcc_s_compile" $flags -fexceptions -c $file -o $outS
543 echo $libgcc_s_so: $outS
544 if [ "$SHLIB_MKMAP" ]; then
545 echo libgcc
/${dir}/libgcc.map
: $outS
549 # If nothing went into libgcc_eh.a, create a dummy object -
550 # some linkers don't like totally empty archives.
551 if [ -z "$LIB2ADDEHSTATIC" ]; then
553 out
="libgcc/${dir}/eh_dummy${objext}"
556 echo $out: stmp-dirs
$file
557 echo " $gcc_compile" $flags '$(vis_hide)' -fexceptions -c $file -o $out
558 echo $libgcc_eh_a: $out
562 else # no libgcc_eh.a
563 for file in $LIB2ADDEH; do
566 *) echo "Unhandled extension: $file">&2; exit 1 ;;
569 name
=`echo $file | sed -e 's/[.]c$//'`
570 oname
=`echo $name | sed -e 's,.*/,,'`
571 out
="libgcc/${dir}/${oname}${objext}"
573 echo $out: stmp-dirs
$file $LIB2ADDEHDEP $libgcc_dep
574 echo " $gcc_compile" $flags -fexceptions '$(vis_hide)' -c $file -o $out
579 # Again, this does not handle assembly.
580 if [ "$LIBUNWIND" ]; then
581 for file in $LIBUNWIND; do
584 *) echo "Unhandled extension: $file">&2; exit 1 ;;
587 name
=`echo $file | sed -e 's/[.]c$//'`
588 oname
=`echo $name | sed -e 's,.*/,,'`
590 if [ "$libunwind_so" ]; then
591 out
="libgcc/${dir}/${oname}${objext}"
592 outS
="libgcc/${dir}/${oname}_s${objext}"
594 echo $out: stmp-dirs
$file $LIBUNWINDDEP
595 echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
597 echo $outS: stmp-dirs
$file $LIBUNWINDDEP
598 echo " $gcc_s_compile $flags -fexceptions -c $file -o $outS"
600 echo $libunwind_a: $out
601 echo $libunwind_so: $outS
603 out
="libgcc/${dir}/${oname}${objext}"
604 echo $out: stmp-dirs
$file $LIBUNWINDDEP
605 echo " $gcc_compile $flags -fexceptions \$(vis_hide) -c $file -o $out"
606 echo $libunwind_a: $out
612 # build libgcov components
614 for name
in $LIBGCOV; do
615 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
616 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
617 out
="libgcc/${dir}/${name}${objext}"
619 echo $out: $libgcov_c_dep
620 echo " $gcc_compile $flags -DL$name -c \$(srcdir)/libgcov.c -o $out"
621 echo $libgcov_a: $out
624 # EXTRA_MULTILIB_PARTS.
625 if [ -n "$EXTRA_MULTILIB_PARTS" ]; then
626 # Each of the EXTRA_MULTILIB_PARTS is built by recursive invocation
627 # of the parent Makefile. We must do this just once for each
628 # multilib, passing it all the EXTRA_MULTILIB_PARTS as
629 # simultaneous goal targets, so that rules which cannot execute
630 # simultaneously are properly serialized.
634 for f
in $EXTRA_MULTILIB_PARTS; do
637 *) out
=$dir/$f ; t
=$dir/ ;;
640 # Prevent `make' from interpreting $out as a macro assignment
641 *'$(EQ)'*) targ
="T_TARGET=$out T_TARGET" ;;
647 if [ "$dir" = .
]; then
650 suffix
=`echo $dir | sed s,/,_,g`
652 echo extra
$suffix: stmp-dirs
653 echo " $make_compile" \\
654 echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\
655 echo ' MULTILIB_CFLAGS="'$flags'"' T
=$t $extra
656 echo "all: extra$suffix"
658 # Make libunwind.so and libgcc_s.so depend on these, since they
659 # are likely to be implicitly used by the link process.
660 if [ "$libgcc_s_so" ]; then
661 echo "$libgcc_s_so: extra$suffix"
663 if [ "$libunwind_so" ]; then
664 echo "$libunwind_so: extra$suffix"
668 # Library build rules.
669 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
670 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
672 # Map-file generation.
673 if [ "$SHLIB_LINK" -a "$SHLIB_MKMAP" ]; then
674 mapfile
="libgcc/${dir}/libgcc.map"
675 tmpmapfile
="libgcc/${dir}/tmp-libgcc.map"
676 # This uses a here document instead of echos because some shells
677 # will convert the \1 in the second sed command to a control-A.
678 # The behavior of here documents is more predictable.
681 ${mapfile}: $SHLIB_MKMAP $SHLIB_MAPFILES
682 { \$(NM_FOR_TARGET) $SHLIB_NM_FLAGS \$(objects); echo %%; \\
683 cat $SHLIB_MAPFILES \\
684 | sed -e '/^[ ]*#/d' \\
685 -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \\
686 | $gcc_compile $flags -E -xassembler-with-cpp -; \\
687 } | \$(AWK) -f $SHLIB_MKMAP $SHLIB_MKMAP_OPTS > ${tmpmapfile}
689 $libgcc_s_so: ${mapfile}
695 # Each of these .a files depends on stmp-dirs. It would seem that
696 # this dependency is redundant, since each of the object files
697 # itself depends on stmp-dirs. However, it is possible that there
698 # are in fact no object files. In that case, the stmp-dirs
699 # dependency is required; the directory containing the archive must
700 # exist before the archive itself can be created.
702 echo "$libgcc_a: stmp-dirs"
703 echo " -rm -f $libgcc_a"
704 echo ' $(AR_CREATE_FOR_TARGET)' $libgcc_a '$(objects)'
705 echo ' $(RANLIB_FOR_TARGET)' $libgcc_a
706 echo "all: $libgcc_a"
709 echo "$libgcov_a: stmp-dirs"
710 echo " -rm -f $libgcov_a"
711 echo ' $(AR_CREATE_FOR_TARGET)' $libgcov_a '$(objects)'
712 echo ' $(RANLIB_FOR_TARGET)' $libgcov_a
713 echo "all: $libgcov_a"
715 # These libraries are not always built.
716 if [ "$libunwind_a" ]; then
718 echo "$libunwind_a: stmp-dirs"
719 echo " -rm -f $libunwind_a"
720 echo ' $(AR_CREATE_FOR_TARGET)' $libunwind_a '$(objects)'
721 echo ' $(RANLIB_FOR_TARGET)' $libunwind_a
722 echo "all: $libunwind_a"
725 if [ "$libgcc_eh_a" ]; then
727 echo "${dir}/libgcc_eh.a: stmp-dirs"
728 echo " -rm -f ${dir}/libgcc_eh.a"
729 echo ' $(AR_CREATE_FOR_TARGET)' ${dir}/libgcc_eh.a
'$(objects)'
730 echo ' $(RANLIB_FOR_TARGET)' ${dir}/libgcc_eh.a
731 echo "all: $libgcc_eh_a"
735 if [ "$libgcc_s_so" ]; then
737 echo "$libgcc_s_so: stmp-dirs $libunwind_so"
738 echo " $SHLIB_LINK" \
739 |
sed -e "s%@multilib_flags@%$flags%g" \
740 -e "s%@multilib_dir@%$dir%g" \
741 -e "s%@shlib_objs@%\$(objects)%g" \
742 -e "s%@shlib_base_name@%libgcc_s%g" \
743 -e "s%@shlib_map_file@%$mapfile%g" \
744 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
745 echo "all: $libgcc_s_so"
748 if [ "$libunwind_so" ]; then
750 echo "$libunwind_so: stmp-dirs"
751 echo " $SHLIBUNWIND_LINK" \
752 |
sed -e "s%@multilib_flags@%$flags%g" \
753 -e "s%@multilib_dir@%$dir%g" \
754 -e "s%@shlib_objs@%\$(objects)%g" \
755 -e "s%@shlib_base_name@%libunwind%g" \
756 -e "s%@shlib_slibdir_qual@%$shlib_dir_qual%g"
757 echo "all: $libunwind_so"
760 done # ml in MULTILIBS
763 echo "libgcc-stage-start:"
764 echo " for dir in \$(dirs); do \\"
765 echo " if [ -d \$(stage)/\$\$dir ]; then :; \\"
766 echo " else $mkinstalldirs \$(stage)/\$\$dir; fi; \\"
768 echo " -for dir in \$(dirs); do \\"
769 echo " mv \$\$dir/*${objext} \$(stage)/\$\$dir; \\"
770 echo " mv \$\$dir/*.vis \$(stage)/\$\$dir; \\"
771 echo " mv \$\$dir/*.map \$(stage)/\$\$dir; \\"
772 echo " test ! -f \$\$dir/libgcc.a || mv \$\$dir/lib* \$(stage)/\$\$dir; \\"
777 echo " for d in \$(dirs); do \\"
778 echo " if [ -d \$\$d ]; then true; else $mkinstalldirs \$\$d; fi; \\"
780 echo " if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi"
782 if [ "$need_eh_dummy" ]; then
784 echo " echo 'struct eh_dummy;' > \$@"
789 for ml
in $MULTILIBS; do
790 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
791 flags
=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
792 if [ $dir != .
]; then
793 ldir
='$(DESTDIR)$(libsubdir)'/$dir
794 echo " if [ -d $ldir ]; then true; else $mkinstalldirs $ldir; chmod a+rx $ldir; fi;"
796 ldir
='$(DESTDIR)$(libsubdir)'
798 echo ' $(INSTALL_DATA)' ${dir}/libgcc.a
${ldir}/
799 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc.a
800 echo ' $(INSTALL_DATA)' ${dir}/libgcov.a
${ldir}/
801 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcov.a
803 if [ "$SHLIB_LINK" ]; then
804 echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a
${ldir}/
805 echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
808 os_multilib_dir
=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
809 if [ "$os_multilib_dir" != .
]; then
810 shlib_slibdir_qual
="/$os_multilib_dir"
812 echo " $SHLIB_INSTALL" \
813 |
sed -e "s%@multilib_dir@%$dir%g" \
814 -e "s%@shlib_base_name@%libgcc_s%g" \
815 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
816 if [ "$LIBUNWIND" ]; then
817 echo " $SHLIBUNWIND_INSTALL" \
818 |
sed -e "s%@multilib_dir@%$dir%g" \
819 -e "s%@shlib_base_name@%libunwind%g" \
820 -e "s%@shlib_slibdir_qual@%$shlib_slibdir_qual%g"
821 libunwinddir
='$(DESTDIR)$(slibdir)$(shlib_slibdir_qual)/$(shlib_dir)'
822 echo ' $(INSTALL_DATA)' ${dir}/libunwind.a
${libunwinddir}/
823 echo ' $(RANLIB_FOR_TARGET)' ${libunwinddir}/libunwind.a
827 for f
in $EXTRA_MULTILIB_PARTS; do
828 for ml
in $MULTILIBS; do
829 dir
=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'`
830 if [ $dir != .
]; then
832 ldir
='$(DESTDIR)$(libsubdir)'/$dir
835 ldir
='$(DESTDIR)$(libsubdir)'
837 echo ' $(INSTALL_DATA)' $out $ldir/
841 echo '.PHONY: all install'