OSDN Git Service

2004-05-21 Paolo Bonzini <bonzini@gnu.org>
[pf3gnuchains/gcc-fork.git] / Makefile.tpl
index 18d55f2..6e94609 100644 (file)
@@ -105,7 +105,7 @@ REALLY_SET_LIB_PATH = \
   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 # This is the list of directories to be built for the build system.
-BUILD_CONFIGDIRS = libiberty
+BUILD_CONFIGDIRS = libiberty libbanshee
 # Build programs are put under this directory.
 BUILD_SUBDIR = @build_subdir@
 # This is set by the configure script to the arguments to use when configuring
@@ -127,6 +127,10 @@ TARGET_SUBDIR = @target_subdir@
 # directories built for the target.
 TARGET_CONFIGARGS = @target_configargs@
 
+# Where to find GMP
+HOST_GMPLIBS = @gmplibs@
+HOST_GMPINC = @gmpinc@
+
 # ----------------------------------------------
 # Programs producing files for the BUILD machine
 # ----------------------------------------------
@@ -244,7 +248,7 @@ PICFLAG =
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that prorgams built for the target machine work.
-TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
+TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs
 
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 
@@ -311,6 +315,7 @@ USUAL_DLLTOOL_FOR_TARGET = ` \
   fi`
 
 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
+GFORTRAN_FOR_TARGET = @GFORTRAN_FOR_TARGET@
 
 LD_FOR_TARGET=@LD_FOR_TARGET@
 CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@
@@ -692,6 +697,8 @@ TAGS: do-TAGS
 [+ FOR build_modules +]
 .PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
 maybe-configure-build-[+module+]:
+@if build-[+module+]
+maybe-configure-build-[+module+]: configure-build-[+module+]
 configure-build-[+module+]:
        @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
        $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
@@ -705,6 +712,7 @@ configure-build-[+module+]:
        CXX="$(CXX_FOR_BUILD)"; export CXX; \
        CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
        GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+       GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
        DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
        LD="$(LD_FOR_BUILD)"; export LD; \
        LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
@@ -751,13 +759,17 @@ configure-build-[+module+]:
          $(BUILD_CONFIGARGS) $${srcdiroption} \
          --with-build-subdir="$(BUILD_SUBDIR)" \
          || exit 1
+@endif build-[+module+]
 
 .PHONY: all-build-[+module+] maybe-all-build-[+module+]
 maybe-all-build-[+module+]:
+@if build-[+module+]
+maybe-all-build-[+module+]: all-build-[+module+]
 all-build-[+module+]: configure-build-[+module+]
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
+@endif build-[+module+]
 [+ ENDFOR build_modules +]
 
 # --------------------------------------
@@ -766,6 +778,8 @@ all-build-[+module+]: configure-build-[+module+]
 [+ FOR host_modules +]
 .PHONY: configure-[+module+] maybe-configure-[+module+]
 maybe-configure-[+module+]:
+@if [+module+]
+maybe-configure-[+module+]: configure-[+module+]
 configure-[+module+]:
        @test ! -f [+module+]/Makefile || exit 0; \
        [ -d [+module+] ] || mkdir [+module+]; \
@@ -803,9 +817,12 @@ configure-[+module+]:
        $(SHELL) $${libsrcdir}/configure \
          $(HOST_CONFIGARGS) $${srcdiroption} \
          || exit 1
+@endif [+module+]
 
 .PHONY: all-[+module+] maybe-all-[+module+]
 maybe-all-[+module+]:
+@if [+module+]
+maybe-all-[+module+]: all-[+module+]
 all-[+module+]: configure-[+module+]
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@@ -814,9 +831,12 @@ all-[+module+]: configure-[+module+]
          IF with_x 
            +] $(X11_FLAGS_TO_PASS)[+ 
          ENDIF with_x +] all)
+@endif [+module+]
 
 .PHONY: check-[+module+] maybe-check-[+module+]
 maybe-check-[+module+]:
+@if [+module+]
+maybe-check-[+module+]: check-[+module+]
 [+ IF no_check +]
 check-[+module+]:
 [+ ELIF no_check_cross +]
@@ -841,9 +861,12 @@ check-[+module+]:
            +] $(X11_FLAGS_TO_PASS)[+ 
          ENDIF with_x +] check)
 [+ ENDIF no_check +]
+@endif [+module+]
 
 .PHONY: install-[+module+] maybe-install-[+module+]
 maybe-install-[+module+]:
+@if [+module+]
+maybe-install-[+module+]: install-[+module+]
 [+ IF no_install +]
 install-[+module+]:
 [+ ELSE install +]
@@ -856,11 +879,14 @@ install-[+module+]: installdirs
            +] $(X11_FLAGS_TO_PASS)[+ 
          ENDIF with_x +] install)
 [+ ENDIF no_install +]
+@endif [+module+]
 
 # Other targets (info, dvi, etc.)
 [+ FOR recursive_targets +]
 .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
 maybe-[+make_target+]-[+module+]:
+@if [+module+]
+maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
 [+ IF (match-value? = "missing" (get "make_target") ) +]
 # [+module+] doesn't support [+make_target+].
 [+make_target+]-[+module+]:
@@ -885,6 +911,7 @@ maybe-[+make_target+]-[+module+]:
                  [+make_target+]) \
          || exit 1
 [+ ENDIF +]
+@endif [+module+]
 [+ ENDFOR recursive_targets +]
 [+ ENDFOR host_modules +]
 
@@ -894,6 +921,8 @@ maybe-[+make_target+]-[+module+]:
 [+ FOR target_modules +]
 .PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
 maybe-configure-target-[+module+]:
+@if target-[+module+]
+maybe-configure-target-[+module+]: configure-target-[+module+]
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
@@ -921,6 +950,7 @@ ELSE normal_cxx +]
 ENDIF raw_cxx +]
        CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
        GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+       GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
        DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
        LD="$(LD_FOR_TARGET)"; export LD; \
        LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
@@ -967,9 +997,12 @@ ENDIF raw_cxx +]
          $(TARGET_CONFIGARGS) $${srcdiroption} \
          --with-target-subdir="$(TARGET_SUBDIR)" \
          || exit 1
+@endif target-[+module+]
 
 .PHONY: all-target-[+module+] maybe-all-target-[+module+]
 maybe-all-target-[+module+]:
+@if target-[+module+]
+maybe-all-target-[+module+]: all-target-[+module+]
 all-target-[+module+]: configure-target-[+module+]
        @r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@@ -980,9 +1013,12 @@ all-target-[+module+]: configure-target-[+module+]
          +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
            ENDIF raw_cxx 
          +] all)
+@endif target-[+module+]
 
 .PHONY: check-target-[+module+] maybe-check-target-[+module+]
 maybe-check-target-[+module+]:
+@if target-[+module+]
+maybe-check-target-[+module+]: check-target-[+module+]
 [+ IF no_check +]
 # Dummy target for uncheckable module.
 check-target-[+module+]:
@@ -998,9 +1034,12 @@ check-target-[+module+]:
            ENDIF raw_cxx 
          +] check)
 [+ ENDIF no_check +]
+@endif target-[+module+]
 
 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
 maybe-install-target-[+module+]:
+@if target-[+module+]
+maybe-install-target-[+module+]: install-target-[+module+]
 [+ IF no_install +]
 # Dummy target for uninstallable.
 install-target-[+module+]:
@@ -1012,11 +1051,14 @@ install-target-[+module+]: installdirs
        (cd $(TARGET_SUBDIR)/[+module+] && \
          $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
 [+ ENDIF no_install +]
+@endif target-[+module+]
 
 # Other targets (info, dvi, etc.)
 [+ FOR recursive_targets +]
 .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
 maybe-[+make_target+]-target-[+module+]:
+@if target-[+module+]
+maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
 [+ IF (match-value? = "missing" (get "make_target") ) +]
 # [+module+] doesn't support [+make_target+].
 [+make_target+]-target-[+module+]:
@@ -1041,6 +1083,7 @@ maybe-[+make_target+]-target-[+module+]:
                  [+make_target+]) \
          || exit 1
 [+ ENDIF +]
+@endif target-[+module+]
 [+ ENDFOR recursive_targets +]
 [+ ENDFOR target_modules +]
 
@@ -1060,6 +1103,8 @@ maybe-[+make_target+]-target-[+module+]:
 # We must skip configuring if toplevel bootstrap is going.
 .PHONY: configure-gcc maybe-configure-gcc
 maybe-configure-gcc:
+@if gcc
+maybe-configure-gcc: configure-gcc
 configure-gcc:
        @test ! -f gcc/Makefile || exit 0; \
        [ -f stage_last ] && exit 0; \
@@ -1083,6 +1128,8 @@ configure-gcc:
        WINDRES="$(WINDRES)"; export WINDRES; \
        OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+       GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+       GMPINC="$(HOST_GMPINC)"; export GMPINC; \
        echo Configuring in gcc; \
        cd gcc || exit 1; \
        case $(srcdir) in \
@@ -1099,12 +1146,15 @@ configure-gcc:
        $(SHELL) $${libsrcdir}/configure \
          $(HOST_CONFIGARGS) $${srcdiroption} \
          || exit 1
+@endif gcc
 
 # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
 # causes trouble.  This wart will be fixed eventually by moving
 # the bootstrap behavior to this file.
 .PHONY: all-gcc maybe-all-gcc
 maybe-all-gcc:
+@if gcc
+maybe-all-gcc: all-gcc
 all-gcc: configure-gcc
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
@@ -1117,6 +1167,7 @@ all-gcc: configure-gcc
          $(SET_LIB_PATH) \
          (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
        fi
+@endif gcc
 
 # Building GCC uses some tools for rebuilding "source" files
 # like texinfo, bison/byacc, etc.  So we must depend on those.
@@ -1194,6 +1245,8 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld
 
 .PHONY: check-gcc maybe-check-gcc
 maybe-check-gcc:
+@if gcc
+maybe-check-gcc: check-gcc
 check-gcc:
        @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD_COMMAND}`; export r; \
@@ -1217,9 +1270,12 @@ check-gcc-c++:
 
 .PHONY: check-c++
 check-c++: check-target-libstdc++-v3 check-gcc-c++
+@endif gcc
 
 .PHONY: install-gcc maybe-install-gcc
 maybe-install-gcc:
+@if gcc
+maybe-install-gcc: install-gcc
 install-gcc:
        @if [ -f ./gcc/Makefile ] ; then \
          r=`${PWD_COMMAND}`; export r; \
@@ -1229,6 +1285,7 @@ install-gcc:
        else \
          true; \
        fi
+@endif gcc
 
 # Install the gcc headers files, but not the fixed include files,
 # which Cygnus is not allowed to distribute.  This rule is very
@@ -1255,6 +1312,8 @@ gcc-no-fixedincludes:
 [+ FOR recursive_targets +]
 .PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc
 maybe-[+make_target+]-gcc:
+@if gcc
+maybe-[+make_target+]-gcc: [+make_target+]-gcc
 [+make_target+]-gcc: [+
   FOR depend +]\
     [+depend+]-gcc [+
@@ -1274,6 +1333,7 @@ maybe-[+make_target+]-gcc:
                  "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
                  [+make_target+]) \
          || exit 1
+@endif gcc
 
 [+ ENDFOR recursive_targets +]
 
@@ -1600,10 +1660,10 @@ new-restage3: all-stage2-gcc
 # GCC needs to identify certain tools.
 # GCC also needs the information exported by the intl configure script.
 configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
-all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee
 # This is a slightly kludgy method of getting dependencies on 
 # all-build-libiberty correct; it would be better to build it every time.
-all-gcc: maybe-all-build-libiberty
+all-gcc: maybe-all-build-libiberty maybe-all-libbanshee
 all-bootstrap: [+ FOR host_modules +][+ IF bootstrap +]maybe-all-[+module+] [+ ENDIF bootstrap +][+ ENDFOR host_modules +]
 
 # Host modules specific to gdb.
@@ -1677,8 +1737,7 @@ configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads
 configure-target-fastjar: maybe-configure-target-zlib
 all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
 configure-target-libada: $(ALL_GCC_C)
-configure-target-libf2c: $(ALL_GCC_C)
-all-target-libf2c: maybe-all-target-libiberty
+configure-target-libgfortran: $(ALL_GCC_C)
 configure-target-libffi: $(ALL_GCC_C) 
 configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
 all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
@@ -1704,10 +1763,6 @@ configure-target-gperf: $(ALL_GCC_CXX)
 all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
 configure-target-qthreads: $(ALL_GCC_C)
 
-# Dependencies of maybe-foo on foo.  These are used because, for example,
-# all-gcc only depends on all-gas if gas is present and being configured.
-@maybe_dependencies@
-
 # Serialization dependencies.  Host configures don't work well in parallel to
 # each other, due to contention over config.cache.  Target configures and 
 # build configures are similar.