Apply patches from PRs 16299, 17008 and 17140
[binutils-gdb.git] / Makefile.in
index 844523a12236cc5fbcedb68404c39297718f68be..a2aa213d27a3c003b6326c326841bd2796eccbca 100644 (file)
@@ -163,7 +163,12 @@ OTHERS =
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
-TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup opcodes libstub cygmon
+
+# start-sanitize-dsp
+SPECIAL_LIBS = libdsp
+# end-sanitize-dsp
+
+TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes libstub cygmon
 
 # Target libraries are put under this directory:
 # Changed by configure to $(target_alias) if cross.
@@ -193,7 +198,6 @@ INSTALL_TARGET = installdirs \
        $(INSTALL_X11_MODULES) \
        $(INSTALL_DOSREL)
 
-
 CC_FOR_TARGET = ` \
   if [ -f $$r/gcc/xgcc ] ; then \
     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
@@ -329,6 +333,18 @@ NM_FOR_TARGET = ` \
     fi; \
   fi`
 
+# The first rule in the file had better be this one.  Don't put any above it.
+# This lives here to allow makefile fragments to contain dependencies.
+all: all.normal
+.PHONY: all
+
+# These can be overridden by config/mt-*.
+# The _TARGET_ is because they're specified in mt-foo.
+# The _HOST_ is because they're programs that run on the host.
+EXTRA_TARGET_HOST_ALL_MODULES =
+EXTRA_TARGET_HOST_INSTALL_MODULES =
+EXTRA_TARGET_HOST_CHECK_MODULES =
+
 #### host and target specific makefile fragments come in here.
 ###
 
@@ -472,7 +488,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 'BOOT_CFLAGS=$(BOOT_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)
 
@@ -488,6 +504,9 @@ ALL_MODULES = \
        all-binutils \
        all-bison \
        all-byacc \
+       $(start-sanitize-cygnus) \
+       all-cgen \
+       $(end-sanitize-cygnus) \
        all-cvssrc \
        all-db \
        all-dejagnu \
@@ -544,7 +563,9 @@ ALL_MODULES = \
        all-send-pr \
        all-shellutils \
        all-sim \
+       $(start-sanitize-cygnus) \
        all-snavigator \
+       $(end-sanitize-cygnus) \
        all-tar \
        all-tcl \
        all-texinfo \
@@ -555,7 +576,8 @@ ALL_MODULES = \
        $(start-sanitize-ide) \
        all-vmake \
        $(end-sanitize-ide) \
-       all-wdiff 
+       all-wdiff \
+       $(EXTRA_TARGET_HOST_ALL_MODULES)
 
 # This is a list of the check targets for all of the modules which are
 # compiled using $(FLAGS_TO_PASS).
@@ -627,7 +649,9 @@ CROSS_CHECK_MODULES = \
        check-sed \
        check-send-pr \
        check-shellutils \
+       $(start-sanitize-cygnus) \
        check-snavigator \
+       $(end-sanitize-cygnus) \
        check-sim \
        check-tar \
        check-tcl \
@@ -639,7 +663,8 @@ CROSS_CHECK_MODULES = \
        $(start-sanitize-ide) \
        check-vmake \
        $(end-sanitize-ide) \
-       check-wdiff
+       check-wdiff \
+       $(EXTRA_TARGET_HOST_CHECK_MODULES)
 
 CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
 
@@ -716,7 +741,9 @@ INSTALL_MODULES = \
        install-send-pr \
        install-shellutils \
        install-sim \
+       $(start-sanitize-cygnus) \
        install-snavigator \
+       $(end-sanitize-cygnus) \
        install-tar \
        install-texinfo \
        install-textutils \
@@ -726,7 +753,8 @@ INSTALL_MODULES = \
        $(start-sanitize-ide) \
        install-vmake \
        $(end-sanitize-ide) \
-       install-wdiff
+       install-wdiff \
+       $(EXTRA_TARGET_HOST_INSTALL_MODULES)
 
 # This is a list of the targets for all of the modules which are compiled
 # using $(X11_FLAGS_TO_PASS).
@@ -775,6 +803,9 @@ ALL_TARGET_MODULES = \
        all-target-libg++ \
        all-target-newlib \
        all-target-winsup \
+       $(start-sanitize-dsp) \
+       all-target-libdsp \
+       $(end-sanitize-dsp) \
        all-target-libgloss \
        all-target-libiberty \
        all-target-gperf \
@@ -783,12 +814,16 @@ ALL_TARGET_MODULES = \
        $(start-sanitize-java) \
        all-target-libjava \
        all-target-boehm-gc \
+       all-target-qthreads \
        $(end-sanitize-java) \
        all-target-cygmon
 
 # This is a list of the configure targets for all of the modules which
 # are compiled using the target tools.
 CONFIGURE_TARGET_MODULES = \
+       $(start-sanitize-dsp) \
+       configure-target-libdsp \
+       $(end-sanitize-dsp) \
        configure-target-libio \
        configure-target-libstdc++ \
        configure-target-librx \
@@ -803,12 +838,16 @@ CONFIGURE_TARGET_MODULES = \
        $(start-sanitize-java) \
        configure-target-libjava \
        configure-target-boehm-gc \
+       configure-target-qthreads \
        $(end-sanitize-java) \
        configure-target-cygmon
 
 # This is a list of the check targets for all of the modules which are
 # compiled using $(TARGET_FLAGS_TO_PASS).
 CHECK_TARGET_MODULES = \
+       $(start-sanitize-dsp) \
+       check-target-libdsp \
+       $(end-sanitize-dsp) \
        check-target-libio \
        check-target-libstdc++ \
        check-target-libg++ \
@@ -818,12 +857,16 @@ CHECK_TARGET_MODULES = \
        $(start-sanitize-java) \
        check-target-libjava \
        check-target-boehm-gc \
+       check-target-qthreads \
        $(end-sanitize-java) \
        check-target-gperf
 
 # This is a list of the install targets for all of the modules which are
 # compiled using $(TARGET_FLAGS_TO_PASS).
 INSTALL_TARGET_MODULES = \
+       $(start-sanitize-dsp) \
+       install-target-libdsp \
+       $(end-sanitize-dsp) \
        install-target-libio \
        install-target-libstdc++ \
        install-target-libg++ \
@@ -834,6 +877,7 @@ INSTALL_TARGET_MODULES = \
        $(start-sanitize-java) \
        install-target-libjava \
        install-target-boehm-gc \
+       install-target-qthreads \
        $(end-sanitize-java) \
        install-target-gperf
 
@@ -848,6 +892,9 @@ CLEAN_MODULES = \
        clean-binutils \
        clean-bison \
        clean-byacc \
+       $(start-sanitize-cygnus) \
+       clean-cgen \
+       $(end-sanitize-cygnus) \
        clean-cvssrc \
        clean-db \
        clean-dejagnu \
@@ -904,7 +951,9 @@ CLEAN_MODULES = \
        clean-send-pr \
        clean-shellutils \
        clean-sim \
+       $(start-sanitize-cygnus) \
        clean-snavigator \
+       $(end-sanitize-cygnus) \
        clean-tar \
        clean-tcl \
        clean-texinfo \
@@ -919,6 +968,9 @@ CLEAN_MODULES = \
 
 # All of the target modules that can be cleaned
 CLEAN_TARGET_MODULES = \
+       $(start-sanitize-dsp) \
+       clean-target-libdsp \
+       $(end-sanitize-dsp) \
        clean-target-libio \
        clean-target-libstdc++ \
        clean-target-librx \
@@ -933,6 +985,7 @@ CLEAN_TARGET_MODULES = \
        $(start-sanitize-java) \
        clean-target-libjava \
        clean-target-boehm-gc \
+       clean-target-qthreads \
        $(end-sanitize-java) \
        clean-target-cygmon
 
@@ -948,10 +1001,6 @@ CLEAN_X11_MODULES = \
        clean-tk \
        clean-tix
 
-# The first rule in the file had better be this one.  Don't put any above it.
-all: all.normal
-.PHONY: all
-
 # The target built for a native build.
 .PHONY: all.normal
 all.normal: \
@@ -1190,6 +1239,8 @@ install-foundry:
          else \
            true; \
          fi; \
+       date '+%D %r' > builddate \
+       $(INSTALL_DATA) builddate $(datadir)/builddate ; \
        done
 # end-sanitize-ide
 
@@ -1272,6 +1323,11 @@ $(CONFIGURE_TARGET_MODULES):
                mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
              fi; \
            else \
+             if echo '.;' | cmp - $(TARGET_SUBDIR)/$${dir}/tmpmulti.out >/dev/null 2>&1; then \
+               true; \
+             else \
+               rm -f $(TARGET_SUBDIR)/$${dir}/Makefile; \
+             fi; \
              mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \
            fi; \
          fi; \
@@ -1507,7 +1563,7 @@ install-dosrel-fake:
 all-apache:
 all-ash:
 all-autoconf: all-m4 all-texinfo
-all-automake:
+all-automake: all-m4 all-texinfo
 all-bash:
 all-bfd: all-libiberty all-intl
 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl
@@ -1516,6 +1572,13 @@ all-bison: all-texinfo
 all-target-boehm-gc: configure-target-boehm-gc
 # end-sanitize-java
 all-byacc:
+# start-sanitize-cygnus
+all-cgen:
+# These two have dependencies on cgen, and while this section is alphabetically
+# sorted, I wish to keep these together until things settle.
+all-opcodes: all-cgen
+all-sim: all-cgen
+# end-sanitize-cygnus
 all-cvssrc:
 configure-target-cygmon: $(ALL_GCC)
 all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub
@@ -1551,7 +1614,6 @@ all-gnuserv:
 configure-target-gperf: $(ALL_GCC)
 all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++
 all-gprof: all-libiberty all-bfd all-opcodes all-intl
-all-grep: all-libiberty
 all-grez: all-libiberty all-bfd all-opcodes
 all-gui: all-gdb all-libproc all-target-librx
 all-guile:
@@ -1569,6 +1631,10 @@ all-itcl: all-tcl all-tk
 all-jstools: all-tcl all-tk all-tix all-libgui all-libide all-libidetcl
 # end-sanitize-ide
 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl
+# start-sanitize-dsp
+all-target-libdsp: configure-target-libdsp configure-target-newlib
+configure-target-libdsp: $(ALL_GCC) 
+# end-sanitize-dsp
 configure-target-libg++: $(ALL_GCC) configure-target-librx
 all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
 configure-target-libgloss: $(ALL_GCC)
@@ -1583,7 +1649,8 @@ all-libide: all-ilu
 all-libidetcl: all-tcl all-tk all-itcl all-ilu all-libgui all-libide
 # end-sanitize-ide
 # start-sanitize-java
-all-target-libjava: configure-target-libjava
+configure-target-libjava: $(ALL_GCC) configure-target-boehm-gc configure-target-qthreads
+all-target-libjava: configure-target-libjava all-gcc all-target-newlib all-target-boehm-gc all-target-qthreads
 # end-sanitize-java
 configure-target-librx: $(ALL_GCC) configure-target-newlib
 all-target-librx: configure-target-librx
@@ -1601,6 +1668,9 @@ all-opcodes: all-bfd all-libiberty
 all-patch: all-libiberty
 all-perl:
 all-prms: all-libiberty
+# start-sanitize-java
+all-target-qthreads: configure-target-qthreads
+# end-sanitize-java
 all-rcs:
 all-readline:
 all-recode: all-libiberty
@@ -1608,7 +1678,9 @@ all-sed: all-libiberty
 all-send-pr: all-prms
 all-shellutils:
 all-sim: all-libiberty all-bfd all-opcodes all-readline
-all-snavigator: all-tcl all-tk all-tix all-itcl all-db all-grep all-flexlm
+# start-sanitize-cygnus
+all-snavigator: all-tcl all-tk all-tix all-itcl all-db all-grep all-flexlm all-libgui
+# end-sanitize-cygnus
 all-tar: all-libiberty
 all-tcl:
 all-tclX: all-tcl all-tk
@@ -1746,7 +1818,7 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
          mkdir proto-toplev/texinfo/util && \
          ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
        else true; fi
-       chmod og=u `find . -print`
+       chmod -R og=u . || chmod og=u `find . -print`
        if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
          ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \
        else \
@@ -1778,7 +1850,7 @@ binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
                SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
 
 .PHONY: gas+binutils.tar.gz
-GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof intl
+GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
 gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
        $(MAKE) -f Makefile.in taz TOOL=gas \
                SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"