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