home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  43KB  |  1,494 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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)/share
  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. GDB_NLM_DEPS = 
  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. LIBCFLAGS = $(CFLAGS)
  68. CFLAGS_FOR_TARGET = $(CFLAGS)
  69. LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  70. PICFLAG = 
  71. PICFLAG_FOR_TARGET = 
  72.  
  73. CXX = gcc
  74.  
  75. # Use -O2 to stress test the compiler.
  76. CXXFLAGS = -g -O2
  77. LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
  78. CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
  79. LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  80.  
  81. RANLIB = ranlib
  82.  
  83. DLLTOOL = dlltool
  84.  
  85. NM = nm
  86. # Not plain GZIP, since gzip looks there for extra command-line options.
  87. GZIPPROG = gzip
  88.  
  89. # These values are substituted by configure.
  90. DEFAULT_YACC = yacc
  91. DEFAULT_LEX = lex
  92.  
  93. BISON = bison -y
  94. LEX = `if [ -f $$r/flex/flex ] ; \
  95.     then echo $$r/flex/flex ; \
  96.     else echo ${DEFAULT_LEX} ; fi`
  97.  
  98. M4 = `if [ -f $$r/m4/m4 ] ; \
  99.     then echo $$r/m4/m4 ; \
  100.     else echo m4 ; fi`
  101.  
  102. MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
  103.     then echo $$r/texinfo/makeinfo/makeinfo ; \
  104.     else echo makeinfo ; fi`
  105.  
  106. # This just becomes part of the MAKEINFO definition passed down to
  107. # sub-makes.  It lets flags be given on the command line while still
  108. # using the makeinfo from the object tree.
  109. MAKEINFOFLAGS =
  110.  
  111. EXPECT = `if [ -f $$r/expect/expect ] ; \
  112.     then echo $$r/expect/expect ; \
  113.     else echo expect ; fi`
  114.  
  115. RUNTEST = `if [ -f $${srcroot}/dejagnu/runtest ] ; \
  116.     then echo $${srcroot}/dejagnu/runtest ; \
  117.     else echo runtest ; fi`
  118.  
  119.  
  120. # compilers to use to create programs which must be run in the build
  121. # environment.
  122. CC_FOR_BUILD = $(CC)
  123. CXX_FOR_BUILD = $(CXX)
  124.  
  125. SUBDIRS = "this is set via configure, don't edit this"
  126. OTHERS = 
  127.  
  128. # This is set by the configure script to the list of directories which
  129. # should be built using the target tools.
  130. TARGET_CONFIGDIRS = libiberty libgloss newlib libio librx libstdc++ libg++ winsup
  131.  
  132. # Target libraries are put under this directory:
  133. # Changed by configure to $(target_alias) if cross.
  134. TARGET_SUBDIR = .
  135.  
  136. # This is set by the configure script to the arguments passed to configure.
  137. CONFIG_ARGUMENTS = 
  138.  
  139. # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
  140. # was used.
  141. SET_LIB_PATH =
  142.  
  143. # This is the name of the environment variable used for the path to
  144. # the libraries.  This may be changed by configure.in.
  145. RPATH_ENVVAR = LD_LIBRARY_PATH
  146.  
  147. # configure.in sets SET_LIB_PATH to this if --enable-shared was used.
  148. REALLY_SET_LIB_PATH = \
  149.   $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \
  150.   export $(RPATH_ENVVAR);
  151.  
  152. ALL = all.normal
  153. INSTALL_TARGET = install-dirs \
  154.     $(INSTALL_MODULES) \
  155.     $(INSTALL_TARGET_MODULES) \
  156.     $(INSTALL_X11_MODULES) \
  157.     install-gcc \
  158.     $(INSTALL_DOSREL)
  159.  
  160.  
  161. CC_FOR_TARGET = ` \
  162.   if [ -f $$r/gcc/Makefile ] ; then \
  163.     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
  164.       echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
  165.     else \
  166.       echo $$r/gcc/xgcc -B$$r/gcc/; \
  167.     fi; \
  168.   else \
  169.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  170.       echo $(CC); \
  171.     else \
  172.       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
  173.     fi; \
  174.   fi`
  175.  
  176.  
  177. CXX_FOR_TARGET = ` \
  178.   if [ -f $$r/gcc/Makefile ] ; then \
  179.     if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \
  180.       echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $${srcroot}/newlib/libc/include -nostdinc; \
  181.     else \
  182.       echo $$r/gcc/xgcc -B$$r/gcc/; \
  183.     fi; \
  184.   else \
  185.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  186.       echo $(CXX); \
  187.     else \
  188.       t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \
  189.     fi; \
  190.   fi`
  191.  
  192. AS_FOR_TARGET = ` \
  193.   if [ -f $$r/gas/as.new ] ; then \
  194.     echo $$r/gas/as.new ; \
  195.   else \
  196.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  197.       echo $(AS); \
  198.     else \
  199.        t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \
  200.     fi; \
  201.   fi`
  202.  
  203. LD_FOR_TARGET = ` \
  204.   if [ -f $$r/ld/ld.new ] ; then \
  205.     echo $$r/ld/ld.new ; \
  206.   else \
  207.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  208.       echo $(LD); \
  209.     else \
  210.        t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \
  211.     fi; \
  212.   fi`
  213.  
  214. DLLTOOL_FOR_TARGET = ` \
  215.   if [ -f $$r/binutils/dlltool ] ; then \
  216.     echo $$r/binutils/dlltool ; \
  217.   else \
  218.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  219.       echo $(DLLTOOL); \
  220.     else \
  221.        t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
  222.     fi; \
  223.   fi`
  224.  
  225. AR_FOR_TARGET = ` \
  226.   if [ -f $$r/binutils/ar ] ; then \
  227.     echo $$r/binutils/ar ; \
  228.   else \
  229.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  230.       echo $(AR); \
  231.     else \
  232.        t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \
  233.     fi; \
  234.   fi`
  235.  
  236. RANLIB_FOR_TARGET = ` \
  237.   if [ -f $$r/binutils/ranlib ] ; then \
  238.     echo $$r/binutils/ranlib ; \
  239.   else \
  240.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  241.       echo $(RANLIB); \
  242.     else \
  243.        t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \
  244.     fi; \
  245.   fi`
  246.  
  247. NM_FOR_TARGET = ` \
  248.   if [ -f $$r/binutils/nm.new ] ; then \
  249.     echo $$r/binutils/nm.new ; \
  250.   else \
  251.     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  252.       echo $(NM); \
  253.     else \
  254.        t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \
  255.     fi; \
  256.   fi`
  257.  
  258. #### host and target specific makefile fragments come in here.
  259. ###
  260.  
  261. # Flags to pass down to all sub-makes.
  262. # Please keep these in alphabetical order.
  263. BASE_FLAGS_TO_PASS = \
  264.     "AR_FLAGS=$(AR_FLAGS)" \
  265.     "AR_FOR_TARGET=$(AR_FOR_TARGET)" \
  266.     "AS_FOR_TARGET=$(AS_FOR_TARGET)" \
  267.     "BISON=$(BISON)" \
  268.     "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
  269.     "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
  270.     "CFLAGS=$(CFLAGS)" \
  271.     "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
  272.     "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
  273.     "CXXFLAGS=$(CXXFLAGS)" \
  274.     "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
  275.     "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
  276.     "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
  277.     "GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
  278.     "INSTALL=$(INSTALL)" \
  279.     "INSTALL_DATA=$(INSTALL_DATA)" \
  280.     "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  281.     "INSTALL_XFORM=$(INSTALL_XFORM)" \
  282.     "LDFLAGS=$(LDFLAGS)" \
  283.     "LEX=$(LEX)" \
  284.     "LD_FOR_TARGET=$(LD_FOR_TARGET)" \
  285.     "LIBCFLAGS=$(LIBCFLAGS)" \
  286.     "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
  287.     "LIBCXXFLAGS=$(LIBCXXFLAGS)" \
  288.     "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
  289.     "M4=$(M4)" \
  290.     "MAKE=$(MAKE)" \
  291.     "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
  292.     "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
  293.     "PICFLAG=$(PICFLAG)" \
  294.     "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
  295.     "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
  296.     "SHELL=$(SHELL)" \
  297.     "EXPECT=$(EXPECT)" \
  298.     "RUNTEST=$(RUNTEST)" \
  299.     "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
  300.     "YACC=$(BISON)" \
  301.     "exec_prefix=$(exec_prefix)" \
  302.     "prefix=$(prefix)" \
  303.     "tooldir=$(tooldir)" 
  304.  
  305. # Flags to pass down to most sub-makes, in which we're building with
  306. # the host environment.
  307. # If any variables are added here, they must be added to do-*, below.
  308. EXTRA_HOST_FLAGS = \
  309.     'AR=$(AR)' \
  310.     'AS=$(AS)' \
  311.     'CC=$(CC)' \
  312.     'CXX=$(CXX)' \
  313.     'DLLTOOL=$(DLLTOOL)' \
  314.     'NM=$(NM)' \
  315.     'RANLIB=$(RANLIB)' 
  316.  
  317.  
  318. FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
  319.  
  320. # Flags that are concerned with the location of the X11 include files
  321. # and library files
  322. #
  323. # NOTE: until the top-level is getting the values via autoconf, it only
  324. # causes problems to have this top-level Makefile overriding the autoconf-set
  325. # values in child directories.  Only variables that don't conflict with
  326. # autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
  327. #
  328. X11_FLAGS_TO_PASS = \
  329.     'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
  330.     'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'
  331.  
  332. # Flags to pass down to makes which are built with the target environment.
  333. # The double $ decreases the length of the command line; the variables
  334. # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.
  335. # If any variables are added here, they must be added to do-*, below.
  336. EXTRA_TARGET_FLAGS = \
  337.     'AR=$$(AR_FOR_TARGET)' \
  338.     'AS=$$(AS_FOR_TARGET)' \
  339.     'CC=$$(CC_FOR_TARGET)' \
  340.     'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
  341.     'CXX=$$(CXX_FOR_TARGET)' \
  342.     'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
  343.     'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
  344.     'LD=$$(LD_FOR_TARGET)' \
  345.     'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
  346.     'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
  347.     'NM=$$(NM_FOR_TARGET)' \
  348.     'PICFLAG=$$(PICFLAG_FOR_TARGET)' \
  349.     'RANLIB=$$(RANLIB_FOR_TARGET)'
  350.  
  351. TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
  352.  
  353. # Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
  354. # unfortunately needs the native compiler and the target ar and
  355. # ranlib.
  356. # If any variables are added here, they must be added to do-*, below.
  357. # The HOST_* variables are a special case, which are used for the gcc
  358. # cross-building scheme.
  359. EXTRA_GCC_FLAGS = \
  360.     'AR=$$(AR_FOR_TARGET)' \
  361.     'AS=$(AS)' \
  362.     'CC=$(CC)' \
  363.     'CXX=$(CXX)' \
  364.     'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
  365.     'HOST_CC=$(CC_FOR_BUILD)' \
  366.     'HOST_PREFIX=$(HOST_PREFIX)' \
  367.     'HOST_PREFIX_1=$(HOST_PREFIX_1)' \
  368.     'NM=$(NM)' \
  369.     'RANLIB=$$(RANLIB_FOR_TARGET)' \
  370.     `if test x"$(LANGUAGES)" != x; then echo "LANGUAGES=$(LANGUAGES)"; fi` \
  371.     `if test x"$(STMP_FIXPROTO)" != x; then echo "STMP_FIXPROTO=$(STMP_FIXPROTO)"; fi` \
  372.     `if test x"$(LIMITS_H_TEST)" != x; then echo "LIMITS_H_TEST=$(LIMITS_H_TEST)"; fi` \
  373.     `if test x"$(LIBGCC1_TEST)" != x; then echo "LIBGCC1_TEST=$(LIBGCC1_TEST)"; fi` \
  374.     `if test x"$(LIBGCC2_CFLAGS)" != x; then echo "LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)"; fi` \
  375.     `if test x"$(LIBGCC2_INCLUDES)" != x; then echo "LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)"; fi` \
  376.     `if test x"$(ENQUIRE)" != x; then echo "ENQUIRE=$(ENQUIRE)"; fi` \
  377.     `if test x"$(BOOT_CFLAGS)" != x; then echo "BOOT_CFLAGS=$(BOOT_CFLAGS)"; fi`
  378.  
  379. GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS)
  380.  
  381. # This is a list of the targets for all of the modules which are compiled
  382. # using $(FLAGS_TO_PASS).
  383. ALL_MODULES = \
  384.     all-apache \
  385.     all-autoconf \
  386.     all-bfd \
  387.     all-binutils \
  388.     all-byacc \
  389.     all-cvs \
  390.     all-dejagnu \
  391.     all-diff \
  392.     all-dosutils \
  393.     all-etc \
  394.     all-fileutils \
  395.     all-find \
  396.     all-flex \
  397.     all-gas \
  398.     all-gawk \
  399.     all-gprof \
  400.     all-grep \
  401.     all-grez \
  402.     all-gzip \
  403.     all-hello \
  404.     all-indent \
  405.     all-inet \
  406.     all-ispell \
  407.     all-ld \
  408.     all-libiberty \
  409.     all-m4 \
  410.     all-make \
  411.     all-mmalloc \
  412.     all-opcodes \
  413.     all-patch \
  414.     all-perl \
  415.     all-prms \
  416.     all-rcs \
  417.     all-readline \
  418.     all-release \
  419.     all-recode \
  420.     all-sed \
  421.     all-send-pr \
  422.     all-shellutils \
  423.     all-sim \
  424.     all-tar \
  425.     all-tcl \
  426.     all-texinfo \
  427.     all-textutils \
  428.     all-tgas \
  429.     all-time \
  430.     all-uudecode \
  431.     all-wdiff 
  432.  
  433. # This is a list of the check targets for all of the modules which are
  434. # compiled using $(FLAGS_TO_PASS).
  435. # This is a list of the check targets for all of the modules which are
  436. # compiled using $(FLAGS_TO_PASS).
  437. #
  438. # The list is in two parts.  The first lists those tools which
  439. # are tested as part of the host's native tool-chain, and not
  440. # tested in a cross configuration.
  441. NATIVE_CHECK_MODULES = \
  442.     check-byacc \
  443.     check-flex
  444.  
  445. CROSS_CHECK_MODULES = \
  446.     check-apache \
  447.     check-autoconf \
  448.     check-bfd \
  449.     check-binutils \
  450.     check-cvs \
  451.     check-dejagnu \
  452.     check-diff \
  453.     check-etc \
  454.     check-fileutils \
  455.     check-find \
  456.     check-gas \
  457.     check-gawk \
  458.     check-gprof \
  459.     check-grep \
  460.     check-gzip \
  461.     check-hello \
  462.     check-indent \
  463.     check-inet \
  464.     check-ispell \
  465.     check-ld \
  466.     check-libiberty \
  467.     check-m4 \
  468.     check-make \
  469.     check-mmcheckoc \
  470.     check-opcodes \
  471.     check-patch \
  472.     check-perl \
  473.     check-prms \
  474.     check-rcs \
  475.     check-readline \
  476.     check-recode \
  477.     check-sed \
  478.     check-send-pr \
  479.     check-shellutils \
  480.     check-sim \
  481.     check-tar \
  482.     check-tcl \
  483.     check-texinfo \
  484.     check-textutils \
  485.     check-tgas \
  486.     check-time \
  487.     check-uudecode \
  488.     check-wdiff
  489.  
  490. CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
  491.  
  492. # This is a list of the install targets for all of the modules which are
  493. # compiled using $(FLAGS_TO_PASS).
  494. INSTALL_MODULES = \
  495.     install-apache \
  496.     install-autoconf \
  497.     install-bfd \
  498.     install-binutils \
  499.     install-byacc \
  500.     install-cvs \
  501.     install-dejagnu \
  502.     install-diff \
  503.     install-dosutils \
  504.     install-etc \
  505.     install-fileutils \
  506.     install-find \
  507.     install-flex \
  508.     install-gas \
  509.     install-gawk \
  510.     install-gprof \
  511.     install-grep \
  512.     install-grez \
  513.     install-gzip \
  514.     install-hello \
  515.     install-indent \
  516.     install-inet \
  517.     install-ispell \
  518.     install-ld \
  519.     install-libiberty \
  520.     install-m4 \
  521.     install-make \
  522.     install-mmalloc \
  523.     install-opcodes \
  524.     install-patch \
  525.     install-perl \
  526.     install-prms \
  527.     install-rcs \
  528.     install-readline \
  529.     install-recode \
  530.     install-sed \
  531.     install-send-pr \
  532.     install-shellutils \
  533.     install-sim \
  534.     install-tar \
  535.     install-tcl \
  536.     install-textutils \
  537.     install-tgas \
  538.     install-time \
  539.     install-uudecode \
  540.     install-wdiff
  541.  
  542. # This is a list of the targets for all of the modules which are compiled
  543. # using $(X11_FLAGS_TO_PASS).
  544. ALL_X11_MODULES = \
  545.     all-emacs \
  546.     all-emacs19 \
  547.     all-gdb \
  548.     all-expect \
  549.     all-gash \
  550.     all-guile \
  551.     all-tclX \
  552.     all-tk
  553.  
  554. # This is a list of the check targets for all of the modules which are
  555. # compiled using $(X11_FLAGS_TO_PASS).
  556. CHECK_X11_MODULES = \
  557.     check-emacs \
  558.     check-gdb \
  559.     check-guile \
  560.     check-expect \
  561.     check-gash \
  562.     check-tclX \
  563.     check-tk
  564.  
  565. # This is a list of the install targets for all the modules which are
  566. # compiled using $(X11_FLAGS_TO_PASS).
  567. INSTALL_X11_MODULES = \
  568.     install-emacs \
  569.     install-emacs19 \
  570.     install-gdb \
  571.     install-guile \
  572.     install-expect \
  573.     install-gash \
  574.     install-tclX \
  575.     install-tk
  576.  
  577. # This is a list of the targets for all of the modules which are compiled
  578. # using $(TARGET_FLAGS_TO_PASS).
  579. ALL_TARGET_MODULES = \
  580.     all-target-libio \
  581.     all-target-libstdc++ \
  582.     all-target-librx \
  583.     all-target-libg++ \
  584.     all-target-newlib \
  585.     all-target-winsup \
  586.     all-target-libgloss \
  587.     all-target-libiberty \
  588.     all-target-examples
  589.  
  590. # This is a list of the configure targets for all of the modules which
  591. # are compiled using the target tools.
  592. CONFIGURE_TARGET_MODULES = \
  593.     configure-target-libio \
  594.     configure-target-libstdc++ \
  595.     configure-target-librx \
  596.     configure-target-libg++ \
  597.     configure-target-newlib \
  598.     configure-target-winsup \
  599.     configure-target-libgloss \
  600.     configure-target-libiberty \
  601.     configure-target-examples
  602.  
  603. # This is a list of the check targets for all of the modules which are
  604. # compiled using $(TARGET_FLAGS_TO_PASS).
  605. CHECK_TARGET_MODULES = \
  606.     check-target-libio \
  607.     check-target-libstdc++ \
  608.     check-target-libg++ \
  609.     check-target-newlib \
  610.     check-target-winsup \
  611.     check-target-libiberty
  612.  
  613. # This is a list of the install targets for all of the modules which are
  614. # compiled using $(TARGET_FLAGS_TO_PASS).
  615. INSTALL_TARGET_MODULES = \
  616.     install-target-libio \
  617.     install-target-libstdc++ \
  618.     install-target-libg++ \
  619.     install-target-newlib \
  620.     install-target-winsup \
  621.     install-target-libgloss \
  622.     install-target-libiberty
  623.  
  624. # This is a list of the targets for which we can do a clean-{target}.
  625. CLEAN_MODULES = \
  626.     clean-apache \
  627.     clean-autoconf \
  628.     clean-bfd \
  629.     clean-binutils \
  630.     clean-byacc \
  631.     clean-cvs \
  632.     clean-dejagnu \
  633.     clean-diff \
  634.     clean-dosutils \
  635.     clean-etc \
  636.     clean-fileutils \
  637.     clean-find \
  638.     clean-flex \
  639.     clean-gas \
  640.     clean-gawk \
  641.     clean-gprof \
  642.     clean-grep \
  643.     clean-grez \
  644.     clean-gzip \
  645.     clean-hello \
  646.     clean-indent \
  647.     clean-inet \
  648.     clean-ispell \
  649.     clean-ld \
  650.     clean-libiberty \
  651.     clean-m4 \
  652.     clean-make \
  653.     clean-mmalloc \
  654.     clean-opcodes \
  655.     clean-patch \
  656.     clean-perl \
  657.     clean-prms \
  658.     clean-rcs \
  659.     clean-readline \
  660.     clean-release \
  661.     clean-recode \
  662.     clean-sed \
  663.     clean-send-pr \
  664.     clean-shellutils \
  665.     clean-sim \
  666.     clean-tar \
  667.     clean-tcl \
  668.     clean-texinfo \
  669.     clean-textutils \
  670.     clean-tgas \
  671.     clean-time \
  672.     clean-uudecode \
  673.     clean-wdiff
  674.  
  675. # All of the target modules that can be cleaned
  676. CLEAN_TARGET_MODULES = \
  677.     clean-target-libio \
  678.     clean-target-libstdc++ \
  679.     clean-target-librx \
  680.     clean-target-libg++ \
  681.     clean-target-newlib \
  682.     clean-target-winsup \
  683.     clean-target-libgloss \
  684.     clean-target-libiberty \
  685.     clean-target-examples
  686.  
  687. # All of the x11 modules that can be cleaned
  688. CLEAN_X11_MODULES = \
  689.     clean-emacs \
  690.     clean-emacs19 \
  691.     clean-gdb \
  692.     clean-expect \
  693.     clean-gash \
  694.     clean-guile \
  695.     clean-tclX \
  696.     clean-tk
  697.  
  698. # The first rule in the file had better be this one.  Don't put any above it.
  699. all: all.normal
  700. .PHONY: all
  701.  
  702. # The target built for a native build.
  703. .PHONY: all.normal
  704. all.normal: \
  705.     $(ALL_MODULES) \
  706.     $(ALL_TARGET_MODULES) \
  707.     $(ALL_X11_MODULES) \
  708.     all-gcc
  709.  
  710. # Do a target for all the subdirectories.  A ``make do-X'' will do a
  711. # ``make X'' in all subdirectories (because, in general, there is a
  712. # dependency (below) of X upon do-X, a ``make X'' will also do this,
  713. # but it may do additional work as well).
  714. # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
  715. # because it is so large that it can easily overflow the command line
  716. # length limit on some systems.
  717. DO_X = \
  718.     do-clean \
  719.     do-distclean \
  720.     do-dvi \
  721.     do-info \
  722.     do-install-info \
  723.     do-installcheck \
  724.     do-mostlyclean \
  725.     do-maintainer-clean \
  726.     do-TAGS
  727. .PHONY: $(DO_X)
  728. $(DO_X):
  729.     @target=`echo $@ | sed -e 's/^do-//'`; \
  730.     r=`pwd`; export r; \
  731.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  732.     $(SET_LIB_PATH) \
  733.     for i in $(SUBDIRS) -dummy-; do \
  734.       if [ -f ./$$i/Makefile ]; then \
  735.         case $$i in \
  736.         gcc) \
  737.           for flag in $(EXTRA_GCC_FLAGS); do \
  738.         eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
  739.           done; \
  740.           ;; \
  741.         *) \
  742.           for flag in $(EXTRA_HOST_FLAGS); do \
  743.         eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
  744.           done; \
  745.           ;; \
  746.         esac ; \
  747.         export AR AS CC CXX NM RANLIB DLLTOOL; \
  748.         if (cd ./$$i; \
  749.             $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  750.             "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
  751.             "RANLIB=$${RANLIB}" \
  752.             "DLLTOOL=$${DLLTOOL}" \
  753.             $${target}); \
  754.         then true; else exit 1; fi; \
  755.       else true; fi; \
  756.     done
  757.     @target=`echo $@ | sed -e 's/^do-//'`; \
  758.     r=`pwd`; export r; \
  759.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  760.     $(SET_LIB_PATH) \
  761.     for i in $(TARGET_CONFIGDIRS) -dummy-; do \
  762.       if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \
  763.         for flag in $(EXTRA_TARGET_FLAGS); do \
  764.         eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'|"`; \
  765.         done; \
  766.         export AR AS CC CXX NM RANLIB DLLTOOL; \
  767.         if (cd $(TARGET_SUBDIR)/$$i; \
  768.             $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  769.             "CC=$${CC}" "CXX=$${CXX}" "NM=$${NM}" \
  770.             "RANLIB=$${RANLIB}" \
  771.             "DLLTOOL=$${DLLTOOL}" \
  772.             $${target}); \
  773.         then true; else exit 1; fi; \
  774.       else true; fi; \
  775.     done
  776.  
  777. # Here are the targets which correspond to the do-X targets.
  778.  
  779. .PHONY: info installcheck dvi install-info
  780. .PHONY: clean distclean mostlyclean maintainer-clean realclean
  781. .PHONY: local-clean local-distclean local-maintainer-clean
  782. info: do-info
  783. installcheck: do-installcheck
  784. dvi: do-dvi
  785.  
  786. install-info: do-install-info dir.info
  787.     srcroot=`cd $(srcdir); pwd`; export srcroot; \
  788.     if [ -f dir.info ] ; then \
  789.       $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \
  790.     else true ; fi
  791.  
  792. local-clean:
  793.     -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E
  794.  
  795. local-distclean:
  796.     -rm -f Makefile config.status
  797.     -if [ "$(TARGET_SUBDIR)" != "." ]; then \
  798.       rm -rf $(TARGET_SUBDIR); \
  799.     else true; fi
  800.  
  801. local-maintainer-clean:
  802.     @echo "This command is intended for maintainers to use;"
  803.     @echo "it deletes files that may require special tools to rebuild."
  804.  
  805. clean: do-clean local-clean
  806. mostlyclean: do-mostlyclean local-clean
  807. distclean: do-distclean local-clean local-distclean
  808. maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean 
  809. maintainer-clean: local-distclean
  810. realclean: maintainer-clean
  811.  
  812. # This rule is used to clean specific modules.
  813. .PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc
  814. $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc:
  815.     @dir=`echo $@ | sed -e 's/clean-//'`; \
  816.     if [ -f ./$${dir}/Makefile ] ; then \
  817.       r=`pwd`; export r; \
  818.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  819.       $(SET_LIB_PATH) \
  820.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \
  821.     else \
  822.       true; \
  823.     fi
  824.  
  825. .PHONY: $(CLEAN_TARGET_MODULES)
  826. $(CLEAN_TARGET_MODULES):
  827.     @dir=`echo $@ | sed -e 's/clean-target-//'`; \
  828.     if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
  829.       r=`pwd`; export r; \
  830.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  831.       $(SET_LIB_PATH) \
  832.       (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \
  833.     else \
  834.       true; \
  835.     fi
  836.  
  837. clean-target: $(CLEAN_TARGET_MODULES)
  838.  
  839. # Check target.
  840.  
  841. .PHONY: check
  842. check: $(CHECK_MODULES) \
  843.     $(CHECK_TARGET_MODULES) \
  844.     $(CHECK_X11_MODULES) \
  845.     check-gcc
  846.  
  847. # Installation targets.
  848.  
  849. .PHONY: install uninstall source-vault binary-vault vault-install
  850. install: $(INSTALL_TARGET) 
  851.  
  852. uninstall:
  853.     @echo "the uninstall target is not supported in this tree"
  854.  
  855. source-vault:
  856.     $(MAKE) -f ./release/Build-A-Release \
  857.         host=$(host_alias) source-vault
  858.  
  859. binary-vault:
  860.     $(MAKE) -f ./release/Build-A-Release \
  861.         host=$(host_alias) target=$(target_alias)
  862.  
  863. vault-install:
  864.     @if [ -f ./release/vault-install ] ; then \
  865.       ./release/vault-install $(host_alias) $(target_alias) ; \
  866.     else \
  867.       true ; \
  868.     fi
  869.  
  870. .PHONY: install.all
  871. install.all: install-no-fixedincludes
  872.     @if [ -f ./gcc/Makefile ] ; then \
  873.         r=`pwd` ; export r ; \
  874.         $(SET_LIB_PATH) \
  875.         (cd ./gcc; \
  876.         $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
  877.     else \
  878.         true ; \
  879.     fi
  880.  
  881. # inet-install is used because the I*Net wants DejaGNU installed but
  882. # not built.
  883. inet-install:
  884.     $(MAKE) INSTALL_MODULES="`echo $(INSTALL_MODULES) | sed -e 's/install-dejagnu//'`" install
  885.  
  886. # install-no-fixedincludes is used because Cygnus can not distribute
  887. # the fixed header files.
  888. .PHONY: install-no-fixedincludes
  889. install-no-fixedincludes: \
  890.     install-dirs \
  891.     $(INSTALL_MODULES) \
  892.     $(INSTALL_TARGET_MODULES) \
  893.     $(INSTALL_X11_MODULES) \
  894.     gcc-no-fixedincludes 
  895.  
  896. # Install the gcc headers files, but not the fixed include files,
  897. # which Cygnus is not allowed to distribute.  This rule is very
  898. # dependent on the workings of the gcc Makefile.in.
  899. .PHONY: gcc-no-fixedincludes
  900. gcc-no-fixedincludes:
  901.     @if [ -f ./gcc/Makefile ]; then \
  902.       rm -rf gcc/tmp-include; \
  903.       mv gcc/include gcc/tmp-include 2>/dev/null; \
  904.       mkdir gcc/include; \
  905.       cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \
  906.       touch gcc/stmp-fixinc gcc/include/fixed; \
  907.       rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \
  908.       r=`pwd`; export r; \
  909.       srcroot=`cd $(srcdir); pwd` ; export srcroot; \
  910.       $(SET_LIB_PATH) \
  911.       (cd ./gcc; \
  912.        $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  913.       rm -rf gcc/include; \
  914.       mv gcc/tmp-include gcc/include 2>/dev/null; \
  915.     else true; fi
  916.  
  917. # This rule is used to build the modules which use FLAGS_TO_PASS.  To
  918. # build a target all-X means to cd to X and make all.
  919. #
  920. # all-gui, and all-libproc are handled specially because
  921. # they are still experimental, and if they fail to build, that
  922. # shouldn't stop "make all".
  923. .PHONY: $(ALL_MODULES) all-gui all-libproc
  924. $(ALL_MODULES) all-gui all-libproc:
  925.     @dir=`echo $@ | sed -e 's/all-//'`; \
  926.     if [ -f ./$${dir}/Makefile ] ; then \
  927.       r=`pwd`; export r; \
  928.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  929.       $(SET_LIB_PATH) \
  930.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \
  931.     else \
  932.       true; \
  933.     fi
  934.  
  935. # These rules are used to check the modules which use FLAGS_TO_PASS.
  936. # To build a target check-X means to cd to X and make check.  Some
  937. # modules are only tested in a native toolchain.
  938.  
  939. .PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
  940. $(NATIVE_CHECK_MODULES):
  941.     @if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
  942.       dir=`echo $@ | sed -e 's/check-//'`; \
  943.       if [ -f ./$${dir}/Makefile ] ; then \
  944.         r=`pwd`; export r; \
  945.         srcroot=`cd $(srcdir); pwd`; export srcroot; \
  946.         $(SET_LIB_PATH) \
  947.         (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
  948.       else \
  949.         true; \
  950.       fi; \
  951.     fi
  952.  
  953. $(CROSS_CHECK_MODULES):
  954.     @dir=`echo $@ | sed -e 's/check-//'`; \
  955.     if [ -f ./$${dir}/Makefile ] ; then \
  956.       r=`pwd`; export r; \
  957.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  958.       $(SET_LIB_PATH) \
  959.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \
  960.     else \
  961.       true; \
  962.     fi
  963.  
  964. # This rule is used to install the modules which use FLAGS_TO_PASS.
  965. # To build a target install-X means to cd to X and make install.
  966. .PHONY: $(INSTALL_MODULES)
  967. $(INSTALL_MODULES): install-dirs
  968.     @dir=`echo $@ | sed -e 's/install-//'`; \
  969.     if [ -f ./$${dir}/Makefile ] ; then \
  970.       r=`pwd`; export r; \
  971.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  972.       $(SET_LIB_PATH) \
  973.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
  974.     else \
  975.       true; \
  976.     fi
  977.  
  978. # This rule is used to configure the modules which are built with the
  979. # target tools.
  980. .PHONY: $(CONFIGURE_TARGET_MODULES)
  981. $(CONFIGURE_TARGET_MODULES):
  982.     @dir=`echo $@ | sed -e 's/configure-target-//'`; \
  983.     if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
  984.       true; \
  985.     elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
  986.       if [ -d $(srcdir)/$${dir} ]; then \
  987.         [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\
  988.         r=`pwd`; export r; \
  989.         srcroot=`cd $(srcdir); pwd`; export srcroot; \
  990.         $(SET_LIB_PATH) \
  991.         AR="$(AR_FOR_TARGET)"; export AR; \
  992.         AS="$(AS_FOR_TARGET)"; export AS; \
  993.         CC="$(CC_FOR_TARGET)"; export CC; \
  994.         CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
  995.         CXX="$(CXX_FOR_TARGET)"; export CXX; \
  996.         CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
  997.         DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
  998.         LD="$(LD_FOR_TARGET)"; export LD; \
  999.         NM="$(NM_FOR_TARGET)"; export NM; \
  1000.         RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
  1001.         echo Configuring in $(TARGET_SUBDIR)/$${dir}; \
  1002.         cd $(TARGET_SUBDIR)/$${dir}; \
  1003.         case $(srcdir) in \
  1004.         /*) \
  1005.           topdir=$(srcdir) ;; \
  1006.         *) \
  1007.           case "$(TARGET_SUBDIR)" in \
  1008.           .) topdir="../$(srcdir)" ;; \
  1009.           *) topdir="../../$(srcdir)" ;; \
  1010.           esac ;; \
  1011.         esac; \
  1012.         if [ "$(srcdir)" = "." ] ; then \
  1013.           if [ "$(TARGET_SUBDIR)" != "." ] ; then \
  1014.         if $(SHELL) $${srcroot}/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
  1015.           if [ -f Makefile ]; then \
  1016.             if $(MAKE) distclean; then \
  1017.               true; \
  1018.             else \
  1019.               exit 1; \
  1020.             fi; \
  1021.           else \
  1022.             true; \
  1023.           fi; \
  1024.         else \
  1025.           exit 1; \
  1026.         fi; \
  1027.           else \
  1028.         true; \
  1029.           fi; \
  1030.           srcdiroption="--srcdir=."; \
  1031.           libsrcdir="."; \
  1032.         else \
  1033.           srcdiroption="--srcdir=$${topdir}/$${dir}"; \
  1034.           libsrcdir="$${srcroot}/$${dir}"; \
  1035.         fi; \
  1036.         if [ -f $${libsrcdir}/configure ] ; then \
  1037.           $(SHELL) $${libsrcdir}/configure \
  1038.         $(CONFIG_ARGUMENTS) $${srcdiroption} \
  1039.         --with-target-subdir="$(TARGET_SUBDIR)"; \
  1040.         else \
  1041.           $(SHELL) $${srcroot}/configure \
  1042.         $(CONFIG_ARGUMENTS) $${srcdiroption} \
  1043.         --with-target-subdir="$(TARGET_SUBDIR)"; \
  1044.         fi; \
  1045.       else \
  1046.         true; \
  1047.       fi; \
  1048.     else \
  1049.       true; \
  1050.     fi
  1051.  
  1052. # This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
  1053. # To build a target all-X means to cd to X and make all.
  1054. .PHONY: $(ALL_TARGET_MODULES)
  1055. $(ALL_TARGET_MODULES):
  1056.     @dir=`echo $@ | sed -e 's/all-target-//'`; \
  1057.     if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
  1058.       r=`pwd`; export r; \
  1059.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1060.       $(SET_LIB_PATH) \
  1061.       (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
  1062.     else \
  1063.       true; \
  1064.     fi
  1065.  
  1066. # This rule is used to check the modules which use TARGET_FLAGS_TO_PASS.
  1067. # To build a target install-X means to cd to X and make install.
  1068. .PHONY: $(CHECK_TARGET_MODULES)
  1069. $(CHECK_TARGET_MODULES):
  1070.     @dir=`echo $@ | sed -e 's/check-target-//'`; \
  1071.     if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
  1072.       r=`pwd`; export r; \
  1073.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1074.       $(SET_LIB_PATH) \
  1075.       (cd $(TARGET_SUBDIR)/$${dir};$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
  1076.     else \
  1077.       true; \
  1078.     fi
  1079.  
  1080. # This rule is used to install the modules which use
  1081. # TARGET_FLAGS_TO_PASS.  To build a target install-X means to cd to X
  1082. # and make install.
  1083. .PHONY: $(INSTALL_TARGET_MODULES)
  1084. $(INSTALL_TARGET_MODULES): install-dirs
  1085.     @dir=`echo $@ | sed -e 's/install-target-//'`; \
  1086.     if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
  1087.       r=`pwd`; export r; \
  1088.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1089.       $(SET_LIB_PATH) \
  1090.       (cd $(TARGET_SUBDIR)/$${dir}; \
  1091.         $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
  1092.     else \
  1093.       true; \
  1094.     fi
  1095.  
  1096. # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
  1097. # To build a target all-X means to cd to X and make all.
  1098. .PHONY: $(ALL_X11_MODULES)
  1099. $(ALL_X11_MODULES):
  1100.     @dir=`echo $@ | sed -e 's/all-//'`; \
  1101.     if [ -f ./$${dir}/Makefile ] ; then \
  1102.       r=`pwd`; export r; \
  1103.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1104.       $(SET_LIB_PATH) \
  1105.       (cd $${dir}; \
  1106.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \
  1107.     else \
  1108.       true; \
  1109.     fi
  1110.  
  1111. # This rule is used to check the modules which use X11_FLAGS_TO_PASS.
  1112. # To build a target check-X means to cd to X and make all.
  1113. .PHONY: $(CHECK_X11_MODULES)
  1114. $(CHECK_X11_MODULES):
  1115.     @dir=`echo $@ | sed -e 's/check-//'`; \
  1116.     if [ -f ./$${dir}/Makefile ] ; then \
  1117.       r=`pwd`; export r; \
  1118.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1119.       $(SET_LIB_PATH) \
  1120.       (cd $${dir}; \
  1121.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \
  1122.     else \
  1123.       true; \
  1124.     fi
  1125.  
  1126. # This rule is used to install the modules which use X11_FLAGS_TO_PASS.
  1127. # To build a target install-X means to cd to X and make install.
  1128. .PHONY: $(INSTALL_X11_MODULES)
  1129. $(INSTALL_X11_MODULES):
  1130.     @dir=`echo $@ | sed -e 's/install-//'`; \
  1131.     if [ -f ./$${dir}/Makefile ] ; then \
  1132.       r=`pwd`; export r; \
  1133.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1134.       $(SET_LIB_PATH) \
  1135.       (cd $${dir}; \
  1136.        $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \
  1137.     else \
  1138.       true; \
  1139.     fi
  1140.  
  1141. # gcc is the only module which uses GCC_FLAGS_TO_PASS.
  1142. .PHONY: all-gcc
  1143. all-gcc:
  1144.     @if [ -f ./gcc/Makefile ] ; then \
  1145.       r=`pwd`; export r; \
  1146.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1147.       $(SET_LIB_PATH) \
  1148.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
  1149.     else \
  1150.       true; \
  1151.     fi
  1152.  
  1153. .PHONY: all-bootstrap
  1154. all-bootstrap:
  1155.     @if [ -f ./gcc/Makefile ] ; then \
  1156.       r=`pwd`; export r; \
  1157.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1158.       $(SET_LIB_PATH) \
  1159.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) bootstrap); \
  1160.     else \
  1161.       true; \
  1162.     fi
  1163.  
  1164. .PHONY: check-gcc
  1165. check-gcc:
  1166.     @if [ -f ./gcc/Makefile ] ; then \
  1167.       r=`pwd`; export r; \
  1168.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1169.       $(SET_LIB_PATH) \
  1170.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
  1171.     else \
  1172.       true; \
  1173.     fi
  1174.  
  1175. .PHONY: install-gcc
  1176. install-gcc:
  1177.     @if [ -f ./gcc/Makefile ] ; then \
  1178.       r=`pwd`; export r; \
  1179.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1180.       $(SET_LIB_PATH) \
  1181.       (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
  1182.     else \
  1183.       true; \
  1184.     fi
  1185.  
  1186.  
  1187. # EXPERIMENTAL STUFF
  1188. # This rule is used to install the modules which use FLAGS_TO_PASS.
  1189. # To build a target install-X means to cd to X and make install.
  1190. .PHONY: install-dosrel
  1191. install-dosrel: install-dirs info
  1192.     @dir=`echo $@ | sed -e 's/install-//'`; \
  1193.     if [ -f ./$${dir}/Makefile ] ; then \
  1194.       r=`pwd`; export r; \
  1195.       srcroot=`cd $(srcdir); pwd`; export srcroot; \
  1196.       $(SET_LIB_PATH) \
  1197.       (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \
  1198.     else \
  1199.       true; \
  1200.     fi
  1201.  
  1202. install-dosrel-fake:
  1203.  
  1204.  
  1205. # This is a list of inter-dependencies among modules.
  1206. all-apache:
  1207. all-autoconf: all-m4
  1208. all-bfd:
  1209. all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
  1210. all-byacc:
  1211. all-cvs:
  1212. all-dejagnu: all-tcl all-expect all-tk
  1213. all-diff: all-libiberty
  1214. all-emacs:
  1215. all-emacs19: all-byacc
  1216. all-etc:
  1217. configure-target-examples: $(ALL_GCC)
  1218. all-target-examples: configure-target-examples
  1219. all-expect: all-tcl all-tk
  1220. all-fileutils: all-libiberty
  1221. all-find:
  1222. all-flex: all-libiberty all-byacc
  1223. all-gas: all-libiberty all-opcodes all-bfd
  1224. all-gash: all-tcl
  1225. all-gawk:
  1226. ALL_GCC = all-gcc
  1227. all-gcc: all-libiberty all-byacc all-binutils all-gas all-ld
  1228. all-bootstrap: all-libiberty all-byacc all-binutils all-gas all-ld
  1229. GDB_TK = all-tk all-tcl
  1230. all-gdb: all-libiberty all-opcodes all-bfd all-mmalloc all-readline all-byacc all-sim $(gdbnlmrequirements) $(GDB_TK)
  1231. all-gprof: all-libiberty all-bfd all-opcodes
  1232. all-grep: all-libiberty
  1233. all-grez: all-libiberty all-bfd all-opcodes
  1234. all-gui: all-gdb all-libproc all-target-librx
  1235. all-guile:
  1236. all-gzip: all-libiberty
  1237. all-hello: all-libiberty
  1238. all-indent:
  1239. all-inet: all-tcl all-send-pr all-perl
  1240. all-ispell: all-emacs19
  1241. all-ld: all-libiberty all-bfd all-opcodes all-byacc all-flex
  1242. configure-target-libg++: $(ALL_GCC) configure-target-librx
  1243. all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++
  1244. configure-target-libgloss: $(ALL_GCC)
  1245. all-target-libgloss: configure-target-libgloss configure-target-newlib
  1246. configure-target-libio: $(ALL_GCC)
  1247. all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib
  1248. all-libiberty:
  1249. configure-target-librx: $(ALL_GCC) configure-target-newlib
  1250. all-target-librx: configure-target-librx
  1251. configure-target-libstdc++: $(ALL_GCC)
  1252. all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
  1253. all-m4: all-libiberty
  1254. all-make: all-libiberty
  1255. all-mmalloc:
  1256. configure-target-newlib: $(ALL_GCC)
  1257. all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc
  1258. all-opcodes: all-bfd all-libiberty
  1259. all-patch: all-libiberty
  1260. all-perl:
  1261. all-prms: all-libiberty
  1262. all-rcs:
  1263. all-readline:
  1264. all-recode: all-libiberty
  1265. all-sed: all-libiberty
  1266. all-send-pr: all-prms
  1267. all-shellutils:
  1268. all-sim: all-libiberty all-bfd all-opcodes
  1269. all-tar: all-libiberty
  1270. all-tcl:
  1271. all-tclX: all-tcl all-tk
  1272. all-tk: all-tcl
  1273. all-texinfo: all-libiberty
  1274. all-textutils:
  1275. all-tgas: all-libiberty all-bfd all-opcodes
  1276. all-time:
  1277. all-wdiff:
  1278. all-target-winsup: all-target-newlib all-target-libiberty configure-target-winsup 
  1279. configure-target-winsup: configure-target-newlib
  1280. all-uudecode: all-libiberty
  1281. configure-target-libiberty: $(ALL_GCC)
  1282. all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib
  1283. all-target: $(ALL_TARGET_MODULES)
  1284. install-target: $(INSTALL_TARGET_MODULES)
  1285.  
  1286. ### other supporting targets
  1287.  
  1288. MAKEDIRS= \
  1289.     $(prefix) \
  1290.     $(exec_prefix)
  1291. .PHONY: install-dirs
  1292. install-dirs:
  1293.     @for i in $(MAKEDIRS) ; do \
  1294.         echo Making $$i... ; \
  1295.         parent=`echo $$i | sed -e 's@/[^/]*$$@@' | sed -e 's@^$$@/@'`; \
  1296.         if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi ; \
  1297.         if [ ! -d $$i ] ; then \
  1298.             if mkdir $$i ; then \
  1299.                 true ; \
  1300.             else \
  1301.                 exit 1 ; \
  1302.             fi ; \
  1303.         else \
  1304.             true ; \
  1305.         fi ; \
  1306.     done
  1307.  
  1308.  
  1309. dir.info: do-install-info
  1310.     if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \
  1311.       $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \
  1312.       mv -f dir.info.new dir.info ; \
  1313.     else true ; \
  1314.     fi
  1315.  
  1316. dist:
  1317.     @echo "Building a full distribution of this tree isn't done"
  1318.     @echo "via 'make dist'.  Check out the etc/ subdirectory" 
  1319.  
  1320. etags tags: TAGS
  1321.  
  1322. # Right now this just builds TAGS in each subdirectory.  emacs19 has the
  1323. # ability to use several tags files at once, so there is probably no need
  1324. # to combine them into one big TAGS file (like CVS 1.3 does).  We could
  1325. # (if we felt like it) have this Makefile write a piece of elisp which
  1326. # the user could load to tell emacs19 where all the TAGS files we just
  1327. # built are.
  1328. TAGS: do-TAGS
  1329.  
  1330. # with the gnu make, this is done automatically.
  1331.  
  1332. Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
  1333.     $(SHELL) ./config.status
  1334.  
  1335. #
  1336. # Support for building net releases
  1337.  
  1338. # Files in devo used in any net release.
  1339. # ChangeLog omitted because it may refer to files which are not in this
  1340. # distribution (perhaps it would be better to include it anyway).
  1341. DEVO_SUPPORT= README Makefile.in configure configure.in \
  1342.     config.guess config.sub config move-if-change \
  1343.     mpw-README mpw-build.in mpw-config.in mpw-configure \
  1344.     COPYING COPYING.LIB install.sh config-ml.in symlink-tree
  1345.  
  1346. # Files in devo/etc used in any net release.
  1347. # ChangeLog omitted because it may refer to files which are not in this
  1348. # distribution (perhaps it would be better to include it anyway).
  1349. ETC_SUPPORT= Makefile.in cfg-paper.texi configure.in configure.man \
  1350.     configure.texi standards.texi make-stds.texi \
  1351.     configure.info* standards.info* cfg-paper.info*
  1352.  
  1353. # When you use `make setup-dirs' or `make taz' you should always redefine
  1354. # this macro.
  1355. SUPPORT_FILES = list-of-support-files-for-tool-in-question
  1356. # Files where "byacc" (Cygnus version) should be changed to "bison -y" (FSF).
  1357. DISTBISONFILES= binutils/Makefile.in gas/Makefile.in gdb/Makefile.in
  1358.  
  1359. .PHONY: taz
  1360.  
  1361. taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) \
  1362.   texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
  1363.     # Make sure "diststuff" files get built properly.
  1364.     for f in $(DISTBISONFILES) ; do \
  1365.       if [ -r $$f ]; then \
  1366.         sed '/^BISON *=.*$$/s/.*/BISON = bison -y/' <$$f >tmp ; \
  1367.         mv -f tmp $$f ; \
  1368.       else true; fi ; \
  1369.     done
  1370.     # Take out texinfo from a few places; make simple BISON=bison line.
  1371.     sed -e '/^all\.normal: /s/\all-texinfo //' \
  1372.         -e '/^    install-texinfo /d' \
  1373.         -e '/^BISON = /,/^$$/d' \
  1374.         -e '/^# BISON:/s/.*/BISON = bison -y/' \
  1375.     <Makefile.in >tmp
  1376.     mv -f tmp Makefile.in
  1377.     #
  1378.     ./configure sun4
  1379.     [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
  1380.       || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \
  1381.         CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
  1382.     # Make links, and run "make diststuff" or "make info" when needed.
  1383.     rm -rf proto-toplev ; mkdir proto-toplev
  1384.     set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
  1385.     for d in $$dirs ; do \
  1386.       if [ -d $$d ]; then \
  1387.         if [ ! -f $$d/Makefile ] ; then true ; \
  1388.         elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
  1389.         (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
  1390.         elif grep '^info:' $$d/Makefile >/dev/null ; then \
  1391.             (cd $$d ; $(MAKE) info ) || exit 1 ; \
  1392.         fi ; \
  1393.         if [ -d $$d/proto-$$d.dir ]; then \
  1394.           ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
  1395.         else \
  1396.           ln -s ../$$d proto-toplev/$$d ; \
  1397.         fi ; \
  1398.       else ln -s ../$$d proto-toplev/$$d ; fi ; \
  1399.     done
  1400.     cd etc ; $(MAKE) info
  1401.     $(MAKE) distclean
  1402.     #
  1403.     mkdir proto-toplev/etc
  1404.     (cd proto-toplev/etc; \
  1405.      for i in $(ETC_SUPPORT); do \
  1406.         ln -s ../../etc/$$i . ; \
  1407.      done)
  1408.     #
  1409.     # Take out texinfo from configurable dirs
  1410.     rm proto-toplev/configure.in
  1411.     sed -e '/^host_tools=/s/texinfo //' \
  1412.         <configure.in >proto-toplev/configure.in
  1413.     #
  1414.     mkdir proto-toplev/texinfo
  1415.     ln -s ../../texinfo/texinfo.tex        proto-toplev/texinfo/
  1416.     ln -s ../../texinfo/gpl.texinfo        proto-toplev/texinfo/
  1417.     ln -s ../../texinfo/lgpl.texinfo    proto-toplev/texinfo/
  1418.     if test -r texinfo/util/tex3patch ; then \
  1419.       mkdir proto-toplev/texinfo/util && \
  1420.       ln -s ../../../texinfo/util/tex3patch    proto-toplev/texinfo/util ; \
  1421.     else true; fi
  1422.     chmod og=u `find . -print`
  1423.     (VER=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \
  1424.         echo "==> Making $(TOOL)-$$VER.tar.gz"; \
  1425.         rm -f $(TOOL)-$$VER; ln -s proto-toplev $(TOOL)-$$VER; \
  1426.         tar cfh - $(TOOL)-$$VER \
  1427.         | $(GZIPPROG) -v -9 >$(TOOL)-$$VER.tar.gz )
  1428.  
  1429. TEXINFO_SUPPORT= texinfo/texinfo.tex texinfo/gpl.texinfo texinfo/lgpl.texinfo
  1430. DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
  1431.  
  1432. .PHONY: gas.tar.gz
  1433. GAS_SUPPORT_DIRS= bfd include libiberty opcodes make-all.com setup.com
  1434. gas.tar.gz: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
  1435.     $(MAKE) -f Makefile.in taz TOOL=gas \
  1436.         SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
  1437.  
  1438. # The FSF "binutils" release includes gprof and ld.
  1439. .PHONY: binutils.tar.gz
  1440. BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof make-all.com setup.com
  1441. binutils.tar.gz: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
  1442.     $(MAKE) -f Makefile.in taz TOOL=binutils \
  1443.         SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS) makeall.bat configure.bat"
  1444.  
  1445. .PHONY: gas+binutils.tar.gz
  1446. GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
  1447. gas+binutils.tar.gz: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
  1448.     $(MAKE) -f Makefile.in taz TOOL=gas \
  1449.         SUPPORT_FILES="$(GASB_SUPPORT_DIRS) makeall.bat configure.bat"
  1450.  
  1451. .PHONY: libg++.tar.gz
  1452. LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty
  1453. libg++.tar.gz: $(DIST_SUPPORT) libg++
  1454.     $(MAKE) -f Makefile.in taz TOOL=libg++ \
  1455.         SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)"
  1456.  
  1457. GNATS_SUPPORT_DIRS=include libiberty send-pr
  1458. gnats.tar.gz: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
  1459.     $(MAKE) -f  Makefile.in taz TOOL=gnats \
  1460.         SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
  1461.  
  1462. .PHONY: gdb.tar.gz
  1463. GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
  1464. GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
  1465. gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
  1466.     $(MAKE) -f Makefile.in taz TOOL=gdb \
  1467.         SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
  1468.  
  1469. .PHONY: newlib.tar.gz
  1470. NEWLIB_SUPPORT_DIRS=libgloss
  1471. # taz configures for the sun4 target which won't configure newlib.
  1472. # We need newlib configured so that the .info files are made.
  1473. # Unfortunately, it is not enough to just configure newlib separately:
  1474. # taz will build the .info files but since SUBDIRS won't contain newlib,
  1475. # distclean won't be run (leaving Makefile, config.status, and the tmp files
  1476. # used in building the .info files, eg: *.def, *.ref).
  1477. # The problem isn't solvable however without a lot of extra work because
  1478. # target libraries are built in subdir $(target_alias) which gets nuked during
  1479. # the make distclean.  For now punt on the issue of shipping newlib info files
  1480. # with newlib net releases and wait for a day when some native target (sun4?)
  1481. # supports newlib (if only minimally).
  1482. newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
  1483.     $(MAKE) -f Makefile.in taz TOOL=newlib \
  1484.         SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
  1485.         DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
  1486.  
  1487. .NOEXPORT:
  1488. MAKEOVERRIDES=
  1489.  
  1490.  
  1491. # end of Makefile.in
  1492.