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