* ld-scripts/script.t: Put .pr in .text, and .rw in .data, for
[deliverable/binutils-gdb.git] / Makefile.in
index 07bc6810c49b572b1c696988f5e5c1600709535c..be05ea89c6d1ce52555ce743213b438698134599 100644 (file)
@@ -122,9 +122,6 @@ RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
        else echo runtest ; fi`
 
 
-# libraries that may need to be augmented on a system-by-system basis
-X11_LIB = -lX11
-
 # compilers to use to create programs which must be run in the build
 # environment.
 CC_FOR_BUILD = $(CC)
@@ -133,6 +130,13 @@ CXX_FOR_BUILD = $(CXX)
 SUBDIRS = "this is set via configure, don't edit this"
 OTHERS = 
 
+# This is set by the configure script to the list of directories which
+# should be built using the target tools.
+TARGET_CONFIGDIRS = xiberty libgloss newlib libio librx libstdc++ libg++ winsup
+
+# This is set by the configure script to the arguments passed to configure.
+CONFIG_ARGUMENTS = 
+
 ALL = all.normal
 INSTALL_TARGET = install-dirs \
        $(INSTALL_MODULES) \
@@ -197,6 +201,17 @@ AS_FOR_TARGET = ` \
     fi; \
   fi`
 
+LD_FOR_TARGET = ` \
+  if [ -f $$r/ld/ld.new ] ; then \
+    echo $$r/ld/ld.new ; \
+  else \
+    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+      echo $(LD); \
+    else \
+       t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
+    fi; \
+  fi`
+
 DLLTOOL_FOR_TARGET = ` \
   if [ -f $$r/binutils/dlltool ] ; then \
     echo $$r/binutils/dlltool ; \
@@ -272,6 +287,7 @@ BASE_FLAGS_TO_PASS = \
        "INSTALL_XFORM=$(INSTALL_XFORM)" \
        "LDFLAGS=$(LDFLAGS)" \
        "LEX=$(LEX)" \
+       "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
        "LIBCFLAGS=$(LIBCFLAGS)" \
        "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
        "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
@@ -306,10 +322,15 @@ FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
 
 # Flags that are concerned with the location of the X11 include files
 # and library files
+#
+# NOTE: until the top-level is getting the values via autoconf, it only
+# causes problems to have this top-level Makefile overriding the autoconf-set
+# values in child directories.  Only variables that don't conflict with
+# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
+#
 X11_FLAGS_TO_PASS = \
-       "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
-       "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
-       "X11_LIB=$(X11_LIB)"
+       'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
+       'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
 
 # Flags to pass down to makes which are built with the target environment.
 # The double $ decreases the length of the command line; the variables
@@ -323,6 +344,7 @@ EXTRA_TARGET_FLAGS = \
        'CXX=$$(CXX_FOR_TARGET)' \
        'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
        'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
+       'LD=$$(LD_FOR_TARGET)' \
        'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
        'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
        'NM=$$(NM_FOR_TARGET)' \
@@ -536,48 +558,51 @@ INSTALL_X11_MODULES = \
 # This is a list of the targets for all of the modules which are compiled
 # using $(TARGET_FLAGS_TO_PASS).
 ALL_TARGET_MODULES = \
-       $(start-sanitize-chill) \
-       all-chillrt \
-       $(end-sanitize-chill) \
        all-libio \
        all-libstdc++ \
        all-librx \
        all-libg++ \
        all-newlib \
+       all-winsup \
        all-libgloss \
        all-xiberty
 
+# This is a list of the configure targets for all of the modules which
+# are compiled using the target tools.
+CONFIGURE_TARGET_MODULES = \
+       configure-libio \
+       configure-libstdc++ \
+       configure-librx \
+       configure-libg++ \
+       configure-newlib \
+       configure-winsup \
+       configure-libgloss \
+       configure-xiberty
+
 # 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-chill) \
-       check-chillrt \
-       $(end-sanitize-chill) \
        check-libio \
        check-libstdc++ \
        check-libg++ \
        check-newlib \
+       check-winsup \
        check-xiberty
 
 # 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-chill) \
-       install-chillrt \
-       $(end-sanitize-chill) \
        install-libio \
        install-libstdc++ \
        install-libg++ \
        install-newlib \
+       install-winsup \
        install-libgloss \
        install-xiberty
 
 # This is a shell case of all modules which are compiled using
 # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
-TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty
-# start-sanitize-chill
-TARGET_LIBS = chillrt | libio | libstdc++ | librx | libg++ | newlib | xiberty
-# end-sanitize-chill
+TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty | winsup
 
 # The first rule in the file had better be this one.  Don't put any above it.
 all: all.normal
@@ -606,14 +631,14 @@ DO_X = \
        do-install-info \
        do-installcheck \
        do-mostlyclean \
-       do-realclean \
+       do-maintainer-clean \
        do-TAGS
 .PHONY: $(DO_X)
 $(DO_X):
        @target=`echo $@ | sed -e 's/^do-//'`; \
        r=`pwd`; export r; \
        srcroot=`cd $(srcdir); pwd`; export srcroot; \
-       for i in $(SUBDIRS); do \
+       for i in $(SUBDIRS) $(TARGET_CONFIGDIRS); do \
          if [ -f ./$$i/Makefile ]; then \
            case $$i in \
            $(TARGET_LIBS) ) \
@@ -645,7 +670,8 @@ $(DO_X):
 # Here are the targets which correspond to the do-X targets.
 
 .PHONY: info installcheck dvi install-info
-.PHONY: clean distclean mostlyclean realclean local-clean local-distclean
+.PHONY: clean distclean mostlyclean maintainer-clean realclean
+.PHONY: local-clean local-distclean local-maintainer-clean
 info: do-info
 installcheck: do-installcheck
 dvi: do-dvi
@@ -662,10 +688,16 @@ local-clean:
 local-distclean:
        -rm -f Makefile config.status
 
+local-maintainer-clean:
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+
 clean: do-clean local-clean
 mostlyclean: do-mostlyclean local-clean
 distclean: do-distclean local-clean local-distclean
-realclean: do-realclean local-clean local-distclean
+maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
+maintainer-clean: local-distclean
+realclean: maintainer-clean
 
 # Check target.
 
@@ -795,6 +827,36 @@ $(INSTALL_MODULES): install-dirs
          true; \
        fi
 
+# This rule is used to configure the modules which are built with the
+# target tools.
+.PHONY: $(CONFIGURE_TARGET_MODULES)
+$(CONFIGURE_TARGET_MODULES):
+       @dir=`echo $@ | sed -e 's/configure-//'`; \
+       if [ -f ./$${dir}/Makefile ] ; then \
+         true; \
+       elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
+         if [ -d $(srcdir)/$${dir} ]; then \
+           if [ -d ./$${dir} ]; then true; else mkdir $${dir}; fi; \
+           r=`pwd`; export r; \
+           srcroot=`cd $(srcdir); pwd`; export srcroot; \
+           AR="$(AR_FOR_TARGET)"; export AR; \
+           AS="$(AS_FOR_TARGET)"; export AS; \
+           CC="$(CC_FOR_TARGET)"; export CC; \
+           CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+           CXX="$(CXX_FOR_TARGET)"; export CXX; \
+           CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+           LD="$(LD_FOR_TARGET)"; export LD; \
+           NM="$(NM_FOR_TARGET)"; export NM; \
+           RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+           cd $${dir}; \
+           $${srcroot}/configure $(CONFIG_ARGUMENTS) --srcdir=$${srcroot}/$${dir}; \
+         else \
+           true; \
+         fi \
+       else \
+         true; \
+       fi
+
 # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
 # To build a target all-X means to cd to X and make all.
 .PHONY: $(ALL_TARGET_MODULES)
@@ -931,9 +993,6 @@ all-autoconf: all-m4
 all-bfd:
 all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
 all-byacc:
-# start-sanitize-chill
-all-chillrt: all-binutils all-gas all-gcc all-newlib
-# end-sanitize-chill
 all-cvs:
 all-dejagnu: all-tcl all-expect all-tk
 all-diff: all-libiberty
@@ -957,14 +1016,22 @@ all-hello: all-libiberty
 all-indent:
 all-ispell: all-emacs19
 all-ld: all-libiberty all-bfd all-byacc all-flex
-all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
-all-libio: all-gas all-ld all-gcc all-xiberty all-newlib 
+configure-libg++: all-gcc
+all-libg++: configure-libg++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
+configure-libgloss: all-gcc
+all-libgloss: configure-libgloss
+configure-libio: all-gcc
+all-libio: configure-libio all-gas all-ld all-gcc all-xiberty all-newlib
 all-libiberty:
-all-libstdc++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio
+configure-librx: all-gcc all-newlib
+all-librx: configure-librx
+configure-libstdc++: all-gcc
+all-libstdc++: configure-libstdc++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio
 all-m4: all-libiberty
 all-make: all-libiberty
 all-mmalloc:
-all-newlib: all-binutils all-gas all-gcc
+configure-newlib: all-gcc
+all-newlib: configure-newlib all-binutils all-gas all-gcc
 all-opcodes: all-bfd
 all-patch:
 all-prms: all-libiberty
@@ -984,8 +1051,11 @@ all-textutils:
 all-tgas: all-libiberty all-bfd
 all-time:
 all-wdiff:
+all-winsup: all-newlib 
+configure-winsup: configure-newlib
 all-uudecode: all-libiberty
-all-xiberty: all-gcc all-ld all-newlib
+configure-xiberty: all-gcc
+all-xiberty: configure-xiberty all-gcc all-ld all-newlib
 
 ### other supporting targets
 
@@ -1059,12 +1129,8 @@ ETC_SUPPORT_PFX=configure.info standards.info cfg-paper.info
 # When you use `make setup-dirs' or `make taz' you should always redefine
 # this macro.
 SUPPORT_FILES = list-of-support-files-for-tool-in-question
-# Directories that might want `make diststuff' run.
-DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats gas
 # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
 DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
-# Directories where "info" should be built.
-DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr etc
 
 .PHONY: taz
 
@@ -1089,25 +1155,16 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
        @if [ -f .Sanitize ] ; then echo "RUN Sanitize FIRST!" ; false ; fi ;
        $(end-sanitize-Sanitize)
        ./configure sun4
-       # Doc files don't change; include them in distribution.
-       for f in $(DISTDOCDIRS) ; do \
-         if [ -r $$f/Makefile ]; then \
-           (cd $$f ; $(MAKE) info) || exit 1 ; \
-         else true ; fi ; \
-       done
-       # Make links, and run "make diststuff" when needed.
-       # The `echo' for setting `p' is to convert all whitespace to spaces.
-       # Then the `case' further below should tell whether $$d is in
-       # DISTSTUFFDIRS.
+       # Make links, and run "make diststuff" or "make info" when needed.
        rm -rf proto-toplev ; mkdir proto-toplev
        set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
-       p=" `echo $(DISTSTUFFDIRS)` " ; \
        for d in $$dirs ; do \
          if [ -d $$d ]; then \
-           case " $$p " in \
-           *" $$d "*)  \
-               (cd $$d ; $(MAKE) diststuff ) || exit 1  ;; \
-           esac ; \
+           if grep '^diststuff:' $$d/Makefile >/dev/null ; then \
+               (cd $$d ; $(MAKE) diststuff ) || exit 1  ; \
+           elif grep '^info:' $$d/Makefile >/dev/null ; then \
+               (cd $$d ; $(MAKE) info ) || exit 1  ; \
+           fi ; \
            if [ -d $$d/proto-$$d.dir ]; then \
              ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
            else \
@@ -1178,9 +1235,10 @@ gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
 
 .PHONY: gdb.tar.gz
 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
+GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
 gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
        $(MAKE) -f Makefile.in taz TOOL=gdb \
-               SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
+               SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
 
 .PHONY: newlib.tar.gz
 NEWLIB_SUPPORT_DIRS=libgloss
@@ -1201,8 +1259,7 @@ newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
        cd newlib ; make distclean
        $(MAKE) -f Makefile.in taz TOOL=newlib \
                SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
-               DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \
-               DISTDOCDIRS="$(DISTDOCDIRS) newlib"
+               DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
 
 .NOEXPORT:
 MAKEOVERRIDES=
This page took 0.026007 seconds and 4 git commands to generate.