OSDN Git Service

2001-07-25 H.J. Lu <hjl@gnu.org>
[pf3gnuchains/gcc-fork.git] / Makefile.in
index a20988d..4a19cff 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000 Free Software Foundation
+#   1999, 2000, 2001 Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -87,6 +87,7 @@ CXXFLAGS = -g -O2
 
 LDFLAGS = 
 LIBCFLAGS = $(CFLAGS)
+CFLAGS_FOR_BUILD = $(CFLAGS)
 CFLAGS_FOR_TARGET = $(CFLAGS)
 LDFLAGS_FOR_TARGET = 
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
@@ -218,6 +219,7 @@ FLAGS_FOR_TARGET =
 CC_FOR_TARGET =
 CHILL_FOR_TARGET =
 CXX_FOR_TARGET =
+CXX_FOR_TARGET_FOR_RECURSIVE_MAKE =
 GCJ_FOR_TARGET =
 
 # If GCC_FOR_TARGET is not overriden on the command line, then this
@@ -229,6 +231,8 @@ GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET)
 AS_FOR_TARGET = ` \
   if [ -f $$r/gas/as-new ] ; then \
     echo $$r/gas/as-new ; \
+  elif [ -f $$r/gcc/xgcc ]; then \
+    $(CC_FOR_TARGET) -print-prog-name=as ; \
   else \
     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
       echo $(AS); \
@@ -240,6 +244,8 @@ AS_FOR_TARGET = ` \
 LD_FOR_TARGET = ` \
   if [ -f $$r/ld/ld-new ] ; then \
     echo $$r/ld/ld-new ; \
+  elif [ -f $$r/gcc/xgcc ]; then \
+    $(CC_FOR_TARGET) -print-prog-name=ld ; \
   else \
     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
       echo $(LD); \
@@ -299,6 +305,8 @@ RANLIB_FOR_TARGET = ` \
 NM_FOR_TARGET = ` \
   if [ -f $$r/binutils/nm-new ] ; then \
     echo $$r/binutils/nm-new ; \
+  elif [ -f $$r/gcc/xgcc ]; then \
+    $(CC_FOR_TARGET) -print-prog-name=nm ; \
   else \
     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
       echo $(NM); \
@@ -390,6 +398,14 @@ BASE_FLAGS_TO_PASS = \
        "gcc_version_trigger=$(gcc_version_trigger)" \
        "target_alias=$(target_alias)" 
 
+# For any flags above that may contain shell code that varies from one
+# target library to another.  When doing recursive invocations of the
+# top-level Makefile, we don't want the outer make to evaluate them,
+# so we pass these variables down unchanged.  They must not contain
+# single nor double quotes.
+RECURSE_FLAGS = \
+       CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)'
+
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
 # If any variables are added here, they must be added to do-*, below.
@@ -458,6 +474,7 @@ EXTRA_GCC_FLAGS = \
        "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
        'WINDRES=$$(WINDRES_FOR_TARGET)' \
        "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
+       "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
        "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \
        "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \
        "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \
@@ -466,6 +483,7 @@ EXTRA_GCC_FLAGS = \
        "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
        "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
        "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \
+       "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
        "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
 
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
@@ -527,6 +545,7 @@ ALL_MODULES = \
        all-sed \
        all-send-pr \
        all-shellutils \
+       all-sid \
        all-sim \
        all-snavigator \
        all-tar \
@@ -604,6 +623,7 @@ CROSS_CHECK_MODULES = \
        check-send-pr \
        check-shellutils \
        check-snavigator \
+       check-sid \
        check-sim \
        check-tar \
        check-tcl \
@@ -680,6 +700,7 @@ INSTALL_MODULES = \
        install-sed \
        install-send-pr \
        install-shellutils \
+       install-sid \
        install-sim \
        install-snavigator \
        install-tar \
@@ -871,6 +892,7 @@ CLEAN_MODULES = \
        clean-sed \
        clean-send-pr \
        clean-shellutils \
+       clean-sid \
        clean-sim \
        clean-snavigator \
        clean-tar \
@@ -967,7 +989,7 @@ $(DO_X):
            if (cd ./$$i; \
                $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
                        "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-                       "`echo 'RANLIB=$${RANLIB}' | sed -e s/.*=$$/XFOO=/`" \
+                       "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
                        "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
                        $${target}); \
            then true; else exit 1; fi; \
@@ -986,7 +1008,7 @@ $(DO_X):
            if (cd $(TARGET_SUBDIR)/$$i; \
                $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
                        "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
-                       "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \
+                       "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
                        "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
                        $${target}); \
            then true; else exit 1; fi; \
@@ -1345,7 +1367,8 @@ $(ALL_TARGET_MODULES):
          r=`pwd`; export r; \
          s=`cd $(srcdir); pwd`; export s; \
          $(SET_LIB_PATH) \
-         (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
+         (cd $(TARGET_SUBDIR)/$${dir}; \
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
        else \
          true; \
        fi
@@ -1359,7 +1382,8 @@ $(CHECK_TARGET_MODULES):
          r=`pwd`; export r; \
          s=`cd $(srcdir); pwd`; export s; \
          $(SET_LIB_PATH) \
-         (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
+         (cd $(TARGET_SUBDIR)/$${dir}; \
+           $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
        else \
          true; \
        fi
@@ -1474,7 +1498,7 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b
        s=`cd $(srcdir); pwd` ; export s; \
        $(SET_LIB_PATH) \
        echo "Building runtime libraries"; \
-       $(MAKE) $(BASE_FLAGS_TO_PASS) all
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
 
 .PHONY: cross
 cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
@@ -1487,7 +1511,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
        s=`cd $(srcdir); pwd` ; export s; \
        $(SET_LIB_PATH) \
        echo "Building runtime libraries"; \
-       $(MAKE) $(BASE_FLAGS_TO_PASS) all LANGUAGES="c c++"
+       $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
+         LANGUAGES="c c++" all
 
 .PHONY: check-gcc
 check-gcc:
@@ -1631,7 +1656,7 @@ configure-target-libchill: $(ALL_GCC_C)
 all-target-libchill: configure-target-libchill all-target-libiberty
 configure-target-libobjc: $(ALL_GCC_C)
 all-target-libobjc: configure-target-libobjc all-target-libiberty
-all-m4: all-libiberty
+all-m4: all-libiberty all-texinfo
 all-make: all-libiberty
 all-mmalloc:
 configure-target-newlib: $(ALL_GCC)
@@ -1650,6 +1675,7 @@ all-recode: all-libiberty
 all-sed: all-libiberty
 all-send-pr: all-prms
 all-shellutils:
+all-sid: all-tcl all-tk
 all-sim: all-libiberty all-bfd all-opcodes all-readline all-cgen
 all-snavigator: all-tcl all-tk all-itcl all-db all-grep all-libgui
 all-tar: all-libiberty
@@ -1679,6 +1705,7 @@ all-target-libiberty: configure-target-libiberty
 all-target: $(ALL_TARGET_MODULES)
 install-target: $(INSTALL_TARGET_MODULES)
 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
+install-sid: install-tcl install-tk
 ### other supporting targets
 
 MAKEDIRS= \