* config/irix3.mh (NATDEPFILES): nat-mips.o => mips-nat.o.
[deliverable/binutils-gdb.git] / Makefile.in
index 86d344e741cd43e3eeae6d051597b2fc92ecafb4..7802d6c9e8afcde0a75d70b6c079bc17683f32d3 100644 (file)
@@ -26,6 +26,8 @@ bindir = $(exec_prefix)/bin
 libdir = $(exec_prefix)/lib
 tooldir = $(libdir)
 
+program_transform_name =
+
 datadir = $(prefix)/lib
 mandir = $(prefix)/man
 man1dir = $(mandir)/man1
@@ -47,10 +49,12 @@ INSTALL = install -c
 INSTALL_PROGRAM = $(INSTALL)
 INSTALL_DATA = $(INSTALL)
 
+AS = as
 AR = ar
 AR_FLAGS = qc
 CFLAGS = -g
 RANLIB = ranlib
+NM = nm
 
 BISON = `if [ -f $${rootme}/byacc/byacc ] ; \
            then echo $${rootme}/byacc/byacc ; \
@@ -65,7 +69,11 @@ MAKEINFO = `if [ -f $${rootme}/texinfo/C/makeinfo ] ; \
        then echo $${rootme}/texinfo/C/makeinfo ; \
        else echo makeinfo ; fi`
 
-SUBDIRS = libiberty mmalloc glob readline bfd gdb binutils ld gas tgas gcc libg++ newlib libm # clib -- newlib replaces
+# C compiler to use to create programs which must be run in the build
+# environment.
+CC_FOR_BUILD = $(CC)
+
+SUBDIRS = libiberty mmalloc glob readline opcodes bfd gdb  binutils ld gas tgas gcc libg++ newlib
 OTHERS = 
 
 ALL = all.normal
@@ -74,17 +82,76 @@ INSTALL_TARGET = install.all
 ### for debugging
 #GCCVERBOSE=-v
 
-GXX = `if [ -f $${rootme}/gcc/gcc ] ; \
-       then echo $${rootme}/gcc/gcc -B$${rootme}/gcc/ ; \
-       else echo gcc ; fi`
-
-XTRAFLAGS = `if [ -f $${rootme}/gcc/gcc ] ; \
-       then echo -I$${rootme}/gcc/include ; \
-       else echo ; fi`
+CC_FOR_TARGET = ` \
+  if [ -f $${rootme}/gcc/Makefile ] ; then \
+    echo $${rootme}/gcc/gcc -B$${rootme}/gcc/; \
+  else \
+    if [ "$(host_cpu)-$(host_vendor)-$(host_os)" = "$(target_cpu)-$(target_vendor)-$(target_os)" ] ; then \
+      echo $(CC); \
+    else \
+      t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
+    fi; \
+  fi`
+
+AS_FOR_TARGET = ` \
+  if [ -f $${rootme}/gas/Makefile ] ; then \
+    echo $${rootme}/gas/as.new ; \
+  else \
+    if [ "$(host_cpu)-$(host_vendor)-$(host_os)" = "$(target_cpu)-$(target_vendor)-$(target_os)" ] ; then \
+      echo $(AS); \
+    else \
+       t='$(program_transform_name)'; echo as | sed -e '' $$t ; \
+    fi \
+  fi`
+
+AR_FOR_TARGET = ` \
+  if [ -f $${rootme}/binutils/Makefile ] ; then \
+    echo $${rootme}/binutils/ar ; \
+  else \
+    if [ "$(host_cpu)-$(host_vendor)-$(host_os)" = "$(target_cpu)-$(target_vendor)-$(target_os)" ] ; then \
+      echo $(AR); \
+    else \
+       t='$(program_transform_name)'; echo ar | sed -e '' $$t ; \
+    fi \
+  fi`
+
+RANLIB_FOR_TARGET = ` \
+  if [ -f $${rootme}/binutils/Makefile ] ; then \
+    echo $${rootme}/binutils/ranlib ; \
+  else \
+    if [ "$(host_cpu)-$(host_vendor)-$(host_os)" = "$(target_cpu)-$(target_vendor)-$(target_os)" ] ; then \
+      echo $(RANLIB); \
+    else \
+       t='$(program_transform_name)'; echo ranlib | sed -e '' $$t ; \
+    fi \
+  fi`
+
+NM_FOR_TARGET = ` \
+  if [ -f $${rootme}/binutils/Makefile ] ; then \
+    echo $${rootme}/binutils/nm ; \
+  else \
+    if [ "$(host_cpu)-$(host_vendor)-$(host_os)" = "$(target_cpu)-$(target_vendor)-$(target_os)" ] ; then \
+      echo $(NM); \
+    else \
+       t='$(program_transform_name)'; echo nm | sed -e '' $$t ; \
+    fi \
+  fi`
+
+XTRAFLAGS = ` \
+  if [ -f $${rootme}/gcc/Makefile ] ; then \
+    if [ -f $${rootme}/newlib/Makefile ] ; then \
+      echo -I$${rootme}/newlib/targ-include -I$${srcroot}/newlib/libc/include -I$${rootme}/gcc/include -nostdinc ; \
+    else \
+      echo -I$${rootme}/gcc/include ; \
+    fi ; \
+  else \
+     echo ; \
+  fi`
 
 #### host and target specific makefile fragments come in here.
 ###
 
+# Flags to pass down to sub-makes
 FLAGS_TO_PASS = \
        "prefix=$(prefix)" \
        "exec_prefix=$(exec_prefix)" \
@@ -101,7 +168,32 @@ FLAGS_TO_PASS = \
        "MAKEINFO=$(MAKEINFO)" \
        "INSTALL=$(INSTALL)" \
        "INSTALL_DATA=$(INSTALL_DATA)" \
-       "INSTALL_PROGRAM=$(INSTALL_PROGRAM)"
+       "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+       "CC_FOR_BUILD=$(CC_FOR_BUILD)"
+
+# Flags to pass down to makes which are built with the target
+# environment (e.g. libg++, xiberty, newlib).
+TARGET_FLAGS_TO_PASS = \
+       "prefix=$(prefix)" \
+       "exec_prefix=$(exec_prefix)" \
+       "tooldir=$(tooldir)" \
+       "AR_FLAGS=$(AR_FLAGS)" \
+       "CFLAGS=$(CFLAGS)" \
+       "LOADLIBES=$(LOADLIBES)" \
+       "LDFLAGS=$(LDFLAGS)" \
+       "BISON=$(BISON)" \
+       "LEX=$(LEX)" \
+       "MAKEINFO=$(MAKEINFO)" \
+       "INSTALL=$(INSTALL)" \
+       "INSTALL_DATA=$(INSTALL_DATA)" \
+       "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+       "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+       "CC=$(CC_FOR_TARGET)" \
+       "AS=$(AS_FOR_TARGET)" \
+       "AR=$(AR_FOR_TARGET)" \
+       "RANLIB=$(RANLIB_FOR_TARGET)" \
+       "NM=$(NM_FOR_TARGET)" \
+       "XTRAFLAGS=$(XTRAFLAGS)"
 
 .PHONY: all info install-info clean-info
 .NOEXPORT:
@@ -111,22 +203,18 @@ all:      $(ALL)
 info:  
        @rootme=`pwd` ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) subdir_do DO=info "DODIRS=$(SUBDIRS)" 
 
-# Note libg++ has to be handled specially (we can't compile it with CC=cc).
 check:
-       @rootme=`pwd` ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) subdir_do DO=check \
-         "DODIRS=`echo $(SUBDIRS) | sed -e \"s/libg\+\+//\"" 
-       @rootme=`pwd` ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) subdir_do DO=check \
-         "DODIRS=libg++" "CC=${GXX}" "XTRAFLAGS=${XTRAFLAGS}"
+       @rootme=`pwd` ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) DO=check "DODIRS=$(SUBDIRS)" subdir_do
 
 clean-info:
-       @$(MAKE) $(FLAGS_TO_PASS)  subdir_do DO=clean-info "DODIRS=$(SUBDIRS)"
-       
+       @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) DO=clean-info "DODIRS=$(SUBDIRS)" subdir_do
+
 install-info: install-info-dirs force
        -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
        if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
        -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
-       @$(MAKE) $(FLAGS_TO_PASS) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
-       @$(MAKE) $(FLAGS_TO_PASS) dir.info install-dir.info
+       @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) DO=install-info "DODIRS=$(SUBDIRS)" subdir_do
+       @rootme='pwd' ; export rootme ; $(MAKE) $(FLAGS_TO_PASS) dir.info install-dir.info
 
 install-dir.info:
        -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
@@ -135,23 +223,23 @@ install-dir.info:
        $(INSTALL_DATA) dir.info $(infodir)/dir.info
 
 all.normal: all-autoconf all-libiberty all-mmalloc all-texinfo \
-       all-byacc all-flex all-bfd all-ld all-gas all-tgas all-gcc \
-       all-binutils all-libg++ all-readline all-gdb \
+       all-byacc all-flex all-opcodes all-bfd all-ld all-gas all-tgas \
+       all-gcc all-binutils  all-libg++ all-readline all-gdb \
        all-make all-rcs all-cvs all-diff all-grep \
        all-patch all-emacs all-ispell all-etc \
        all-newlib all-gprof all-send_pr all-libm
 
 all.cross: all-libiberty all-mmalloc all-gas all-byacc all-flex all-ld \
-       all-bfd all-readline all-gdb all-binutils all-gcc all-newlib
-#      $(MAKE) $(FLAGS_TO_PASS) subdir_do DO=all "DODIRS=$(SUBDIRS) $(OTHERS)"
+        all-opcodes all-bfd all-readline all-gdb all-binutils all-gcc \
+       all-newlib
 
 clean: clean-autoconf clean-libiberty clean-mmalloc clean-texinfo \
        clean-bfd clean-newlib clean-binutils clean-flex \
-       clean-byacc clean-ld clean-gas clean-etc \
+       clean-byacc clean-ld clean-gas clean-etc clean-opcodes \
        clean-gcc clean-readline clean-glob clean-gdb \
        clean-make clean-diff clean-grep clean-rcs \
        clean-cvs clean-patch clean-emacs clean-ispell \
-       clean-libg++ clean-gprof clean-send_pr clean-libm
+       clean-libg++ clean-gprof clean-send_pr clean-libm clean-xiberty
        -rm -rf *.a TEMP errs core *.o *~ \#* TAGS *.E
 
 clean-stamps:
@@ -170,11 +258,12 @@ install.all: install-no-fixedincludes
        else \
                true ; \
        fi
+
 install-no-fixedincludes: install-dirs gcc-no-fixedincludes \
        install-autoconf \
        install-bfd \
        install-binutils \
+       install-opcodes \
        install-byacc \
        install-cvs \
        install-diff \
@@ -211,16 +300,16 @@ gcc-no-fixedincludes:
        fi
 
 install.cross: install-dirs install-libiberty install-mmalloc \
-        install-binutils install-byacc install-flex \
+        install-binutils install-opcodes install-byacc install-flex \
         install-ld install-gas install-readline \
         install-glob install-gdb install-mmalloc \
         install-newlib install-gcc install-etc
 
 ### autoconf
 all-autoconf: force
-       if [ -f ./autoconf/Makefile ] ; then \
+       @if [ -f ./autoconf/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
-               (cd ./autoconf; echo "XX" $${rootme} "XXX" ; $(MAKE) $(FLAGS_TO_PASS) all) ; \
+               (cd ./autoconf; $(MAKE) $(FLAGS_TO_PASS) all) ; \
        else \
                true ; \
        fi
@@ -294,6 +383,37 @@ install-libiberty: force
                true ; \
        fi
 
+### xiberty
+all-xiberty: all-gcc all-newlib
+       @if [ -f ./xiberty/Makefile ] ; then \
+               rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd`; export srcroot ; \
+               (cd ./xiberty; \
+               $(MAKE) $(FLAGS_TO_PASS) all) ; \
+       else \
+               true ; \
+       fi
+
+clean-xiberty: force
+       @if [ -f ./xiberty/Makefile ] ; then \
+               rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd`; export srcroot ; \
+               (cd ./xiberty; \
+               $(MAKE) $(FLAGS_TO_PASS) clean) ; \
+       else \
+               true ; \
+       fi
+
+install-xiberty: force
+       @if [ -f ./xiberty/Makefile ] ; then \
+               rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd`; export srcroot ; \
+               (cd ./xiberty; \
+               $(MAKE) $(FLAGS_TO_PASS) install) ; \
+       else \
+               true ; \
+       fi
+
 ### mmalloc
 all-mmalloc: force
        @if [ -f ./mmalloc/Makefile ] ; then \
@@ -325,7 +445,6 @@ install-mmalloc: force
 ### texinfo
 all-texinfo: all-libiberty
        @if [ -f ./texinfo/Makefile ] ; then \
-               rootme=`pwd` ; export rootme ; \
                rootme=`pwd` ; export rootme ; \
                (cd ./texinfo; \
                $(MAKE) $(FLAGS_TO_PASS) all) ; \
@@ -379,8 +498,37 @@ install-bfd: force
                true ; \
        fi
 
+
+### opcodes
+all-opcodes: force
+       @if [ -f ./opcodes/Makefile ] ; then \
+               rootme=`pwd` ; export rootme ; \
+               (cd ./opcodes; \
+               $(MAKE) $(FLAGS_TO_PASS) all) ; \
+       else \
+               true ; \
+       fi
+
+clean-opcodes: force
+       @if [ -f ./opcodes/Makefile ] ; then \
+               rootme=`pwd` ; export rootme ; \
+               (cd ./opcodes; \
+               $(MAKE) $(FLAGS_TO_PASS) clean) ; \
+       else \
+               true ; \
+       fi
+
+install-opcodes: force
+       @if [ -f ./opcodes/Makefile ] ; then \
+               rootme=`pwd` ; export rootme ; \
+               (cd ./opcodes; \
+               $(MAKE) $(FLAGS_TO_PASS) install) ; \
+       else \
+               true ; \
+       fi
+
 ### binutils
-all-binutils: all-libiberty all-bfd all-flex
+all-binutils: all-opcodes all-libiberty all-bfd all-flex
        @if [ -f ./binutils/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
                (cd ./binutils; \
@@ -408,11 +556,12 @@ install-binutils: force
        fi
 
 ### newlib
-all-newlib: force
+all-newlib: all-binutils all-ld all-gas all-gcc
        @if [ -f ./newlib/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
                (cd ./newlib; \
-               $(MAKE) $(FLAGS_TO_PASS) all) ; \
+               $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
        else \
                true ; \
        fi
@@ -420,8 +569,9 @@ all-newlib: force
 clean-newlib: force
        @if [ -f ./newlib/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
                (cd ./newlib; \
-               $(MAKE) $(FLAGS_TO_PASS) clean) ; \
+               $(MAKE) $(TARGET_FLAGS_TO_PASS) clean) ; \
        else \
                true ; \
        fi
@@ -429,8 +579,9 @@ clean-newlib: force
 install-newlib: force
        @if [ -f ./newlib/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
                (cd ./newlib; \
-               $(MAKE) $(FLAGS_TO_PASS) install) ; \
+               $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
        else \
                true ; \
        fi
@@ -438,21 +589,27 @@ install-newlib: force
 ### gprof
 all-gprof: all-libiberty all-bfd
        @if [ -f ./gprof/Makefile ] ; then \
-               (cd gprof; $(MAKE) $(FLAGS_TO_PASS) all) ; \
+               rootme=`pwd` ; export rootme ; \
+               (cd ./gprof; \
+               $(MAKE) $(FLAGS_TO_PASS) all) ; \
        else \
                true ; \
        fi
 
 clean-gprof: force
        @if [ -f ./gprof/Makefile ] ; then \
-               (cd gprof; $(MAKE) $(FLAGS_TO_PASS) clean) ; \
+               rootme=`pwd` ; export rootme ; \
+               (cd ./gprof; \
+               $(MAKE) $(FLAGS_TO_PASS) clean) ; \
        else \
                true ; \
        fi
 
 install-gprof: force
        @if [ -f ./gprof/Makefile ] ; then \
-               (cd gprof; $(MAKE) $(FLAGS_TO_PASS) install) ; \
+               rootme=`pwd` ; export rootme ; \
+               (cd ./gprof; \
+               $(MAKE) $(FLAGS_TO_PASS) install) ; \
        else \
                true ; \
        fi
@@ -597,7 +754,7 @@ install-glob: force
        fi
 
 ### gas
-all-gas: all-libiberty all-bfd
+all-gas: all-libiberty all-opcodes all-bfd
        @if [ -f ./gas/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
                (cd ./gas; \
@@ -664,7 +821,7 @@ install-ld: force
        fi
 
 ### gdb
-all-gdb: all-bfd all-libiberty all-mmalloc all-readline all-glob all-byacc
+all-gdb: all-bfd all-opcodes all-libiberty all-mmalloc all-readline all-glob all-byacc
        @if [ -f ./gdb/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
                (cd ./gdb; \
@@ -978,8 +1135,9 @@ install-libm: force
 all-libg++: all-gas all-ld all-gcc
        @if [ -f ./libg++/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
                (cd ./libg++; \
-               $(MAKE) $(FLAGS_TO_PASS) "CC=${GXX}" all) ; \
+               $(MAKE) $(TARGET_FLAGS_TO_PASS) all) ; \
        else \
                true ; \
        fi
@@ -987,8 +1145,9 @@ all-libg++: all-gas all-ld all-gcc
 clean-libg++: force
        @if [ -f ./libg++/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
                (cd ./libg++; \
-               $(MAKE) $(FLAGS_TO_PASS) "CC=${GXX}" clean) ; \
+               $(MAKE) $(TARGET_FLAGS_TO_PASS) clean) ; \
        else \
                true ; \
        fi
@@ -996,8 +1155,9 @@ clean-libg++: force
 install-libg++: force
        @if [ -f ./libg++/Makefile ] ; then \
                rootme=`pwd` ; export rootme ; \
+               srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
                (cd ./libg++; \
-               $(MAKE) $(FLAGS_TO_PASS) "CC=${GXX}" install) ; \
+               $(MAKE) $(TARGET_FLAGS_TO_PASS) install) ; \
        else \
                true ; \
        fi
@@ -1011,16 +1171,23 @@ all.xclib:      all.normal
 
 subdir_do:
        @for i in $(DODIRS); do \
-               if [ -f ./$$i/localenv ] ; then \
-                       if (rootme=`pwd` ; export rootme ; cd ./$$i; \
-                               $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
-                               else exit 1 ; fi ; \
-               else if [ -f ./$$i/Makefile ] ; then \
-                       if (rootme=`pwd` ; export rootme ; cd ./$$i; \
-                               $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
-                       else exit 1 ; fi ; \
-               else true ; fi ; \
-       fi ; \
+         if [ -f ./$$i/localenv ] || [ -f ./$$i/Makefile ] ; then \
+           case $$i in \
+           libg++ | xiberty | newlib) \
+             if (rootme=`pwd` ; export rootme ; \
+                 srcroot=`cd $(srcdir); pwd` ; export srcroot ; \
+                 cd ./$$i ; \
+                 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
+             else exit 1 ; fi \
+             ;; \
+           *) \
+             if (rootme=`pwd` ; export rootme ; \
+                 cd ./$$i ; \
+                 $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \
+             else exit 1 ; fi \
+             ;; \
+           esac ; \
+         else true ; fi ; \
        done
 
 # The "else true" stuff is for Ultrix; the shell returns the exit code
@@ -1107,8 +1274,8 @@ Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
 # Build GDB distributions that contain BFD, Include, Libiberty, Readline, etc
 
 DEVO_SUPPORT= README cfg-paper.texi Makefile.in configure configure.in \
-       config.sub config configure.man move-if-change
-GDB_SUPPORT_DIRS= bfd include libiberty mmalloc readline glob
+       config.sub config configure.man configure.texi move-if-change
+GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline glob
 GDB_SUPPORT_FILES= $(GDB_SUPPORT_DIRS) texinfo/fsf/texinfo.tex
 
 setup-dirs: force_update
@@ -1117,11 +1284,6 @@ setup-dirs: force_update
        ./configure -rm sun4
        chmod og=u `find $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) -print`
 
-bfd.ilrt.tar.Z: setup-dirs
-       rm -f bfd.ilrt.tar.Z
-       tar cf - $(DEVO_SUPPORT) $(GDB_SUPPORT_FILES) \
-               | compress -v >bfd.ilrt.tar.Z
-
 gdb.tar.Z: setup-dirs
        (cd gdb; $(MAKE) -f Makefile.in make-proto-gdb.dir)
        $(MAKE) $(MFLAGS) -f Makefile.in make-gdb.tar.Z
This page took 0.035801 seconds and 4 git commands to generate.