OSDN Git Service

PR other/7031
[pf3gnuchains/gcc-fork.git] / gcc / Makefile.in
index 6755643..a9a9065 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile for GNU Compiler Collection
 # Run 'configure' to generate Makefile from Makefile.in
 
-# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+# Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
 # 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 #This file is part of GCC.
@@ -158,7 +158,6 @@ GCC_WARN_CFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
 
 # These files are to have -Werror bypassed in stage2:
 # These are very hard to completely clean due to target complexities.
-varasm.o-warn = -Wno-error
 gcc.o-warn = -Wno-error
 insn-conditions.o-warn = -Wno-error
 # Bison-1.75 output often yields (harmless) -Wtraditional warnings
@@ -636,7 +635,7 @@ PARAMS_H = params.h params.def
 TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h version.h builtins.def \
           input.h
 BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \
-          hard-reg-set.h
+          hard-reg-set.h cfghooks.h
 COVERAGE_H = coverage.h gcov-io.h gcov-iov.h
 DEMANGLE_H = $(srcdir)/../include/demangle.h
 RECOG_H = recog.h
@@ -821,7 +820,7 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o          \
  sibcall.o simplify-rtx.o sreal.o ssa.o ssa-ccp.o ssa-dce.o stmt.o        \
  stor-layout.o stringpool.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
  tree-inline.o unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
- alloc-pool.o et-forest.o cgraph.o cgraphunit.o                                   \
+ alloc-pool.o et-forest.o cgraph.o cgraphunit.o cfghooks.o                \
  $(GGC) $(out_object_file) $(EXTRA_OBJS) $(host_hook_obj)
 
 BACKEND = main.o libbackend.a
@@ -1651,6 +1650,8 @@ flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
 cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \
    $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
    function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h
+cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
+   $(BASIC_BLOCK_H) cfglayout.h
 cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
    insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
    function.h except.h $(GGC_H) $(TM_P_H) insn-config.h
@@ -2832,7 +2833,7 @@ clean: mostlyclean $(INTL_CLEAN) lang.clean
        else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \
          rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \
        fi ; fi
-       -rm -fr stage1 stage2 stage3 stage4
+       -rm -fr stage1 stage2 stage3 stage4 stageprofile stagefeedback
 # Delete stamps of bootstrap stages
        -rm -f stage?_*
        -rm -f clean?_*
@@ -2848,7 +2849,7 @@ distclean: clean $(INTL_DISTCLEAN) lang.distclean
        -rm -f Make-lang Make-hooks Make-host Make-target
        -rm -f Makefile *.oaux
        -rm -f gthr-default.h
-       -rm -f */stage1 */stage2 */stage3 */stage4 */include
+       -rm -f */stage1 */stage2 */stage3 */stage4 */include */stageprofile */stagefeedback
        -rm -f c-parse.output
        -rm -f *.asm
        -rm -f site.exp site.bak testsuite/site.exp testsuite/site.bak
@@ -2989,7 +2990,7 @@ install-common: native $(EXTRA_PARTS) lang.install-common
 # Install gcov if it was compiled.
        -if [ -f gcov$(exeext) ]; \
        then \
-           rm -f $(DESTDIR)$(bindir)/gcov$(exeext); \
+           rm -f $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
            $(INSTALL_PROGRAM) gcov$(exeext) $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext); \
        fi
        $(INSTALL_SCRIPT) gccbug $(DESTDIR)$(bindir)/$(GCCBUG_INSTALL_NAME)
@@ -3229,7 +3230,7 @@ uninstall: intl.uninstall lang.uninstall
 # These targets are for the dejagnu testsuites. The file site.exp
 # contains global variables that all the testsuites will use.
 
-# Set to $(target_alias)/ for cross.
+# Set to $(target_alias).
 target_subdir = @target_subdir@
 
 site.exp: ./config.status Makefile
@@ -3260,9 +3261,10 @@ site.exp: ./config.status Makefile
 # ??? Another way to solve this might be to rely on linker scripts.  Then
 # theoretically the -B won't be needed.
 # We also need to pass -L ../ld so that the linker can find ldscripts.
-       @if [ -d $(objdir)/../$(target_subdir)newlib ] ; then \
-         echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
-         echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)newlib/\"" >> ./tmp0; \
+       @if [ -d $(objdir)/../$(target_subdir)/newlib ] \
+           && [ "${host_canonical}" != "${target}" ]; then \
+         echo "set newlib_cflags \"-I$(objdir)/../$(target_subdir)/newlib/targ-include -I\$$srcdir/../newlib/libc/include\"" >> ./tmp0; \
+         echo "set newlib_ldflags \"-B$(objdir)/../$(target_subdir)/newlib/\"" >> ./tmp0; \
          echo "append CFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
          echo "append CXXFLAGS \" \$$newlib_cflags\"" >> ./tmp0; \
          echo "append LDFLAGS \" \$$newlib_ldflags\"" >> ./tmp0; \
@@ -3379,13 +3381,13 @@ QMTEST_PATH=qmtest
 QMTESTFLAGS=
 
 # The flags to pass to "qmtest run".
-QMTESTRUNFLAGS=
+QMTESTRUNFLAGS=-f none --result-stream dejagnu_stream.DejaGNUStream
 
 # The command to use to invoke qmtest.
 QMTEST=${QMTEST_PATH} ${QMTESTFLAGS}
 
 # The tests (or suites) to run.
-QMTEST_GPP_TESTS=gpp
+QMTEST_GPP_TESTS=g++
 
 # The subdirectory of the OBJDIR that will be used to store the QMTest
 # test database configuration and that will be used for temporary
@@ -3394,48 +3396,32 @@ QMTEST_DIR=qmtestsuite
 
 # Create the QMTest database configuration.
 ${QMTEST_DIR} stamp-qmtest:
-       debug_options=""; \
-           ${STAMP} empty.C; \
-           for option in \
-               -gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff; do \
-               (./cc1plus -q $${option} empty.C 2>&1 | \
-                    grep "unknown or unsupported -g option" > /dev/null) || \
-               debug_options="$${debug_options}$${option} "; done; \
-           ${QMTEST} -D ${QMTEST_DIR} create-tdb \
-               -c gcc_database.GCCDatabase \
-               -a GCCDatabase.testsuite_root=`cd ${srcdir}/testsuite && pwd` \
-               -a GCCDatabase.debug_options="$${debug_options}"
-       rm -f empty.C empty.s
-       $(STAMP) stamp-qmtest
+       ${QMTEST} -D ${QMTEST_DIR} create-tdb \
+           -c gcc_database.GCCDatabase \
+            -a srcdir=`cd ${srcdir}/testsuite && pwd` && \
+           $(STAMP) stamp-qmtest
 
 # Create the QMTest context file.
 ${QMTEST_DIR}/context: stamp-qmtest
-       echo "GCCTest.flags=-B${objdir}" >> $@
-       echo "GCCTest.objdir=${objdir}/.." >> $@
-       echo "GCCTest.host=${host_canonical}" >> $@
-       echo "GCCTest.target=${target}" >> $@
-       echo "GCCTest.gcov=${objdir}/gcov" >> $@
-       echo "GPPTest.gpp=${objdir}/g++" >> $@
-       echo "DGTest.demangler=${objdir}/c++filt" >> $@
+       rm -f $@
+       echo "CompilerTable.languages=c cplusplus" >> $@
+       echo "CompilerTable.c_kind=GCC" >> $@
+       echo "CompilerTable.c_path=${objdir}/xgcc" >> $@
+       echo "CompilerTable.c_options=-B${objdir}/" >> $@
+       echo "CompilerTable.cplusplus_kind=GCC" >> $@
+       echo "CompilerTable.cplusplus_path=${objdir}/g++" >> $@
+       echo "CompilerTable.cplusplus_options=-B${objdir}/" >> $@
+       echo "DejaGNUTest.target=${target_alias}" >> $@
 
 # Run the G++ testsuite using QMTest.
-qmtest-g++: ${QMTEST_DIR}/context ${QMTEST_DIR}/gpp-expected.qmr
+qmtest-g++: ${QMTEST_DIR}/context
        cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
-          -o gpp.qmr -O gpp-expected.qmr \
-          ${QMTEST_GPP_TESTS}
+          -o g++.qmr ${QMTEST_GPP_TESTS}
 
 # Use the QMTest GUI.
 qmtest-gui: ${QMTEST_DIR}/context
        cd ${QMTEST_DIR} && ${QMTEST} gui -C context
 
-# Build the set of expected G++ failures.
-${QMTEST_DIR}/gpp-expected.qmr: ${QMTEST_DIR}/context
-       echo "Determining expected results..."
-       cd ${QMTEST_DIR} && ${QMTEST} run ${QMTESTRUNFLAGS} -C context \
-           -c "GCCTest.generate_xfails=1" -o gpp-expected.qmr \
-          ${QMTEST_GPP_TESTS} \
-          > /dev/null
-
 .PHONY: qmtest-g++
 
 # Run Paranoia on real.c.
@@ -3470,19 +3456,31 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
 # Flags to pass to stage2 and later recursive makes.  Note that the
 # WARN_CFLAGS setting can't be to the expansion of GCC_WARN_CFLAGS in
 # the context of the stage_x rule.
-STAGE2_FLAGS_TO_PASS = \
+
+POSTSTAGE1_FLAGS_TO_PASS = \
        ADAC="\$$(CC)" \
        GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
        CFLAGS="$(BOOT_CFLAGS)" \
        LDFLAGS="$(BOOT_LDFLAGS)" \
        WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
-       WERROR="@WERROR@" \
        STRICT_WARN="$(STRICT2_WARN)" \
        libdir=$(libdir) \
        LANGUAGES="$(LANGUAGES)" \
        MAKEOVERRIDES= \
        OUTPUT_OPTION="-o \$$@"
 
+STAGE2_FLAGS_TO_PASS = \
+       CFLAGS="$(BOOT_CFLAGS)" \
+       WERROR="@WERROR@" \
+
+STAGEPROFILE_FLAGS_TO_PASS = \
+       CFLAGS="$(BOOT_CFLAGS) -fprofile-arcs" 
+
+# Files never linked into the final executable produces warnings about missing
+# profile.
+STAGEFEEDBACK_FLAGS_TO_PASS = \
+       CFLAGS="$(BOOT_CFLAGS) -fbranch-probabilities" 
+
 # Only build the C compiler for stage1, because that is the only one that
 # we can guarantee will build with the native compiler, and also it is the
 # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
@@ -3504,6 +3502,7 @@ stage1_copy: stage1_build
 stage2_build: stage1_copy
        $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
                 STAGE_PREFIX=stage1/ \
+                $(POSTSTAGE1_FLAGS_TO_PASS) \
                 $(STAGE2_FLAGS_TO_PASS)
        $(STAMP) stage2_build
        echo stage2_build > stage_last
@@ -3513,13 +3512,48 @@ stage2_copy: stage2_build
        $(STAMP) stage2_copy
        echo stage3_build > stage_last
 
+stageprofile_build: stage1_copy
+       $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
+                STAGE_PREFIX=stage1/ \
+                $(POSTSTAGE1_FLAGS_TO_PASS) \
+                $(STAGEPROFILE_FLAGS_TO_PASS)
+       $(STAMP) stageprofile_build
+       echo stageprofile_build > stage_last
+
+stageprofile_copy: stageprofile_build
+       $(MAKE) stageprofile
+       $(STAMP) stageprofile_copy
+       echo stagefeedback_build > stage_last
+
 stage3_build: stage2_copy
        $(MAKE) CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage2/xgcc$(exeext) -Bstage2/ -B$(build_tooldir)/bin/" \
                 STAGE_PREFIX=stage2/ \
+                $(POSTSTAGE1_FLAGS_TO_PASS) \
                 $(STAGE2_FLAGS_TO_PASS)
        $(STAMP) stage3_build
        echo stage3_build > stage_last
 
+stagefeedback_build: stageprofile_copy stage1_copy
+       $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
+                STAGE_PREFIX=stage1/ \
+                $(POSTSTAGE1_FLAGS_TO_PASS) \
+                $(STAGEFEEDBACK_FLAGS_TO_PASS)
+       $(STAMP) stagefeedback_build
+       echo stagefeedback_build > stage_last
+
+stagefeedback_copy: stagefeedback_build
+       $(MAKE) stagefeedback
+       $(STAMP) stagefeedback_copy
+       echo stagefeedback2_build > stage_last
+
+stageprofile_build: stage1_copy
+       $(MAKE) CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage1/xgcc$(exeext) -Bstage1/ -B$(build_tooldir)/bin/" \
+                STAGE_PREFIX=stage1/ \
+                $(POSTSTAGE1_FLAGS_TO_PASS) \
+                $(STAGEPROFILE_FLAGS_TO_PASS)
+       $(STAMP) stageprofile_build
+       echo stageprofile_build > stage_last
+
 # For bootstrap4:
 stage3_copy: stage3_build
        $(MAKE) stage3
@@ -3529,6 +3563,7 @@ stage3_copy: stage3_build
 stage4_build: stage3_copy
        $(MAKE) CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" BUILD_CC="$(STAGE_CC_WRAPPER) stage3/xgcc$(exeext) -Bstage3/ -B$(build_tooldir)/bin/" \
                 STAGE_PREFIX=stage3/ \
+                $(POSTSTAGE1_FLAGS_TO_PASS) \
                 $(STAGE2_FLAGS_TO_PASS)
        $(STAMP) stage4_build
        echo stage4_build > stage_last
@@ -3564,7 +3599,7 @@ bootstrap3 bootstrap3-lean: bootstrap
 
 bootstrap4 bootstrap4-lean: stage4_build
 
-unstage1 unstage2 unstage3 unstage4:
+unstage1 unstage2 unstage3 unstage4 unstageprofile unstagefeedback:
        -set -vx; stage=`echo $@ | sed -e 's/un//'`; \
        rm -f $$stage/as$(exeext); \
        rm -f $$stage/ld$(exeext); \
@@ -3595,6 +3630,12 @@ restage3: unstage3
 restage4: unstage4
        $(MAKE) LANGUAGES="$(LANGUAGES)" stage4_build
 
+restageprofile: unstageprofile
+       $(MAKE) LANGUAGES="$(LANGUAGES)" stageprofile_build
+
+restagefeedback: unstagefeedback
+       $(MAKE) LANGUAGES="$(LANGUAGES)" stagefeedback_build
+
 bubblestrap:
        if test -f stage3_build; then true; else \
          echo; echo You must \"make bootstrap\" first.; \
@@ -3829,6 +3870,63 @@ stage4-start:
        fi; done
 stage4: force stage4-start lang.stage4
 
+stageprofile-start:
+       -if [ -d stageprofile ] ; then true ; else mkdir stageprofile ; fi
+       $(MAKE) -f libgcc.mk libgcc-stage-start stage=stageprofile
+       -for dir in intl $(SUBDIRS) ; \
+        do \
+          if [ -d stageprofile/$$dir ] ; then true ; else mkdir stageprofile/$$dir ; fi ; \
+        done
+       -mv $(STAGESTUFF) stageprofile
+       -mv intl/*$(objext) stageprofile/intl
+# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
+# dir will work properly.
+       -if [ -f as$(exeext) ] ; then (cd stageprofile && $(LN_S) ../as$(exeext) .) ; else true ; fi
+       -if [ -f ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+       -if [ -f collect-ld$(exeext) ] ; then (cd stageprofile && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+       -rm -f stageprofile/libgcc.a stageprofile/libgcov.a stageprofile/libgcc_eh.a
+       -cp libgcc.a stageprofile
+       -$(RANLIB_FOR_TARGET) stageprofile/libgcc.a
+       -cp libgcov.a stageprofile
+       -$(RANLIB_FOR_TARGET) stageprofile/libgcov.a
+       -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stageprofile; \
+          $(RANLIB_FOR_TARGET) stageprofile/libgcc_eh.a; \
+       fi
+       -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+         cp stageprofile/$${f} . ; \
+       else true; \
+       fi; done
+stageprofile: force stageprofile-start lang.stageprofile
+
+stagefeedback-start:
+       -if [ -d stagefeedback ] ; then true ; else mkdir stagefeedback ; fi
+       $(MAKE) -f libgcc.mk libgcc-stage-start stage=stagefeedback
+       -for dir in intl $(SUBDIRS) ; \
+        do \
+          if [ -d stagefeedback/$$dir ] ; then true ; else mkdir stagefeedback/$$dir ; fi ; \
+        done
+       -mv $(STAGESTUFF) stagefeedback
+       -mv intl/*$(objext) stagefeedback/intl
+# Copy as/ld if they exist to stage dir, so that running xgcc from the stage
+# dir will work properly.
+       -if [ -f as$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../as$(exeext) .) ; else true ; fi
+       -if [ -f ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../ld$(exeext) .) ; else true ; fi
+       -if [ -f collect-ld$(exeext) ] ; then (cd stagefeedback && $(LN_S) ../collect-ld$(exeext) .) ; else true ; fi
+       -rm -f stagefeedback/libgcc.a stagefeedback/libgcov.a stagefeedback/libgcc_eh.a
+       -rm -f *.da ada/*.da cp/*.da f/*.da java/*.da objc/*.da fixinc/*.da intl po testsuite 2>/dev/null
+       -cp libgcc.a stagefeedback
+       -$(RANLIB_FOR_TARGET) stagefeedback/libgcc.a
+       -cp libgcov.a stagefeedback
+       -$(RANLIB_FOR_TARGET) stagefeedback/libgcov.a
+       -if [ -f libgcc_eh.a ] ; then cp libgcc_eh.a stagefeedback; \
+          $(RANLIB_FOR_TARGET) stagefeedback/libgcc_eh.a; \
+       fi
+       -for f in .. $(EXTRA_MULTILIB_PARTS); do if [ x$${f} != x.. ]; then \
+         cp stagefeedback/$${f} . ; \
+       else true; \
+       fi; done
+stagefeedback: force stagefeedback-start lang.stagefeedback
+
 # Copy just the executable files from a particular stage into a subdirectory,
 # and delete the object files.  Use this if you're just verifying a version
 # that is pretty sure to work, and you are short of disk space.
@@ -3847,6 +3945,7 @@ risky-stage4: stage4
 #In GNU Make, ignore whether `stage*' exists.
 .PHONY: stage1 stage2 stage3 stage4 clean maintainer-clean TAGS bootstrap
 .PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
+.PHONY: stagefeedback stageprofile
 
 # Rules for generating translated message descriptions.
 # Disabled by autoconf if the tools are not available.