home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / sources / tools / riscbsd_ga / riscbsd_ga~ / riscbsd-gas / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-02-16  |  29.6 KB  |  1,099 lines

  1. #
  2. # Makefile for directory with subdirs to build.
  3. #   Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation
  4. #
  5. # This file is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16. #
  17.  
  18. srcdir = .
  19.  
  20. prefix = /usr/local
  21.  
  22. exec_prefix = $(prefix)
  23. bindir = $(exec_prefix)/bin
  24. libdir = $(exec_prefix)/lib
  25. tooldir = $(exec_prefix)/$(target)
  26.  
  27. program_transform_name =
  28.  
  29. datadir = $(prefix)/lib
  30. mandir = $(prefix)/man
  31. man1dir = $(mandir)/man1
  32. man2dir = $(mandir)/man2
  33. man3dir = $(mandir)/man3
  34. man4dir = $(mandir)/man4
  35. man5dir = $(mandir)/man5
  36. man6dir = $(mandir)/man6
  37. man7dir = $(mandir)/man7
  38. man8dir = $(mandir)/man8
  39. man9dir = $(mandir)/man9
  40. infodir = $(prefix)/info
  41. includedir = $(prefix)/include
  42. docdir = $(datadir)/doc
  43.  
  44. SHELL = /bin/sh
  45.  
  46. INSTALL = $${srcroot}/install.sh -c
  47. INSTALL_PROGRAM = $(INSTALL)
  48. INSTALL_DATA = $(INSTALL) -m 644
  49. INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
  50.  
  51. INSTALL_DOSREL = install-dosrel-fake
  52.  
  53. AS = as
  54. AR = ar
  55. AR_FLAGS = rc
  56. CC = gcc
  57.  
  58. # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
  59. # here so that they can be overridden by Makefile fragments.
  60. HOST_CC = $(CC_FOR_BUILD)
  61. HOST_PREFIX = 
  62. HOST_PREFIX_1 = loser-
  63.  
  64. # We don't specify -g -O because many compilers don't support -g -O,
  65. # and/or -O is broken in and of itself.
  66. CFLAGS = -g -O2
  67.  
  68. CXX = gcc
  69.  
  70. # Use -O2 to stress test the compiler.
  71. CXXFLAGS = -g -O2 -fexternal-templates
  72.  
  73. RANLIB = ranlib
  74. NM = nm
  75. # Not plain GZIP, since gzip looks there for extra command-line options.
  76. GZIPPROG = gzip
  77.  
  78. M4 = `if [ -f $$r/m4/m4 ] ; \
  79.     then echo $$r/m4/m4 ; \
  80.     else echo m4 ; fi`
  81.  
  82. MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
  83.     then echo $$r/texinfo/makeinfo/makeinfo ; \
  84.     else echo makeinfo ; fi`
  85.  
  86. # This just becomes part of the MAKEINFO definition passed down to
  87. # sub-makes.  It lets flags be given on the command line while still
  88. # using the makeinfo from the object tree.
  89. MAKEINFOFLAGS =
  90.  
  91. EXPECT = `if [ -f $$r/expect/expect ] ; \
  92.     then echo $$r/expect/expect ; \
  93.     else echo expect ; fi`
  94.  
  95. RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
  96.     then echo $${srcroot}/dejagnu/runtest ; \
  97.     else echo runtest ; fi`
  98.  
  99.  
  100. # libraries that may need to be augmented on a system-by-system basis
  101. X11_LIB = -lX11
  102.  
  103. # compilers to use to create programs which must be run in the build
  104. # environment.
  105. CC_FOR_BUILD = $(CC)
  106. CXX_FOR_BUILD = $(CXX)
  107.  
  108. SUBDIRS = "this is set via configure, don't edit this"
  109. OTHERS = 
  110.  
  111. ALL = all.normal
  112. INSTALL_TARGET = install-dirs \
  113.     $(INSTALL_MODULES) \
  114.     $(INSTALL_TARGET_MODULES) \
  115.     $(INSTALL_X11_MODULES) \
  116.     install-gcc \
  117.     $(INSTALL_DOSREL)
  118.  
  119.  
  120. CC_FOR_TARGET = ` \
  121.   if [ -f $$r/gcc/Makefile ] ; then \
  122.     if [ -f $$r/newlib/Makefile ] ; then \
  123.       echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
  124.     else \
  125.       echo $$r/gcc/xgcc -B$$r/gcc/; \
  126.     fi; \
  127.   else \
  128.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  129.       echo $(CC); \
  130.     else \
  131.       t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
  132.     fi; \
  133.   fi`
  134.  
  135.  
  136. CXX_FOR_TARGET = ` \
  137.   if [ -f $$r/gcc/Makefile ] ; then \
  138.     if [ -f $$r/newlib/Makefile ] ; then \
  139.       echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
  140.     else \
  141.       echo $$r/gcc/xgcc -B$$r/gcc/; \
  142.     fi; \
  143.   else \
  144.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  145.       echo $(CXX); \
  146.     else \
  147.       t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
  148.     fi; \
  149.   fi`
  150.  
  151. AS_FOR_TARGET = ` \
  152.   if [ -f $$r/gas/Makefile ] ; then \
  153.     echo $$r/gas/as.new ; \
  154.   else \
  155.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  156.       echo $(AS); \
  157.     else \
  158.        t='$(program_transform_name)'; echo as | sed -e 's/brokensed/brokensed/' $$t ; \
  159.     fi; \
  160.   fi`
  161.  
  162. AR_FOR_TARGET = ` \
  163.   if [ -f $$r/binutils/ar ] ; then \
  164.     echo $$r/binutils/ar ; \
  165.   else \
  166.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  167.       echo $(AR); \
  168.     else \
  169.        t='$(program_transform_name)'; echo ar | sed -e 's/brokensed/brokensed/' $$t ; \
  170.     fi; \
  171.   fi`
  172.  
  173. RANLIB_FOR_TARGET = ` \
  174.   if [ -f $$r/binutils/ranlib ] ; then \
  175.     echo $$r/binutils/ranlib ; \
  176.   else \
  177.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  178.       echo $(RANLIB); \
  179.     else \
  180.        t='$(program_transform_name)'; echo ranlib | sed -e 's/brokensed/brokensed/' $$t ; \
  181.     fi; \
  182.   fi`
  183.  
  184. NM_FOR_TARGET = ` \
  185.   if [ -f $$r/binutils/Makefile ] ; then \
  186.     echo $$r/binutils/nm.new ; \
  187.   else \
  188.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  189.       echo $(NM); \
  190.     else \
  191.        t='$(program_transform_name)'; echo nm | sed -e 's/brokensed/brokensed/' $$t ; \
  192.     fi; \
  193.   fi`
  194.  
  195.  
  196. #### host and target specific makefile fragments come in here.
  197. ###
  198.  
  199. # Flags to pass down to all sub-makes.
  200. # Please keep these in alphabetical order.
  201. BASE_FLAGS_TO_PASS = \
  202.     "AR_FLAGS=$(AR_FLAGS)" \
  203.     "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
  204.     "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
  205.     "BISON=$(BISON)" \
  206.     "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
  207.     "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
  208.     "CFLAGS=$(CFLAGS)" \
  209.     "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
  210.     "CXXFLAGS=$(CXXFLAGS)" \
  211.     "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
  212.     "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
  213.     "INSTALL=$(INSTALL)" \
  214.     "INSTALL_DATA=$(INSTALL_DATA)" \
  215.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  216.     "INSTALL_XFORM=$(INSTALL_XFORM)" \
  217.     "LDFLAGS=$(LDFLAGS)" \
  218.     "LEX=$(LEX)" \
  219.     "M4=$(M4)" \
  220.     "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
  221.     "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
  222.     "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
  223.     "SHELL=$(SHELL)" \
  224.     "EXPECT=$(EXPECT)" \
  225.     "RUNTEST=$(RUNTEST)" \
  226.     "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  227.     "YACC=$(BISON)" \
  228.     "exec_prefix=$(exec_prefix)" \
  229.     "prefix=$(prefix)" \
  230.     "tooldir=$(tooldir)" 
  231.  
  232. # Flags to pass down to most sub-makes, in which we're building with
  233. # the host environment.
  234. # If any variables are added here, they must be added to do-*, below.
  235. EXTRA_HOST_FLAGS = \
  236.     'AR=$(AR)' \
  237.     'AS=$(AS)' \
  238.     'CC=$(CC)' \
  239.     'CXX=$(CXX)' \
  240.     'NM=$(NM)' \
  241.     'RANLIB=$(RANLIB)'
  242.  
  243. FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
  244.  
  245. # Flags that are concerned with the location of the X11 include files
  246. # and library files
  247. X11_FLAGS_TO_PASS = \
  248.     "X11_INCLUDE_FLAGS=$(X11_INCLUDE_FLAGS)" \
  249.     "X11_LIB_FLAGS=$(X11_LIB_FLAGS)" \
  250.     "X11_LIB=$(X11_LIB)"
  251.  
  252. # Flags to pass down to makes which are built with the target environment.
  253. # The double $ decreases the length of the command line; the variables
  254. # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
  255. # If any variables are added here, they must be added to do-*, below.
  256. EXTRA_TARGET_FLAGS = \
  257.     'AR=$$(AR_FOR_TARGET)' \
  258.     'AS=$$(AS_FOR_TARGET)' \
  259.     'CC=$$(CC_FOR_TARGET)' \
  260.     'CXX=$$(CXX_FOR_TARGET)' \
  261.     'NM=$$(NM_FOR_TARGET)' \
  262.     'RANLIB=$$(RANLIB_FOR_TARGET)'
  263.  
  264. TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
  265.  
  266. # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
  267. # unfortunately needs the native compiler and the target ar and
  268. # ranlib.
  269. # If any variables are added here, they must be added to do-*, below.
  270. # The HOST_* variables are a special case, which are used for the gcc
  271. # cross-building scheme.
  272. EXTRA_GCC_FLAGS = \
  273.     'AR=$$(AR_FOR_TARGET)' \
  274.     'AS=$(AS)' \
  275.     'CC=$(CC)' \
  276.     'CXX=$(CXX)' \
  277.     'HOST_CC=$(CC_FOR_BUILD)' \
  278.     'HOST_PREFIX=$(HOST_PREFIX)' \
  279.     'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
  280.     'NM=$(NM)' \
  281.     'RANLIB=$$(RANLIB_FOR_TARGET)'
  282.  
  283. GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
  284.  
  285. # This is a list of the targets for all of the modules which are compiled
  286. # using $(FLAGS_TO_PASS).
  287. ALL_MODULES = \
  288.     all-autoconf \
  289.     all-bfd \
  290.     all-binutils \
  291.     all-byacc \
  292.     all-cvs \
  293.     all-dejagnu \
  294.     all-diff \
  295.     all-dosutils \
  296.     all-etc \
  297.     all-fileutils \
  298.     all-find \
  299.     all-flex \
  300.     all-gas \
  301.     all-gawk \
  302.     all-gdb \
  303.     all-gprof \
  304.     all-grep \
  305.     all-gzip \
  306.     all-hello \
  307.     all-indent \
  308.     all-ispell \
  309.     all-ld \
  310.     all-libiberty \
  311.     all-m4 \
  312.     all-make \
  313.     all-mmalloc \
  314.     all-opcodes \
  315.     all-pagas \
  316.     all-patch \
  317.     all-prms \
  318.     all-rcs \
  319.     all-readline \
  320.     all-release \
  321.     all-recode \
  322.     all-sed \
  323.     all-send-pr \
  324.     all-shellutils \
  325.     all-sim \
  326.     all-tar \
  327.     all-tcl \
  328.     all-texinfo \
  329.     all-textutils \
  330.     all-tgas \
  331.     all-time \
  332.     all-uudecode \
  333.     all-wdiff 
  334.  
  335. # This is a list of the check targets for all of the modules which are
  336. # compiled using $(FLAGS_TO_PASS).
  337. # This is a list of the check targets for all of the modules which are
  338. # compiled using $(FLAGS_TO_PASS).
  339. #
  340. # The list is in two parts.  The first lists those tools which
  341. # are tested as part of the host's native tool-chain, and not
  342. # tested in a cross configuration.
  343. NATIVE_CHECK_MODULES = \
  344.     check-byacc \
  345.     check-flex
  346.  
  347. CROSS_CHECK_MODULES = \
  348.     check-autoconf \
  349.     check-bfd \
  350.     check-binutils \
  351.     check-cvs \
  352.     check-dejagnu \
  353.     check-diff \
  354.     check-etc \
  355.     check-fileutils \
  356.     check-find \
  357.     check-gas \
  358.     check-gawk \
  359.     check-gdb \
  360.     check-gprof \
  361.     check-grep \
  362.     check-gzip \
  363.     check-hello \
  364.     check-indent \
  365.     check-ispell \
  366.     check-ld \
  367.     check-libiberty \
  368.     check-m4 \
  369.     check-make \
  370.     check-mmcheckoc \
  371.     check-opcodes \
  372.     check-pagas \
  373.     check-patch \
  374.     check-prms \
  375.     check-rcs \
  376.     check-readline \
  377.     check-recode \
  378.     check-sed \
  379.     check-send-pr \
  380.     check-shellutils \
  381.     check-sim \
  382.     check-tar \
  383.     check-tcl \
  384.     check-texinfo \
  385.     check-textutils \
  386.     check-tgas \
  387.     check-time \
  388.     check-uudecode \
  389.     check-wdiff
  390.  
  391. CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
  392.  
  393. # This is a list of the install targets for all of the modules which are
  394. # compiled using $(FLAGS_TO_PASS).
  395. INSTALL_MODULES = \
  396.     install-autoconf \
  397.     install-bfd \
  398.     install-binutils \
  399.     install-byacc \
  400.     install-cvs \
  401.     install-dejagnu \
  402.     install-diff \
  403.     install-dosutils \
  404.     install-etc \
  405.     install-fileutils \
  406.     install-find \
  407.     install-flex \
  408.     install-gas \
  409.     install-gawk \
  410.     install-gdb \
  411.     install-glob \
  412.     install-gprof \
  413.     install-grep \
  414.     install-gzip \
  415.     install-hello \
  416.     install-indent \
  417.     install-ispell \
  418.     install-ld \
  419.     install-libiberty \
  420.     install-m4 \
  421.     install-make \
  422.     install-mmalloc \
  423.     install-opcodes \
  424.     install-pagas \
  425.     install-patch \
  426.     install-prms \
  427.     install-rcs \
  428.     install-readline \
  429.     install-recode \
  430.     install-sed \
  431.     install-send-pr \
  432.     install-shellutils \
  433.     install-sim \
  434.     install-tar \
  435.     install-tcl \
  436.     install-textutils \
  437.     install-tgas \
  438.     install-time \
  439.     install-uudecode \
  440.     install-wdiff
  441.  
  442. # This is a list of the targets for all of the modules which are compiled
  443. # using $(X11_FLAGS_TO_PASS).
  444. ALL_X11_MODULES = \
  445.     all-emacs \
  446.     all-emacs19 \
  447.     all-expect \
  448.     all-gash \
  449.     all-tclX \
  450.     all-tk
  451.  
  452. # This is a list of the check targets for all of the modules which are
  453. # compiled using $(X11_FLAGS_TO_PASS).
  454. CHECK_X11_MODULES = \
  455.     check-emacs \
  456.     check-expect \
  457.     check-gash \
  458.     check-tclX \
  459.     check-tk
  460.  
  461. # This is a list of the install targets for all the modules which are
  462. # compiled using $(X11_FLAGS_TO_PASS).
  463. INSTALL_X11_MODULES = \
  464.     install-emacs \
  465.     install-emacs19 \
  466.     install-expect \
  467.     install-gash \
  468.     install-tclX \
  469.     install-tk
  470.  
  471. # This is a list of the targets for all of the modules which are compiled
  472. # using $(TARGET_FLAGS_TO_PASS).
  473. ALL_TARGET_MODULES = \
  474.     all-libio \
  475.     all-librx \
  476.     all-libg++ \
  477.     all-newlib \
  478.     all-xiberty
  479.  
  480. # This is a list of the check targets for all of the modules which are
  481. # compiled using $(TARGET_FLAGS_TO_PASS).
  482. CHECK_TARGET_MODULES = \
  483.     check-libio \
  484.     check-libg++ \
  485.     check-newlib \
  486.     check-xiberty
  487.  
  488. # This is a list of the install targets for all of the modules which are
  489. # compiled using $(TARGET_FLAGS_TO_PASS).
  490. INSTALL_TARGET_MODULES = \
  491.     install-libio \
  492.     install-libg++ \
  493.     install-newlib \
  494.     install-xiberty
  495.  
  496. # This is a shell case of all modules which are compiled using
  497. # $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
  498. TARGET_LIBS = libio | librx | libg++ | newlib | xiberty
  499.  
  500. # The first rule in the file had better be this one.  Don't put any above it.
  501. all: all.normal
  502. .PHONY: all
  503.  
  504. # The target built for a native build.
  505. .PHONY: all.normal
  506. all.normal: \
  507.     $(ALL_MODULES) \
  508.     $(ALL_TARGET_MODULES) \
  509.     $(ALL_X11_MODULES) \
  510.     all-gcc
  511.  
  512. # Do a target for all the subdirectories.  A ``make do-X'' will do a
  513. # ``make X'' in all subdirectories (because, in general, there is a
  514. # dependency (below) of X upon do-X, a ``make X'' will also do this,
  515. # but it may do additional work as well).
  516. # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
  517. # because it is so large that it can easily overflow the command line
  518. # length limit on some systems.
  519. DO_X = \
  520.     do-clean \
  521.     do-distclean \
  522.     do-dvi \
  523.     do-info \
  524.     do-install-info \
  525.     do-installcheck \
  526.     do-mostlyclean \
  527.     do-realclean \
  528.     do-TAGS
  529. .PHONY: $(DO_X)
  530. $(DO_X):
  531.     @target=`echo $@ | sed -e 's/^do-//'`; \
  532.     r=`pwd`; export r; \
  533.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  534.     for i in $(SUBDIRS); do \
  535.       if [ -f ./$$i/Makefile ]; then \
  536.         case $$i in \
  537.         $(TARGET_LIBS) ) \
  538.           for flag in $(EXTRA_TARGET_FLAGS); do \
  539.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  540.           done; \
  541.           ;; \
  542.         gcc) \
  543.           for flag in $(EXTRA_GCC_FLAGS); do \
  544.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  545.           done; \
  546.           ;; \
  547.         *) \
  548.           for flag in $(EXTRA_HOST_FLAGS); do \
  549.         eval `echo "$$flag" | sed -e "s|^\(.*\)=\(.*\)|\1='\2'|"`; \
  550.           done; \
  551.           ;; \
  552.         esac ; \
  553.         export AR AS CC CXX NM RANLIB; \
  554.         if (cd ./$$i; \
  555.             $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  556.             "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
  557.             "RANLIB=$${RANLIB}" \
  558.             $${target}); \
  559.         then true; else exit 1; fi; \
  560.       else true; fi; \
  561.     done
  562.  
  563. # Here are the targets which correspond to the do-X targets.
  564.  
  565. .PHONY: info installcheck dvi install-info
  566. .PHONY: clean distclean mostlyclean realclean local-clean local-distclean
  567. info: do-info
  568. installcheck: do-installcheck
  569. dvi: do-dvi
  570.  
  571. install-info: do-install-info dir.info
  572.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  573.     if [ -f dir.info ] ; then \
  574.       $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
  575.     else true ; fi
  576.  
  577. local-clean:
  578.     -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
  579.  
  580. local-distclean:
  581.     -rm -f Makefile config.status
  582.  
  583. clean: do-clean local-clean
  584. mostlyclean: do-mostlyclean local-clean
  585. distclean: do-distclean local-clean local-distclean
  586. realclean: do-realclean local-clean local-distclean
  587.  
  588. # Check target.
  589.  
  590. .PHONY: check
  591. check: $(CHECK_MODULES) \
  592.     $(CHECK_TARGET_MODULES) \
  593.     $(CHECK_X11_MODULES) \
  594.     check-gcc
  595.  
  596. # Installation targets.
  597.  
  598. .PHONY: install uninstall vault-install
  599. install: $(INSTALL_TARGET) 
  600.  
  601. uninstall:
  602.     @echo "the uninstall target is not supported in this tree"
  603.  
  604. vault-install:
  605.     @if [ -f ./release/vault-install ] ; then \
  606.       ./release/vault-install $(host_alias) $(target_alias) ; \
  607.     else \
  608.       true ; \
  609.     fi
  610.  
  611. .PHONY: install.all
  612. install.all: install-no-fixedincludes
  613.     @if [ -f ./gcc/Makefile ] ; then \
  614.         r=`pwd` ; export r ; \
  615.         (cd ./gcc; \
  616.         $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
  617.     else \
  618.         true ; \
  619.     fi
  620.  
  621. # install-no-fixedincludes is used because Cygnus can not distribute
  622. # the fixed header files.
  623. .PHONY: install-no-fixedincludes
  624. install-no-fixedincludes: \
  625.     install-dirs \
  626.     $(INSTALL_MODULES) \
  627.     $(INSTALL_TARGET_MODULES) \
  628.     $(INSTALL_X11_MODULES) \
  629.     gcc-no-fixedincludes 
  630.  
  631. # Install the gcc headers files, but not the fixed include files,
  632. # which Cygnus is not allowed to distribute.  This rule is very
  633. # dependent on the workings of the gcc Makefile.in.
  634. .PHONY: gcc-no-fixedincludes
  635. gcc-no-fixedincludes:
  636.     @if [ -f ./gcc/Makefile ]; then \
  637.       rm -rf gcc/tmp-include; \
  638.       mv gcc/include gcc/tmp-include 2>/dev/null; \
  639.       mkdir gcc/include; \
  640.       cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
  641.       touch gcc/stmp-fixinc gcc/include/fixed; \
  642.       rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
  643.       r=`pwd`; export r; \
  644.       srcroot=`cd $(srcdir); pwd` ; export srcroot; \
  645.       (cd ./gcc; \
  646.        $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  647.       rm -rf gcc/include; \
  648.       mv gcc/tmp-include gcc/include 2>/dev/null; \
  649.     else true; fi
  650.  
  651. # This rule is used to build the modules which use FLAGS_TO_PASS.  To
  652. # build a target all-X means to cd to X and make all.
  653. # all-glob is handled specially because it doesn't actually build.
  654. #
  655. # all-gui, and all-libproc are handled specially because
  656. # they are still experimental, and if they fail to build, that
  657. # shouldn't stop "make all".
  658. .PHONY: $(ALL_MODULES) all-glob all-gui all-libproc
  659. $(ALL_MODULES) all-glob all-gui all-libproc:
  660.     @dir=`echo $@ | sed -e 's/all-//'`; \
  661.     if [ -d ./$${dir} ] ; then \
  662.       if [ -f ./$${dir}/Makefile ] ; then \
  663.         r=`pwd`; export r; \
  664.         srcroot=`cd $(srcdir); pwd`; export srcroot; \
  665.         (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
  666.       else \
  667.         true ; \
  668.       fi; \
  669.     else \
  670.       true; \
  671.     fi
  672.  
  673. # This rule is used to check the modules which use FLAGS_TO_PASS.  To
  674. # build a target check-X means to cd to X and make all.
  675.  
  676. .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
  677. $(NATIVE_CHECK_MODULES):
  678.     @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  679.       dir=`echo $@ | sed -e 's/check-//'`; \
  680.       if [ -d ./$${dir} ] ; then \
  681.         if [ -f ./$${dir}/Makefile ] ; then \
  682.           r=`pwd`; export r; \
  683.           srcroot=`cd $(srcdir); pwd`; export srcroot; \
  684.           (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
  685.         else \
  686.           true; \
  687.         fi ; \
  688.       fi; \
  689.     fi
  690.  
  691. $(CROSS_CHECK_MODULES):
  692.     @dir=`echo $@ | sed -e 's/check-//'`; \
  693.     if [ -f ./$${dir}/Makefile ] ; then \
  694.       r=`pwd`; export r; \
  695.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  696.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
  697.     else \
  698.       true; \
  699.     fi
  700.  
  701. # This rule is used to install the modules which use FLAGS_TO_PASS.
  702. # To build a target install-X means to cd to X and make install.
  703. .PHONY: $(INSTALL_MODULES)
  704. $(INSTALL_MODULES): install-dirs
  705.     @dir=`echo $@ | sed -e 's/install-//'`; \
  706.     if [ -f ./$${dir}/Makefile ] ; then \
  707.       r=`pwd`; export r; \
  708.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  709.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
  710.     else \
  711.       true; \
  712.     fi
  713.  
  714. # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
  715. # To build a target all-X means to cd to X and make all.
  716. .PHONY: $(ALL_TARGET_MODULES)
  717. $(ALL_TARGET_MODULES):
  718.     @dir=`echo $@ | sed -e 's/all-//'`; \
  719.     if [ -f ./$${dir}/Makefile ] ; then \
  720.       r=`pwd`; export r; \
  721.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  722.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
  723.     else \
  724.       true; \
  725.     fi
  726.  
  727. # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
  728. # To build a target install-X means to cd to X and make install.
  729. .PHONY: $(CHECK_TARGET_MODULES)
  730. $(CHECK_TARGET_MODULES):
  731.     @dir=`echo $@ | sed -e 's/check-//'`; \
  732.     if [ -f ./$${dir}/Makefile ] ; then \
  733.       r=`pwd`; export r; \
  734.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  735.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) check); \
  736.     else \
  737.       true; \
  738.     fi
  739.  
  740. # This rule is used to install the modules which use
  741. # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
  742. # and make install.
  743. .PHONY: $(INSTALL_TARGET_MODULES)
  744. $(INSTALL_TARGET_MODULES): install-dirs
  745.     @dir=`echo $@ | sed -e 's/install-//'`; \
  746.     if [ -f ./$${dir}/Makefile ] ; then \
  747.       r=`pwd`; export r; \
  748.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  749.       (cd $${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
  750.     else \
  751.       true; \
  752.     fi
  753.  
  754. # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
  755. # To build a target all-X means to cd to X and make all.
  756. .PHONY: $(ALL_X11_MODULES)
  757. $(ALL_X11_MODULES):
  758.     @dir=`echo $@ | sed -e 's/all-//'`; \
  759.     if [ -f ./$${dir}/Makefile ] ; then \
  760.       r=`pwd`; export r; \
  761.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  762.       (cd $${dir}; \
  763.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
  764.     else \
  765.       true; \
  766.     fi
  767.  
  768. # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
  769. # To build a target check-X means to cd to X and make all.
  770. .PHONY: $(CHECK_X11_MODULES)
  771. $(CHECK_X11_MODULES):
  772.     @dir=`echo $@ | sed -e 's/check-//'`; \
  773.     if [ -f ./$${dir}/Makefile ] ; then \
  774.       r=`pwd`; export r; \
  775.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  776.       (cd $${dir}; \
  777.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
  778.     else \
  779.       true; \
  780.     fi
  781.  
  782. # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
  783. # To build a target install-X means to cd to X and make install.
  784. .PHONY: $(INSTALL_X11_MODULES)
  785. $(INSTALL_X11_MODULES):
  786.     @dir=`echo $@ | sed -e 's/install-//'`; \
  787.     if [ -f ./$${dir}/Makefile ] ; then \
  788.       r=`pwd`; export r; \
  789.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  790.       (cd $${dir}; \
  791.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
  792.     else \
  793.       true; \
  794.     fi
  795.  
  796. # gcc is the only module which uses GCC_FLAGS_TO_PASS.
  797. .PHONY: all-gcc
  798. all-gcc:
  799.     @if [ -f ./gcc/Makefile ] ; then \
  800.       r=`pwd`; export r; \
  801.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  802.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
  803.     else \
  804.       true; \
  805.     fi
  806.  
  807. .PHONY: check-gcc
  808. check-gcc:
  809.     @if [ -f ./gcc/Makefile ] ; then \
  810.       r=`pwd`; export r; \
  811.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  812.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
  813.     else \
  814.       true; \
  815.     fi
  816.  
  817. .PHONY: install-gcc
  818. install-gcc:
  819.     @if [ -f ./gcc/Makefile ] ; then \
  820.       r=`pwd`; export r; \
  821.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  822.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  823.     else \
  824.       true; \
  825.     fi
  826.  
  827.  
  828. # EXPERIMENTAL STUFF
  829. # This rule is used to install the modules which use FLAGS_TO_PASS.
  830. # To build a target install-X means to cd to X and make install.
  831. .PHONY: install-dosrel
  832. install-dosrel: install-dirs info
  833.     @dir=`echo $@ | sed -e 's/install-//'`; \
  834.     if [ -f ./$${dir}/Makefile ] ; then \
  835.       r=`pwd`; export r; \
  836.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  837.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
  838.     else \
  839.       true; \
  840.     fi
  841.  
  842. install-dosrel-fake:
  843.  
  844.  
  845. # This is a list of inter-dependencies among modules.
  846. all-autoconf: all-m4
  847. all-bfd:
  848. all-binutils: all-libiberty all-opcodes all-bfd all-flex
  849. all-byacc:
  850. all-cvs:
  851. all-dejagnu: all-tcl all-expect all-tk
  852. all-diff: all-libiberty
  853. all-emacs:
  854. all-emacs19: all-byacc
  855. all-etc:
  856. all-expect: all-tcl all-tk
  857. all-fileutils: all-libiberty
  858. all-find:
  859. all-flex: all-libiberty all-byacc
  860. all-gas: all-libiberty all-opcodes all-bfd
  861. all-gash: all-tcl
  862. all-gawk:
  863. all-gcc: all-libiberty all-byacc all-binutils all-gas all-pagas
  864. all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-glob all-byacc all-sim all-gcc all-ld
  865. all-glob:
  866. all-gprof: all-libiberty all-bfd
  867. all-grep: all-libiberty
  868. all-gui: all-gdb all-libproc all-librx
  869. all-gzip: all-libiberty
  870. all-hello: all-libiberty
  871. all-indent:
  872. all-ispell: all-emacs # all-emacs19 ??? is this needed?
  873. all-ld: all-libiberty all-bfd all-byacc all-flex
  874. all-libg++: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib \
  875.     all-libio all-librx
  876. all-libio: all-gas all-pagas all-ld all-gcc all-xiberty all-newlib 
  877. all-libiberty:
  878. all-m4: all-libiberty
  879. all-make: all-libiberty
  880. all-mmalloc:
  881. all-newlib: all-binutils all-gas all-pagas all-gcc
  882. all-opcodes: all-bfd
  883. all-patch:
  884. all-prms: all-libiberty
  885. all-rcs:
  886. all-readline:
  887. all-recode: all-libiberty
  888. all-sed: all-libiberty
  889. all-send-pr: all-prms
  890. all-shellutils:
  891. all-sim: all-libiberty all-bfd
  892. all-tar: all-libiberty
  893. all-tcl:
  894. all-tclX: all-tcl all-tk
  895. all-tk: all-tcl
  896. all-texinfo: all-libiberty
  897. all-textutils:
  898. all-tgas: all-libiberty all-bfd
  899. all-time:
  900. all-wdiff:
  901. all-uudecode: all-libiberty
  902. all-xiberty: all-gcc all-ld all-newlib
  903.  
  904. ### other supporting targets
  905.  
  906. MAKEDIRS= \
  907.     $(prefix) \
  908.     $(exec_prefix) \
  909.     $(tooldir)
  910.  
  911. .PHONY: install-dirs
  912. install-dirs:
  913.     @for i in $(MAKEDIRS) ; do \
  914.         echo Making $$i... ; \
  915.         parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
  916.         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
  917.         if [ ! -d $$i ] ; then \
  918.             if mkdir $$i ; then \
  919.                 true ; \
  920.             else \
  921.                 exit 1 ; \
  922.             fi ; \
  923.         else \
  924.             true ; \
  925.         fi ; \
  926.     done
  927.  
  928.  
  929. dir.info: do-install-info
  930.     if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
  931.       $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
  932.       mv -f dir.info.new dir.info ; \
  933.     else true ; \
  934.     fi
  935.  
  936. dist:
  937.     @echo "Building a full distribution of this tree isn't done"
  938.     @echo "via 'make dist'.  Check out the etc/ subdirectory" 
  939.  
  940. etags tags: TAGS
  941.  
  942. # Right now this just builds TAGS in each subdirectory.  emacs19 has the
  943. # ability to use several tags files at once, so there is probably no need
  944. # to combine them into one big TAGS file (like CVS 1.3 does).  We could
  945. # (if we felt like it) have this Makefile write a piece of elisp which
  946. # the user could load to tell emacs19 where all the TAGS files we just
  947. # built are.
  948. TAGS: do-TAGS
  949.  
  950. # with the gnu make, this is done automatically.
  951.  
  952. Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
  953.     $(SHELL) ./config.status
  954.  
  955. #
  956. # Support for building net releases
  957.  
  958. # Files in devo used in any net release.
  959. # ChangeLog omitted because it may refer to files which are not in this
  960. # distribution (perhaps it would be better to include it anyway).
  961. DEVO_SUPPORT= README Makefile.in configure configure.in \
  962.     config.guess config.sub config move-if-change \
  963.     COPYING COPYING.LIB install.sh
  964.  
  965. # Files in devo/etc used in any net release.
  966. # ChangeLog omitted because it may refer to files which are not in this
  967. # distribution (perhaps it would be better to include it anyway).
  968. ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
  969.     configure.texi standards.texi make-stds.texi
  970.  
  971. # When you use `make setup-dirs' or `make taz' you should always redefine
  972. # this macro.
  973. SUPPORT_FILES = list-of-support-files-for-tool-in-question
  974. # Directories that might want `make diststuff' run.
  975. DISTSTUFFDIRS= ld gprof gdb libg++ binutils gnats
  976. # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
  977. DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
  978. # Directories where "info" should be built.
  979. DISTDOCDIRS= ld gprof binutils gas bfd libg++ libio gdb gnats send-pr
  980.  
  981. .PHONY: taz
  982.  
  983. taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
  984.   texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
  985.     # Make sure "diststuff" files get built properly.
  986.     for f in $(DISTBISONFILES) ; do \
  987.       if [ -r $$f ]; then \
  988.         sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
  989.         mv -f tmp $$f ; \
  990.       else true; fi ; \
  991.     done
  992.     # Take out texinfo from a few places; make simple BISON=bison line.
  993.     sed -e '/^all\.normal: /s/\all-texinfo //' \
  994.         -e '/^    install-texinfo /d' \
  995.         -e '/^BISON = /,/^$$/d' \
  996.         -e '/^# BISON:/s/.*/BISON = bison -y/' \
  997.     <Makefile.in >tmp
  998.     mv -f tmp Makefile.in
  999.     #
  1000.     ./configure sun4
  1001.     # Doc files don't change; include them in distribution.
  1002.     for f in $(DISTDOCDIRS) ; do \
  1003.       if [ -r $$f/Makefile ]; then \
  1004.         (cd $$f ; $(MAKE) info) || exit 1 ; \
  1005.       else true ; fi ; \
  1006.     done
  1007.     # Make links, and run "make diststuff" when needed.
  1008.     # The `echo' for setting `p' is to convert all whitespace to spaces.
  1009.     # Then the `case' further below should tell whether $$d is in
  1010.     # DISTSTUFFDIRS.
  1011.     rm -rf proto-toplev ; mkdir proto-toplev
  1012.     set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
  1013.     p=" `echo $(DISTSTUFFDIRS)` " ; \
  1014.     for d in $$dirs ; do \
  1015.       if [ -d $$d ]; then \
  1016.         case " $$p " in \
  1017.         *" $$d "*)    \
  1018.         echo making diststuff in $$d ; \
  1019.         (cd $$d ; pwd ; $(MAKE) diststuff ) || exit 1  ;; \
  1020.         esac ; \
  1021.         if [ -d $$d/proto-$$d.dir ]; then \
  1022.           ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
  1023.         else \
  1024.           ln -s ../$$d proto-toplev/$$d ; \
  1025.         fi ; \
  1026.       else ln -s ../$$d proto-toplev/$$d ; fi ; \
  1027.     done
  1028.     $(MAKE) distclean
  1029.     #
  1030.     mkdir proto-toplev/etc
  1031.     (cd proto-toplev/etc; for i in $(ETC_SUPPORT); do \
  1032.         ln -s ../../etc/$$i . ; \
  1033.     done)
  1034.     #
  1035.     # Take out texinfo and glob from configurable dirs
  1036.     rm proto-toplev/configure.in
  1037.     sed -e '/^host_tools=/s/texinfo //' \
  1038.         -e '/^host_libs=/s/glob //' \
  1039.         <configure.in >proto-toplev/configure.in
  1040.     #
  1041.     mkdir proto-toplev/texinfo
  1042.     ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/
  1043.     ln -s ../../texinfo/gpl.texinfo proto-toplev/texinfo/
  1044.     ln -s ../../texinfo/lgpl.texinfo proto-toplev/texinfo/
  1045.     ln -s ../../texinfo/tex3patch   proto-toplev/texinfo/
  1046.     chmod og=u `find . -print`
  1047.     (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
  1048.         echo "==> Making $(TOOL)-$$VER.tar.gz"; \
  1049.         rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
  1050.         tar cfh - $(TOOL)-$$VER \
  1051.         | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
  1052.  
  1053. TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
  1054. DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
  1055.  
  1056. .PHONY: gas.tar.gz
  1057. GAS_SUPPORT_DIRS= bfd include libiberty opcodes
  1058. gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
  1059.     $(MAKE) -f Makefile.in taz TOOL=gas \
  1060.         SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
  1061.  
  1062. # The FSF "binutils" release includes gprof and ld.
  1063. .PHONY: binutils.tar.gz
  1064. BINUTILS_SUPPORT_DIRS= bfd include libiberty opcodes ld gprof
  1065. binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
  1066.     $(MAKE) -f Makefile.in taz TOOL=binutils \
  1067.         SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
  1068.  
  1069. .PHONY: gas+binutils.tar.gz
  1070. GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
  1071. gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
  1072.     $(MAKE) -f Makefile.in taz TOOL=gas \
  1073.         SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
  1074.  
  1075. .PHONY: libg++.tar.gz
  1076. LIBGXX_SUPPORT_DIRS=include libio librx libiberty xiberty
  1077. libg++.tar.gz: $(DIST_SUPPORT) libg++
  1078.     $(MAKE) -f Makefile.in taz TOOL=libg++ \
  1079.         SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
  1080.  
  1081. GNATS_SUPPORT_DIRS=include libiberty send-pr
  1082. gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
  1083.     $(MAKE) -f  Makefile.in taz TOOL=gnats \
  1084.         SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
  1085.  
  1086. .PHONY: gdb.tar.gz
  1087. GDB_SUPPORT_DIRS= bfd glob include libiberty mmalloc opcodes readline sim
  1088. gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
  1089.     $(MAKE) -f Makefile.in taz TOOL=gdb \
  1090.         SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
  1091.  
  1092. .NOEXPORT:
  1093. MAKEOVERRIDES=
  1094.  
  1095.  
  1096. # end of Makefile.in
  1097.