🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51907

Automatic incremental make-depend for GCC and GNU ld

#51907
From: Brendan Eich
Date: Sun, 07 Mar 1993 22:27
2013 lines
63745 bytes
The attached shell archive contains a new "make depend" scheme for
gcc-2.3.3 and the binutils-2.0 ld.  Unlike other make-depend schemes that
require a post-processing phase to compress cpp-generated dependencies,
this package incrementally updates only the dependencies of .o and a.out
targets that are re-made during a make.  The dependencies can be kept in
a separate file included by the governing makefile, or can be kept in the
makefile itself.  The separate include file works better; then 'clobber'
can remove this file along with the targets whose recompilation will
recreate it.

Dependency inference is enabled with the '-MDupdate <depfile>' option to
gcc, where <depfile> names the dependency file to be updated.  Each make
target compiled or linked gets a line in the dependency file of the form

	target: dependency [...] #:toolname

where the trailing :toolname comment distinguishes cpp-generated header
dependencies of a .c file compiled directly into an a.out (e.g., cat.c
to cat) from ld-generated library and crt?.o dependencies.  Modern make
programs can cope with very long lines, and it doesn't seem worth the
complexity to pretty-print long dependency file logical lines by breaking
each into multiple physical lines using backslashes.

This code has been tested on SGI and MIPS systems, and contains ugly,
ad-hoc configuration-dependent ifdefs.  There's surely a better way, for
instance by using GNU configure, but I ran out of time and lack access
to other systems to port to.  I apologize for this mess.

I hereby donate make-depend.[ch] and the changes shown by the diffs to
Cygnus, GNU, and anyone else who will make good use of them and preserve
my name in the author history.

Brendan Eich
MicroUnity Systems Engineering, Inc.
brendan@microunity.com
-----
#!/bin/sh
# This is a shell archive (produced by shar 3.49)
# To extract the files from this archive, save it to a file, remove
# everything above the "!/bin/sh" line above, and type "sh file_name".
#
# made 03/06/1993 04:07 UTC by brendan@rimulac
# Source directory /N/auspex/root/s5/brendan/src/to-gcc2
#
# existing files will NOT be overwritten unless -c is specified
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   2109 -rw-rw-r-- README
#   3724 -rw-r--r-- gcc-2.3.3/cccp.c.diffs
#   4000 -rw-r--r-- gcc-2.3.3/collect2.c.diffs
#   7145 -rw-r--r-- gcc-2.3.3/gcc.c.diffs
#  11553 -rw-r--r-- make-depend.c
#   1636 -rw-r--r-- make-depend.h
#   1161 -rw-rw-r-- ld-binutils-2.0/ldgram.y.diffs
#    431 -rw-rw-r-- ld-binutils-2.0/ldlex.l.diffs
#    323 -rw-rw-r-- ld-binutils-2.0/ldmain.c.diffs
#    638 -rw-rw-r-- ld-binutils-2.0/ld.h.diffs
#   1098 -rw-rw-r-- ld-binutils-2.0/ldfile.c.diffs
#  16691 -rw-r--r-- ld-binutils-2.0/Makefile
#
# ============= README ==============
if test -f 'README' -a X"$1" != X"-c"; then
	echo 'x - skipping README (File already exists)'
else
echo 'x - extracting README (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'README' &&
This directory tree contains a new "make depend" scheme implemented
by code in make-depend.c, with the interface declared in make-depend.h,
and modified versions of gcc, GNU cpp, and several flavors of GNU ld.
The subdirectories are:
X
X    gcc-2.3.3		
X	Context diffs of modified GCC-2.3.3 sources:
X	    cccp.c.diffs
X	    collect2.c.diffs
X	    gcc.c.diffs
X
X    ld-binutils-2.0
X	Diffs and a modified Makefile for BINUTILS-2.0 ld sources:
X	    Makefile
X	    ld.h.diffs
X	    ldfile.c.diffs
X	    ldgram.y.diffs
X	    ldlex.l.diffs
X	    ldmain.c.diffs
X
X    make-depend.c
X    make-depend.h
X	Automatic, incremental make-depend implementation.
X
Unlike other make-depend schemes that require a postprocessing phase to
compress cpp-generated dependencies, this package incrementally updates
only the dependencies of .o and a.out targets that are re-made during a
build.  The dependencies can be kept in a separate file included by the
governing makefile, or can be kept in the makefile itself.  Dependency
inference is enabled with the '-MDupdate <depfile>' option to gcc, where
<depfile> names the dependency file to be updated.  Each target compiled
or linked gets a line in the dependency file of the form
X
X	target: dependency [...] #:toolname
X
where the trailing :toolname comment distinguishes cpp-generated header
dependencies of a .c file compiled directly into an a.out (e.g., cat.c
to cat) from ld-generated library and crt?.o dependencies.  Modern make
programs can cope with very long lines, and it doesn't seem worth the
complexity to pretty-print long dependency file logical lines by breaking
each into mulitiple physical lines using backslashes.
X
This code has been tested on SGI and MIPS systems, and contains ugly,
ad-hoc configuration-dependent ifdefs.  There's surely a better way, for
instance by using GNU configure, but I ran out of time and lack access
to other systems to port to.  I apologize for the mess.
X
I hereby donate make-depend.[ch] and the changes shown by the diffs to
Cygnus, GNU, and anyone else who will make good use of them and preserve
my name in the author history.
X
Brendan Eich
SHAR_EOF
chmod 0664 README ||
echo 'restore of README failed'
Wc_c="`wc -c < 'README'`"
test 2109 -eq "$Wc_c" ||
	echo 'README: original size 2109, current size' "$Wc_c"
fi
# ============= gcc-2.3.3/cccp.c.diffs ==============
if test ! -d 'gcc-2.3.3'; then
    echo 'x - creating directory gcc-2.3.3'
    mkdir 'gcc-2.3.3'
fi
if test -f 'gcc-2.3.3/cccp.c.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping gcc-2.3.3/cccp.c.diffs (File already exists)'
else
echo 'x - extracting gcc-2.3.3/cccp.c.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gcc-2.3.3/cccp.c.diffs' &&
*** /tmp/T0a16310	Wed Feb  3 13:38:21 1993
--- cccp.c	Fri Jan 29 14:11:38 1993
***************
*** 56,61 ****
--- 56,62 ----
X  #endif /* 0 */
X  
X  #include "pcp.h"
+ #include "make-depend.h"
X  
X  #ifndef STDC_VALUE
X  #define STDC_VALUE 1
***************
*** 356,361 ****
--- 357,368 ----
X  
X  static int print_deps = 0;
X  
+ /* Non-null means call MDrecord (see make-depend.h) for each included
+    file, and call MDclose after preprocessing.  Main sets this pointer
+    upon parsing the -MDupdate option, by calling MDopen.  */
+ 
+ static MDupdater deps_updater;
+ 
X  /* Nonzero means print names of header files (-H).  */
X  
X  static int print_include_names = 0;
***************
*** 1163,1181 ****
X  	break;
X  
X        case 'M':
X  	if (!strcmp (argv[i], "-M"))
X  	  print_deps = 2;
X  	else if (!strcmp (argv[i], "-MM"))
X  	  print_deps = 1;
! 	else if (!strcmp (argv[i], "-MD"))
X  	  print_deps = 2;
! 	else if (!strcmp (argv[i], "-MMD"))
X  	  print_deps = 1;
X  	/* For -MD and -MMD options, write deps on file named by next arg.  */
! 	if (!strcmp (argv[i], "-MD")
! 	    || !strcmp (argv[i], "-MMD")) {
! 	  i++;
! 	  deps_file = argv[i];
X  	} else {
X  	  /* For -M and -MM, write deps on standard output
X  	     and suppress the usual output.  */
--- 1170,1199 ----
X  	break;
X  
X        case 'M':
+       {
+ 	int is_MD = 0, is_MMD = 0, is_MDupdate = 0, is_MDtarget = 0;
+ 
X  	if (!strcmp (argv[i], "-M"))
X  	  print_deps = 2;
X  	else if (!strcmp (argv[i], "-MM"))
X  	  print_deps = 1;
! 	else if (is_MD = !strcmp (argv[i], "-MD"))
X  	  print_deps = 2;
! 	else if (is_MMD = !strcmp (argv[i], "-MMD"))
X  	  print_deps = 1;
X  	/* For -MD and -MMD options, write deps on file named by next arg.  */
! 	if (is_MD
! 	    || is_MMD
! 	    || (is_MDupdate = !strcmp (argv[i], "-MDupdate"))
! 	    || (is_MDtarget = !strcmp (argv[i], "-MDtarget"))) {
! 	  if (++i == argc)
! 	    fatal ("Makefile name missing after %s option", argv[--i]);
! 	  if (is_MDupdate)
! 	    deps_updater = MDopen (argv[i], "cpp");
! 	  else if (is_MDtarget)
! 	    deps_target = argv[i];
! 	  else
! 	    deps_file = argv[i];
X  	} else {
X  	  /* For -M and -MM, write deps on standard output
X  	     and suppress the usual output.  */
***************
*** 1183,1188 ****
--- 1201,1207 ----
X  	  inhibit_output = 1;
X  	}	  
X  	break;
+       }
X  
X        case 'd':
X  	{
***************
*** 1336,1342 ****
X  	if (in_fname == NULL) {
X  	  in_fname = "";
X  	  break;
! 	} else if (out_fname == NULL) {
X  	  out_fname = "";
X  	  break;
X  	}	/* else fall through into error */
--- 1355,1362 ----
X  	if (in_fname == NULL) {
X  	  in_fname = "";
X  	  break;
! 	}
! 	if (out_fname == NULL) {
X  	  out_fname = "";
X  	  break;
X  	}	/* else fall through into error */
***************
*** 1372,1377 ****
--- 1392,1399 ----
X    fp = &instack[++indepth];
X    if (in_fname == NULL)
X      in_fname = "";
+   if (deps_updater && deps_target == NULL)
+     deps_target = in_fname;
X    fp->nominal_fname = fp->fname = in_fname;
X    fp->lineno = 0;
X  
***************
*** 1823,1828 ****
--- 1845,1853 ----
X  	  fatal ("I/O error on output");
X        }
X      }
+   } else if (deps_updater && errors == 0) {
+     if (! MDclose (deps_updater, deps_target))
+       errors++;
X    }
X  
X    if (ferror (stdout) || fclose (stdout) != 0)
***************
*** 3926,3933 ****
X  	deps_output ("", 0);
X  	deps_output (fname, 0);
X  	deps_output (" ", 0);
!       }
!     }   
X  
X      /* Handle -H option.  */
X      if (print_include_names)
--- 3951,3959 ----
X  	deps_output ("", 0);
X  	deps_output (fname, 0);
X  	deps_output (" ", 0);
!       } else if (deps_updater)
! 	MDrecord (deps_updater, ptr->fname);
!     }
X  
X      /* Handle -H option.  */
X      if (print_include_names)
SHAR_EOF
chmod 0644 gcc-2.3.3/cccp.c.diffs ||
echo 'restore of gcc-2.3.3/cccp.c.diffs failed'
Wc_c="`wc -c < 'gcc-2.3.3/cccp.c.diffs'`"
test 3724 -eq "$Wc_c" ||
	echo 'gcc-2.3.3/cccp.c.diffs: original size 3724, current size' "$Wc_c"
fi
# ============= gcc-2.3.3/collect2.c.diffs ==============
if test -f 'gcc-2.3.3/collect2.c.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping gcc-2.3.3/collect2.c.diffs (File already exists)'
else
echo 'x - extracting gcc-2.3.3/collect2.c.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gcc-2.3.3/collect2.c.diffs' &&
*** /tmp/T0a16318	Wed Feb  3 13:39:06 1993
--- collect2.c	Fri Jan 29 14:11:43 1993
***************
*** 44,50 ****
--- 44,67 ----
X  #define COLLECT
X  
X  #include "config.h"
+ #include "make-depend.h"
X  
+ /* Define which switch letters take arguments unless config.h did.  */
+ 
+ #ifndef SWITCH_TAKES_ARG
+ #define SWITCH_TAKES_ARG(CHAR)      \
+   ((CHAR) == 'o' || (CHAR) == 'L' || (CHAR) == 'A')
+ #endif
+ 
+ /* Define which multi-letter switches take arguments unless config.h did.  */
+ 
+ #ifndef WORD_SWITCH_TAKES_ARG
+ #define WORD_SWITCH_TAKES_ARG(STR)			\
+  (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext")	\
+   || !strcmp (STR, "Tbss") || !strcmp (STR, "objectlist")	\
+   || !strcmp (STR, "MDupdate"))
+ #endif
+ 
X  #ifndef __STDC__
X  #define generic char
X  #define const
***************
*** 470,475 ****
--- 487,499 ----
X    int num_c_args	= argc+7;
X    int len;
X    int clen;
+   MDupdater deps_updater = NULL;
+   char **library_path	= (char **) xcalloc (sizeof (char *), argc);
+   char **libpathp	= library_path;
+   char **libraries	= (char **) xcalloc (sizeof (char *), argc);
+   char **libp		= libraries;
+   int nostdlib		= 0;
+   int exitcode		= 0;
X  
X  #ifdef DEBUG
X    debug = 1;
***************
*** 715,728 ****
X  	      if (arg[2] == '\0')
X  		vflag = 1;
X  	      break;
X  	    }
X  
!       else if (first_file
! 	       && (p = rindex (arg, '.')) != (char *)0
! 	       && strcmp (p, ".o") == 0)
X  	{
! 	  first_file = 0;
! 	  *ld2++ = o_file;
X  	}
X      }
X  
--- 739,782 ----
X  	      if (arg[2] == '\0')
X  		vflag = 1;
X  	      break;
+ 
+ 	    case 'M':
+ 	      if (!strcmp (arg, "-MDupdate"))
+ 		{
+ 		  deps_updater = MDopen (*++argv, "ld");
+ 		  ld1--, ld2--;
+ 		}
+ 	      break;
+ 
+ 	    case 'L':
+ 	      *libpathp++ = (arg[2] == '\0') ? argv[1] : &arg[2];
+ 	      break;
+ 
+ 	    case 'l':
+ 	      *libp++ = &arg[2];
+ 	      break;
+ 
+ 	    case 'n':
+ 	      if (!strcmp (arg, "-nostdlib"))
+ 		nostdlib = 1;
+ 	      break;
X  	    }
X  
!       else
X  	{
! 	  if (first_file
! 	      && (p = rindex (arg, '.')) != (char *)0
! 	      && strcmp (p, ".o") == 0)
! 	  {
! 	    first_file = 0;
! 	    *ld2++ = o_file;
! 	  }
! 
! 	  if (deps_updater
! 	      && !(SWITCH_TAKES_ARG (argv[-1][1]) > (argv[-1][2] != 0)
! 		   || WORD_SWITCH_TAKES_ARG (&argv[-1][1])))
! 
! 	    MDrecord (deps_updater, arg);
X  	}
X      }
X  
***************
*** 788,796 ****
X  
X    fork_execute (ld_file_name, ld1_argv);
X  
X    /* If -r, don't build the constructor or destructor list, just return now.  */
X    if (rflag)
!     return 0;
X  
X    scan_prog_file (outfile, PASS_FIRST);
X  
--- 842,874 ----
X  
X    fork_execute (ld_file_name, ld1_argv);
X  
+   if (deps_updater)
+     {
+       char *lib, *dir, *buf;
+ 
+       if (nostdlib == 0)
+ 	*libpathp++ = "/usr/lib";
+ 
+       for (libp = libraries; (lib = *libp) != NULL; libp++)
+ 	for (libpathp = library_path; (dir = *libpathp) != NULL; libpathp++)
+ 	  {
+ 	    buf = xmalloc (strlen (dir) + 4 + strlen (lib) + 3);
+ 	    sprintf (buf, "%s/lib%s.a", dir, lib);
+ 	    if (access (buf, R_OK) == 0)
+ 	      {
+ 		MDrecord (deps_updater, buf);
+ 		break;
+ 	      }
+ 	    free (buf);
+ 	  }
+ 
+       if (! MDclose (deps_updater, outfile))
+ 	exitcode = 1;
+     }
+ 
X    /* If -r, don't build the constructor or destructor list, just return now.  */
X    if (rflag)
!     return exitcode;
X  
X    scan_prog_file (outfile, PASS_FIRST);
X  
***************
*** 811,817 ****
X  	  strip_argv[2] = (char *) 0;
X  	  fork_execute (strip_file_name, strip_argv);
X  	}
!       return 0;
X      }
X  
X    outf = fopen (c_file, "w");
--- 889,895 ----
X  	  strip_argv[2] = (char *) 0;
X  	  fork_execute (strip_file_name, strip_argv);
X  	}
!       return exitcode;
X      }
X  
X    outf = fopen (c_file, "w");
***************
*** 842,848 ****
X  
X    maybe_unlink (c_file);
X    maybe_unlink (o_file);
!   return 0;
X  }
X  
X  
--- 920,926 ----
X  
X    maybe_unlink (c_file);
X    maybe_unlink (o_file);
!   return exitcode;
X  }
X  
X  
SHAR_EOF
chmod 0644 gcc-2.3.3/collect2.c.diffs ||
echo 'restore of gcc-2.3.3/collect2.c.diffs failed'
Wc_c="`wc -c < 'gcc-2.3.3/collect2.c.diffs'`"
test 4000 -eq "$Wc_c" ||
	echo 'gcc-2.3.3/collect2.c.diffs: original size 4000, current size' "$Wc_c"
fi
# ============= gcc-2.3.3/gcc.c.diffs ==============
if test -f 'gcc-2.3.3/gcc.c.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping gcc-2.3.3/gcc.c.diffs (File already exists)'
else
echo 'x - extracting gcc-2.3.3/gcc.c.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gcc-2.3.3/gcc.c.diffs' &&
*** /tmp/T0a16313	Wed Feb  3 13:38:35 1993
--- gcc.c	Fri Jan 29 14:48:17 1993
***************
*** 394,400 ****
X  #define WORD_SWITCH_TAKES_ARG(STR)			\
X   (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext")	\
X    || !strcmp (STR, "Tbss") || !strcmp (STR, "include")	\
!   || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info"))
X  #endif
X  
X  /* Record the mapping from file suffixes for compilation specs.  */
--- 394,401 ----
X  #define WORD_SWITCH_TAKES_ARG(STR)			\
X   (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext")	\
X    || !strcmp (STR, "Tbss") || !strcmp (STR, "include")	\
!   || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
!   || !strcmp (STR, "MDupdate"))
X  #endif
X  
X  /* Record the mapping from file suffixes for compilation specs.  */
***************
*** 432,437 ****
--- 433,439 ----
X     "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
X  	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
+ 	%{MDupdate} %{MDupdate:%{o*:-MDtarget %*}}\
X          -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
X  	%{!undef:%{!ansi:%p} %P} %{trigraphs} \
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
***************
*** 452,457 ****
--- 454,460 ----
X     "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
X  	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
+ 	%{MDupdate} %{MDupdate:%{o*:-MDtarget %*}}\
X          -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
X  	%{!undef:%{!ansi:%p} %P} %{trigraphs}\
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
***************
*** 464,469 ****
--- 467,473 ----
X     "cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
X  	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
+ 	%{MDupdate} %{MDupdate:%{o*:-MDtarget %*}}\
X          -undef -D__OBJC__ -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
X  	%{!undef:%{!ansi:%p} %P} %{trigraphs}\
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
***************
*** 486,492 ****
X     "%{!E:%eCompilation of header file requested} \
X      cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
! 	 %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
X          -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
X  	%{!undef:%{!ansi:%p} %P} %{trigraphs}\
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
--- 490,497 ----
X     "%{!E:%eCompilation of header file requested} \
X      cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
! 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
! 	%{MDupdate} %{MDupdate:%{o*:-MDtarget %*}}\
X          -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\
X  	%{!undef:%{!ansi:%p} %P} %{trigraphs}\
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
***************
*** 495,505 ****
X          %i %W{o*}"},
X    {".cc", "@c++"},
X    {".cxx", "@c++"},
X    {".C", "@c++"},
X    {"@c++",
X     "cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
! 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \
X  	-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \
X  	%{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
--- 500,512 ----
X          %i %W{o*}"},
X    {".cc", "@c++"},
X    {".cxx", "@c++"},
+   {".c++", "@c++"},
X    {".C", "@c++"},
X    {"@c++",
X     "cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
! 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\
! 	%{MDupdate} %{MDupdate:%{o*:-MDtarget %*}}\
X  	-undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus \
X  	%{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!undef:%{!ansi:%p} %P}\
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
***************
*** 527,532 ****
--- 534,540 ----
X      %{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\
X              %{c:%W{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%u.o} %{!pipe:%g.s} %A\n }"},
X    {".ii", "@c++-cpp-output"},
+   {".i++", "@c++-cpp-output"},
X    {"@c++-cpp-output",
X     "cc1plus %i %1 %2 %{!Q:-quiet} %{d*} %{m*} %{a}\
X  	    %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi} %{traditional}\
***************
*** 545,551 ****
X    {"@assembler-with-cpp",
X     "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
! 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \
X          -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
X          %{traditional-cpp:-traditional}\
--- 553,560 ----
X    {"@assembler-with-cpp",
X     "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\
X  	%{C:%{!E:%eGNU C does not support -C without using -E}}\
! 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs}\
! 	%{MDupdate} %{MDupdate:%{o*:-MDtarget %*}}\
X          -undef -$ %{!undef:%p %P} -D__ASSEMBLER__ \
X          %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
X          %{traditional-cpp:-traditional}\
***************
*** 574,579 ****
--- 583,589 ----
X  %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
X  			%{r} %{s} %{T*} %{t} %{u*} %{x} %{z}\
X  			%{!A:%{!nostdlib:%S}} %{static:}\
+ 			%{MDupdate}\
X  			%{L*} %D %o %{!nostdlib:libgcc.a%s %L libgcc.a%s %{!A:%E}}\n }}}}}";
X  #else
X  #ifdef LINK_LIBGCC_SPECIAL
***************
*** 582,587 ****
--- 592,598 ----
X  %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
X  			%{r} %{s} %{T*} %{t} %{u*} %{x} %{z}\
X  			%{!A:%{!nostdlib:%S}} %{static:}\
+ 			%{MDupdate}\
X  			%{L*} %o %{!nostdlib:libgcc.a%s %L libgcc.a%s %{!A:%E}}\n }}}}}";
X  #else
X  /* Use -L and have the linker do the search for -lgcc.  */
***************
*** 589,594 ****
--- 600,606 ----
X  %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
X  			%{r} %{s} %{T*} %{t} %{u*} %{x} %{z}\
X  			%{!A:%{!nostdlib:%S}} %{static:}\
+ 			%{MDupdate}\
X  			%{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}";
X  #endif
X  #endif
***************
*** 2382,2388 ****
X     INSWITCH nonzero means don't process %-sequences in SPEC;
X     in this case, % is treated as an ordinary character.
X     This is used while substituting switches.
!    INSWITCH nonzero also causes SPC not to terminate an argument.
X  
X     Value is zero unless a line was finished
X     and the command on that line reported an error.  */
--- 2394,2400 ----
X     INSWITCH nonzero means don't process %-sequences in SPEC;
X     in this case, % is treated as an ordinary character.
X     This is used while substituting switches.
!    INSWITCH nonzero also causes SPEC not to terminate an argument.
X  
X     Value is zero unless a line was finished
X     and the command on that line reported an error.  */
SHAR_EOF
chmod 0644 gcc-2.3.3/gcc.c.diffs ||
echo 'restore of gcc-2.3.3/gcc.c.diffs failed'
Wc_c="`wc -c < 'gcc-2.3.3/gcc.c.diffs'`"
test 7145 -eq "$Wc_c" ||
	echo 'gcc-2.3.3/gcc.c.diffs: original size 7145, current size' "$Wc_c"
fi
# ============= make-depend.c ==============
if test -f 'make-depend.c' -a X"$1" != X"-c"; then
	echo 'x - skipping make-depend.c (File already exists)'
else
echo 'x - extracting make-depend.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'make-depend.c' &&
/*
X * GCC/GLD -MDupdate option implementation.
X *
X * Brendan Eich, 1/22/93.
X */
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>			/* for flock(2) stuff */
#include <sys/stat.h>
#include "make-depend.h"
X
#if defined sgi || !defined mips
X
#include <unistd.h>			/* useful system call prototypes */
#include <sys/mman.h>
X
#define USE_MMAP	1
#define SYSV_SPRINTF	1
#define LAME_ERRNO_H	0
#ifdef sgi
#define LAME_LOCKD	1
#endif
X
#else  /* MIPS, RISCOS actually */
X
#define USE_MMAP	0
#define SYSV_SPRINTF	0		/* we use RISCOS BSD compatibility */
#define LAME_ERRNO_H	1
#define LAME_LOCKD	0
X
#endif /* MIPS */
X
#if LAME_ERRNO_H
extern int errno;			/* errno.h should declare these */
extern int sys_nerr;
extern char *sys_errlist[];
X
static char *
strerror(unsigned int error)
{
X	return (error < sys_nerr) ? sys_errlist[error] : "No error";
}
#endif /* LAME_ERRNO_H */
X
#if LAME_LOCKD
#include <sys/fsid.h>			/* filesystem type identifiers */
#include <sys/fstyp.h>			/* sysfs(2) definitions */
#include <sys/statfs.h>			/* statfs(2) definitions */
X
static int
is_nfs(int fd)
{
X	struct statfs sfb;
X
X	return fstatfs(fd, &sfb, sizeof sfb, 0) == 0 &&
X	       sfb.f_fstyp == sysfs(GETFSIND, FSID_NFS);
}
#endif /* LAME_LOCKD */
X
#ifdef MD_METER
#define METER(x)	x
#else
#define METER(x)
#endif
X
typedef struct Dependency *Dependency;
X
struct Dependency {
X	const char	*name;		/* dependency filename */
X	size_t		length;		/* filename length */
X	Dependency	next;		/* next in hash chain */
};
X
#define HASHSIZE	101		/* prime, but is it big enough? */
X
struct MDupdater {
X	const char	*depfile;	/* makefile to update */
X	const char	*toolname;	/* tool doing the updating */
X	size_t		newdeplen;	/* formatted size of dependencies */
X	int		depcount;	/* number of dependencies */
X	Dependency	hash[HASHSIZE];	/* hash table of dependencies */
#ifdef MD_METER
X	unsigned int	probes;		/* number of hash probes */
X	unsigned int	steps;		/* hash chain link traversals */
X	unsigned int	dupenters;	/* redundant includes */
X	unsigned int	maxchain;	/* worst hash chain length */
#endif
};
X
X
MDupdater
MDopen(const char *depfile, const char *toolname)
{
X	MDupdater updater;
X
X	if ((updater = malloc(sizeof *updater)) == NULL) {
X		fprintf(stderr, "%s: %s\n", toolname, strerror(errno));
X		return NULL;
X	}
X	bzero(updater, sizeof *updater);
X	updater->depfile = depfile;
X	updater->toolname = toolname;
X	return updater;
}
X
void
MDrecord(MDupdater updater, const char *filename)
{
X	unsigned int h;
X	const char *s;
X	size_t length;
X	Dependency d, *bucket;
X
X	METER(int chainlen = 0);
X	METER(updater->probes++);
X
X	/*
X	 * Hash filename.  Don't hash the common suffixes.
X	 */
X	h = 0;
X	for (s = filename; *s != '\0'; s++) {
X		if (s[0] == '.' &&
X		    s[2] == '\0' &&
X		    (s[1] == 'h' || s[1] == 'o' || s[1] == 'a')) {
X			s += 2;
X			break;
X		}
X		h = (h << 1) ^ *s;
X	}
X	length = s - filename;
X
X	/*
X	 * Search for a previously recorded dependency on filename.
X	 */
X	bucket = &updater->hash[h % HASHSIZE];
X	for (d = *bucket; d != NULL; d = d->next) {
X		if (d->length == length && strcmp(d->name, filename) == 0) {
X			METER(updater->dupenters++);
X			return;
X		}
X		METER(updater->steps++);
X		METER(chainlen++);
X	}
X
X	/*
X	 * If none, record one now.
X	 */
X	if ((d = malloc(sizeof *d)) == NULL) {
X		fprintf(stderr, "%s: %s\n", updater->toolname, strerror(errno));
X		return;
X	}
X	d->name = filename;
X	d->length = length;
X	d->next = *bucket;
X	*bucket = d;
X
X	/*
X	 * 1 for the leading space separator.
X	 */
X	updater->newdeplen += 1 + length;
X	updater->depcount++;
X	METER(if (++chainlen > updater->maxchain)
X		updater->maxchain = chainlen);
}
X
#define TOOLSIG_MAX	8		/* "#:cpp\0" is worst case */
X
/*
X * True if suf is a multi-character C++ suffix (.cc, .cxx, or .c++).
X */
#define IS_C_PLUS_PLUS_SUFFIX(suf) \
X	((suf)[0] == 'c' && \
X	 ((suf)[1] == 'c' && (suf)[2] == '\0' || \
X	  (suf)[1] == 'x' && (suf)[2] == 'x' && (suf)[3] == '\0' || \
X	  (suf)[1] == '+' && (suf)[2] == '+' && (suf)[3] == '\0'))
X
/*
X * Mapped file interface wrappers to hide lack of regular file mmap on MIPS.
X */
static char *
mapfile(int fd, int size)
{
X	char *base;
X	
#if USE_MMAP
X	base = (char *)mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
X	if ((int)base < 0)
X		return NULL;
#else
X	if ((base = malloc(size)) == NULL)
X		return NULL;
X	if (read(fd, base, size) < 0) {
X		free(base);
X		return NULL;
X	}
#endif
X	return base;
}
X
static int
syncfile(int fd, char *base, int size)
{
#if USE_MMAP
X	return msync(base, size, 0);
#else
X	if (lseek(fd, (off_t)0, 0) < 0)
X		return -1;
X	return write(fd, base, size);
#endif
}
X
static int
unmapfile(char *base, int size)
{
#if USE_MMAP
X	return munmap(base, size);
#else
X	free(base);
X	return 0;
#endif
}
X
static int
depcmp(const void *dpp1, const void *dpp2)
{
X	return strcmp(*(const char **)dpp1, *(const char **)dpp2);
}
X
int
MDclose(MDupdater updater, char *target)
{
X	size_t targetlen, toolsiglen, newdeplen, deplen;
X	int ok = 1, dirty = 0;
X	int fd, i, n;
X	struct stat stb;
X	char *dp;
X	char targetchar0;		/* target[0], loop-invariant */
X	char *suffix, sufsave[4];	/* "c" if target is "x.c", e.g. */
X	char *base, *limit;		/* mmap base & limit */
X	char toolsig[TOOLSIG_MAX];	/* tool signature comment */
X	const char **newdepv, *newdep;	/* dependency string ptrs */
X	Dependency d, nextd;		/* dependency struct ptrs */
X	char *bp, *ep;			/* line begin & end ptrs */
X	FILE *fp;
X
X	/*
X	 * Set target now if it wasn't set by MDopen.  Advance target
X	 * to point to its basename if it has a directory prefix.
X	 */
X	if (target == NULL || *target == '\0')
X		target = "<stdin>";
X	else {
X		while ((dp = strrchr(target, '/')) != NULL) {
X			if (dp[1] != '\0') {
X				target = dp + 1;
X				break;
X			}
X			*dp = '\0';
X		}
X	}
X	targetchar0 = *target;
X
X	/*
X	 * Change target.c to target.o if necessary.  Eliminate the
X	 * .X suffix used by OSF's osf.prog.mk make rule as a temporary
X	 * filename that's renamed to the final program name after ld
X	 * exits successfully.
X	 */
X	targetlen = strlen(target);
X	if (targetlen > 2 && target[targetlen-2] == '.') {
X		suffix = &target[targetlen-1];
X		sufsave[0] = *suffix;
X		sufsave[1] = '\0';
X		if (sufsave[0] == 'X')
X			suffix[-1] = '\0', targetlen -= 2;
X		else
X			suffix[0] = 'o';
X	} else if ((suffix = strrchr(target, '.')) != NULL &&
X		   IS_C_PLUS_PLUS_SUFFIX(suffix+1)) {
X		suffix++;
X		(void) strcpy(sufsave, suffix);
X		suffix[0] = 'o';
X		suffix[1] = '\0';
X		targetlen = suffix - target + 1;
X	} else
X		suffix = NULL;
X
X	/*
X	 * Open, lock, and mmap the dependencies makefile.
X	 */
X	base = NULL;
X	if ((fd = open(updater->depfile, O_CREAT|O_RDWR, 0666)) < 0 ||
X	    fstat(fd, &stb) < 0 ||
#if LAME_LOCKD
X	    /*
X	     * Some vendors' NFS locking is badly broken: run cpp -MDupdate
X	     * once, everything's cool.  Run it again and hang on leftover
X	     * bookkeeping that lockd forgot to clean up.
X	     */
X	    !is_nfs(fd) &&
#endif
X	    flock(fd, LOCK_EX) < 0 ||
X	    stb.st_size > 0 &&
X	    (base = mapfile(fd, stb.st_size)) == NULL) {
X		fprintf(stderr, "%s: %s: %s\n",
X			updater->toolname, updater->depfile, strerror(errno));
X		ok = 0;
X		goto out;
X	}
X
X	/*
X	 * Make sure depfile ends in a newline if it's non-empty.
X	 */
X	limit = base + stb.st_size;
X	if (stb.st_size > 0 && limit[-1] != '\n') {
X		(void) ftruncate(fd, 0);
X		limit = base;
X	}
X
X	/*
X	 * Format our tool signature comment.
X	 */
#if SYSV_SPRINTF
X	toolsiglen = sprintf(toolsig, " #:%.*s",
X			     TOOLSIG_MAX-3, updater->toolname);
#else
X	/* disgusting BSD sprintf */
X	(void) sprintf(toolsig, " #:%.*s", TOOLSIG_MAX-3, updater->toolname);
X	toolsiglen = strlen(toolsig);
#endif
X
X	/*
X	 * Format the new dependencies in temporary store so we can
X	 * compare them to target's old ones.
X	 */
X	newdepv = alloca(updater->depcount * sizeof *newdepv);
X	for (i = n = 0; i < HASHSIZE; i++) {
X		for (d = updater->hash[i]; d != NULL; d = d->next)
X			newdepv[n++] = d->name;
X	}
X	qsort(newdepv, n, sizeof *newdepv, depcmp);
X	newdeplen = updater->newdeplen;
X	newdep = alloca(newdeplen + 1);
X	dp = (char *)newdep;
X	for (i = 0; i < n; i++) {
#if SYSV_SPRINTF
X		dp += sprintf(dp, " %s", newdepv[i]);
#else
X		/* disgusting BSD sprintf */
X		(void) sprintf(dp, " %s", newdepv[i]);
X		dp += 1 + strlen(newdepv[i]);
#endif
X	}
X
X	/*
X	 * Search for "^target:.*toolsig\n" and slide the rest of the
X	 * file down over it.
X	 *
X	 * We optimize the case where old and new dependencies match,
X	 * and the case where old and new consume the same # of bytes.
X	 * We could optimize further in the case where new takes fewer
X	 * bytes than old, by commenting out the trailing chars (we'd
X	 * have to put a newline before the comment char, to keep the
X	 * toolsig matching code simple).  This effort does not seem
X	 * worth the bloat and trouble right now.
X	 */
X	for (bp = base; bp < limit; bp = ep + 1) {
X		/*
X		 * Find end of line and do quick tests for target.
X		 */
X		ep = strchr(bp, '\n');
X		if (*bp != targetchar0)
X			continue;
X		dp = bp + targetlen;
X		if (*dp != ':')
X			continue;
X
X		/*
X		 * Now do the more expensive, complete comparison.
X		 */
X		if (bcmp(bp+1, target+1, targetlen-1) == 0) {
X			/*
X			 * Match tool signatures before proceeding.
X			 */
X			deplen = ep - ++dp;
X			if (deplen < toolsiglen ||
X			    bcmp(ep - toolsiglen, toolsig, toolsiglen) != 0) {
X				/*
X				 * Either this line is bogus or it belongs to
X				 * some other tool.
X				 */
X				continue;
X			}
X			deplen -= toolsiglen;
X			dirty = 1;
X
X			/*
X			 * Compare old and new dependencies' total string
X			 * lengths, then compare strings.
X			 */
X			if (deplen == newdeplen) {
X				if (bcmp(dp, newdep, deplen) != 0) {
X					/*
X					 * New dependencies differ from old,
X					 * but happen to be the same length.
X					 * Overwrite in place.
X					 */
X					bcopy(newdep, dp, deplen);
X				}
X				goto out;
X			}
X
X			/*
X			 * New dependencies take more or less space than
X			 * old ones.  Copy the rest of the file down over
X			 * this line.
X			 */
X			ep++;
X			bcopy(ep, bp, limit - ep);
X			limit -= ep - bp;
X			break;
X		}
X	}
X
X	/*
X	 * Append target's new dependencies.
X	 */
X	if (stb.st_size > 0 && ftruncate(fd, limit - base) < 0 ||
X	    dirty && syncfile(fd, base, limit - base) < 0) {
X		fprintf(stderr, "%s: %s: %s\n",
X			updater->toolname, updater->depfile, strerror(errno));
X		ok = 0;
X		goto out;
X	}
X	if ((fp = fdopen(fd, "a")) == NULL) {
X		fprintf(stderr, "%s: %s: too many open files (%s)\n",
X			updater->toolname, updater->depfile, strerror(errno));
X		ok = 0;
X		goto out;
X	}
#ifdef MD_METER
X	/*
X	 * If MD_METER is defined, write hash statistics prefixed by toolsig
X	 * as a comment line before the dependency line.
X	 */
X	(void) fprintf(fp,
X	  "%s %s probes %u steps %u steps/probe %g dupenters %u maxchain %u\n",
X		       toolsig, target, updater->probes, updater->steps,
X		       (updater->probes != 0)
X			   ? (double) updater->steps / updater->probes
X			   : 0.,
X		       updater->dupenters, updater->maxchain);
#endif
X	(void) fprintf(fp, "%s:%s%s\n", target, newdep, toolsig);
X	if (fclose(fp) == EOF) {
X		fprintf(stderr, "%s: %s: can't update %s dependencies (%s)\n",
X			updater->toolname, updater->depfile, target,
X			strerror(errno));
X		ok = 0;
X	}
X	fd = -1;
X
out:
X	/*
X	 * Unmap, close, restore, and free.
X	 */
X	if (base != NULL)
X		(void) unmapfile(base, stb.st_size);
X	if (fd >= 0)
X		(void) close(fd);
X
X	if (suffix != NULL) {
X		if (sufsave[0] == 'X')
X			suffix[-1] = '.';	/* suffix[0] is still 'X' */
X		else
X			(void) strcpy(suffix, sufsave);
X	}
X
X	for (i = 0; i < HASHSIZE; i++)
X		for (d = updater->hash[i]; d != NULL; d = nextd) {
X			nextd = d->next;
X			free(d);
X		}
X	free(updater);
X	return ok;
}
SHAR_EOF
chmod 0644 make-depend.c ||
echo 'restore of make-depend.c failed'
Wc_c="`wc -c < 'make-depend.c'`"
test 11553 -eq "$Wc_c" ||
	echo 'make-depend.c: original size 11553, current size' "$Wc_c"
fi
# ============= make-depend.h ==============
if test -f 'make-depend.h' -a X"$1" != X"-c"; then
	echo 'x - skipping make-depend.h (File already exists)'
else
echo 'x - extracting make-depend.h (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'make-depend.h' &&
#ifndef __MAKE_DEPEND_H__
#define __MAKE_DEPEND_H__
/*
X * Interface to the GCC/GLD -MDupdate option implementation.
X *
X * Brendan Eich, 1/22/93.
X */
X
typedef struct MDupdater *MDupdater;
X
/*
X * MDupdater MDopen(depfile, toolname)
X *	const char *depfile;
X *	const char *toolname;
X *
X * Open the makefile named by depfile and prepare to update make
X * dependencies from a target to its include files, libraries and
X * runtime objects.  Toolname is "cpp" or "ld" and distinguishes
X * dependencies from the same target to headers and libraries.
X *
X * Target typically names the .c file being compiled.  MDopen()
X * rewrites its suffix, if present, to ".o".  Recognized suffixes
X * include all single-letter ones, .cc, .cxx, and .c++.
X *
X * NB: All three strings must be in safe store; MDopen() doesn't
X * strdup them.
X */
extern MDupdater MDopen(const char *, const char *);
X
/*
X * void MDrecord(updater, filename)
X *	MDupdater updater;
X *	const char *filename;
X *
X * Add a dependency from the current target to filename to the list
X * of dependencies that updater is accumulating.
X *
X * NB: filename must reside in safe store.
X */
extern void MDrecord(MDupdater, const char *);
X
/*
X * void MDclose(updater, target)
X *	MDupdater updater;
X *	char *target;
X *
X * Finish adding dependencies for target, delete any old ones for
X * target in the updater's file, and write the new ones.  Target
X * may be null if a non-null target was passed to MDopen().
X *
X * This function returns 1 on success and 0 on failure.  Callers
X * should reflect failure in their exit status.
X */
extern int MDclose(MDupdater, char *);
X
#endif /* __MAKE_DEPEND_H__ */
SHAR_EOF
chmod 0644 make-depend.h ||
echo 'restore of make-depend.h failed'
Wc_c="`wc -c < 'make-depend.h'`"
test 1636 -eq "$Wc_c" ||
	echo 'make-depend.h: original size 1636, current size' "$Wc_c"
fi
# ============= ld-binutils-2.0/ldgram.y.diffs ==============
if test ! -d 'ld-binutils-2.0'; then
    echo 'x - creating directory ld-binutils-2.0'
    mkdir 'ld-binutils-2.0'
fi
if test -f 'ld-binutils-2.0/ldgram.y.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping ld-binutils-2.0/ldgram.y.diffs (File already exists)'
else
echo 'x - extracting ld-binutils-2.0/ldgram.y.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ld-binutils-2.0/ldgram.y.diffs' &&
*** /tmp/T0a05048	Fri Feb 19 18:56:01 1993
--- ldgram.y	Fri Feb 19 18:02:20 1993
***************
*** 141,147 ****
X  %token <integer> SIZEOF NEXT ADDR 
X  %token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
X  %token OPTION_v OPTION_V OPTION_M OPTION_t STARTUP HLL SYSLIB FLOAT  NOFLOAT 
! %token OPTION_Map
X  %token OPTION_n OPTION_r OPTION_o OPTION_b  OPTION_R OPTION_relax
X  %token <name> OPTION_l OPTION_L  OPTION_T OPTION_Aarch OPTION_Tfile  OPTION_Texp
X  %token OPTION_Ur 
--- 141,147 ----
X  %token <integer> SIZEOF NEXT ADDR 
X  %token OPTION_d OPTION_dc OPTION_dp OPTION_x OPTION_X OPTION_defsym
X  %token OPTION_v OPTION_V OPTION_M OPTION_t STARTUP HLL SYSLIB FLOAT  NOFLOAT 
! %token OPTION_Map OPTION_MDupdate
X  %token OPTION_n OPTION_r OPTION_o OPTION_b  OPTION_R OPTION_relax
X  %token <name> OPTION_l OPTION_L  OPTION_T OPTION_Aarch OPTION_Tfile  OPTION_Texp
X  %token OPTION_Ur 
***************
*** 195,200 ****
--- 195,203 ----
X  	|	OPTION_M {
X  	    config.map_filename = "-";
X  			    
+ 			}
+ 	|	OPTION_MDupdate filename {
+ 			config.deps_updater = MDopen ($2, "ld");
X  			}
X  	|	OPTION_n {
X  			config.magic_demand_paged = false;
SHAR_EOF
chmod 0664 ld-binutils-2.0/ldgram.y.diffs ||
echo 'restore of ld-binutils-2.0/ldgram.y.diffs failed'
Wc_c="`wc -c < 'ld-binutils-2.0/ldgram.y.diffs'`"
test 1161 -eq "$Wc_c" ||
	echo 'ld-binutils-2.0/ldgram.y.diffs: original size 1161, current size' "$Wc_c"
fi
# ============= ld-binutils-2.0/ldlex.l.diffs ==============
if test -f 'ld-binutils-2.0/ldlex.l.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping ld-binutils-2.0/ldlex.l.diffs (File already exists)'
else
echo 'x - extracting ld-binutils-2.0/ldlex.l.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ld-binutils-2.0/ldlex.l.diffs' &&
*** /tmp/T0a05051	Fri Feb 19 18:56:01 1993
--- ldlex.l	Fri Feb 19 17:10:50 1993
***************
*** 117,122 ****
--- 117,123 ----
X  <COMMAND>"-V"			{ return OPTION_V; }
X  <COMMAND>"-M"			{ return OPTION_M; }
X  <COMMAND>"-Map"	             	{ return OPTION_Map;}
+ <COMMAND>"-MDupdate"		{ return OPTION_MDupdate; }
X  <COMMAND>"-t"			{ return OPTION_t; }
X  <COMMAND>"-X"			{ return OPTION_X; }
X  <COMMAND>"-x"			{ return OPTION_x; }
SHAR_EOF
chmod 0664 ld-binutils-2.0/ldlex.l.diffs ||
echo 'restore of ld-binutils-2.0/ldlex.l.diffs failed'
Wc_c="`wc -c < 'ld-binutils-2.0/ldlex.l.diffs'`"
test 431 -eq "$Wc_c" ||
	echo 'ld-binutils-2.0/ldlex.l.diffs: original size 431, current size' "$Wc_c"
fi
# ============= ld-binutils-2.0/ldmain.c.diffs ==============
if test -f 'ld-binutils-2.0/ldmain.c.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping ld-binutils-2.0/ldmain.c.diffs (File already exists)'
else
echo 'x - extracting ld-binutils-2.0/ldmain.c.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ld-binutils-2.0/ldmain.c.diffs' &&
*** /tmp/T0a05054	Fri Feb 19 18:56:02 1993
--- ldmain.c	Fri Feb 19 17:12:37 1993
***************
*** 275,281 ****
X  	}
X      }
X  
! 
X  
X    exit (0);
X  }				/* main() */
--- 275,282 ----
X  	}
X      }
X  
!   if (config.deps_updater)
!     MDclose (config.deps_updater, output_filename);
X  
X    exit (0);
X  }				/* main() */
SHAR_EOF
chmod 0664 ld-binutils-2.0/ldmain.c.diffs ||
echo 'restore of ld-binutils-2.0/ldmain.c.diffs failed'
Wc_c="`wc -c < 'ld-binutils-2.0/ldmain.c.diffs'`"
test 323 -eq "$Wc_c" ||
	echo 'ld-binutils-2.0/ldmain.c.diffs: original size 323, current size' "$Wc_c"
fi
# ============= ld-binutils-2.0/ld.h.diffs ==============
if test -f 'ld-binutils-2.0/ld.h.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping ld-binutils-2.0/ld.h.diffs (File already exists)'
else
echo 'x - extracting ld-binutils-2.0/ld.h.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ld-binutils-2.0/ld.h.diffs' &&
*** /tmp/T0a05057	Fri Feb 19 18:56:02 1993
--- ld.h	Fri Feb 19 17:10:07 1993
***************
*** 18,23 ****
--- 18,24 ----
X     along with GLD; see the file COPYING.  If not, write to
X     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
X  
+ #include "make-depend.h"
X  
X  #define flag_is_not_at_end(x) ((x) & BSF_NOT_AT_END)
X  #define flag_is_ordinary_local(x) (((x) & (BSF_LOCAL))&!((x) & (BSF_DEBUGGING)))
***************
*** 95,100 ****
--- 96,102 ----
X  
X     char *map_filename;
X     FILE *map_file;
+    MDupdater deps_updater;
X  
X  } ld_config_type;
X  #define set_asymbol_chain(x,y) ((x)->udata = (PTR)y)
SHAR_EOF
chmod 0664 ld-binutils-2.0/ld.h.diffs ||
echo 'restore of ld-binutils-2.0/ld.h.diffs failed'
Wc_c="`wc -c < 'ld-binutils-2.0/ld.h.diffs'`"
test 638 -eq "$Wc_c" ||
	echo 'ld-binutils-2.0/ld.h.diffs: original size 638, current size' "$Wc_c"
fi
# ============= ld-binutils-2.0/ldfile.c.diffs ==============
if test -f 'ld-binutils-2.0/ldfile.c.diffs' -a X"$1" != X"-c"; then
	echo 'x - skipping ld-binutils-2.0/ldfile.c.diffs (File already exists)'
else
echo 'x - extracting ld-binutils-2.0/ldfile.c.diffs (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ld-binutils-2.0/ldfile.c.diffs' &&
*** /tmp/T0a05060	Fri Feb 19 18:56:02 1993
--- ldfile.c	Fri Feb 19 18:43:48 1993
***************
*** 27,32 ****
--- 27,33 ----
X  #include "bfd.h"
X  #include "sysdep.h"
X  
+ #include "ld.h"
X  #include "ldmisc.h"
X  #include "ldlang.h"
X  #include "ldfile.h"
***************
*** 41,46 ****
--- 42,48 ----
X  /* IMPORT */
X  
X  extern boolean option_v;
+ extern ld_config_type config;
X  
X  
X  #ifdef VMS
***************
*** 164,169 ****
--- 166,172 ----
X  	   arch != (search_arch_type *)NULL;
X  	   arch = arch->next) {
X  	if (open_a(arch->name,entry,"lib",".a") != (bfd *)NULL) {
+ 	  MDrecord (config.deps_updater, entry->filename);
X  	  return;
X  	}
X  #ifdef VMS
***************
*** 180,186 ****
X      entry->the_bfd = cached_bfd_openr (entry->filename, entry);
X  
X    }
!   if (!entry->the_bfd)	einfo("%F%P: Can't open %s\n", entry->filename);
X  
X  }
X  
--- 183,192 ----
X      entry->the_bfd = cached_bfd_openr (entry->filename, entry);
X  
X    }
!   if (!entry->the_bfd)
!     einfo("%F%P: Can't open %s\n", entry->filename);
!   else
!     MDrecord (config.deps_updater, entry->filename);
X  
X  }
X  
SHAR_EOF
chmod 0664 ld-binutils-2.0/ldfile.c.diffs ||
echo 'restore of ld-binutils-2.0/ldfile.c.diffs failed'
Wc_c="`wc -c < 'ld-binutils-2.0/ldfile.c.diffs'`"
test 1098 -eq "$Wc_c" ||
	echo 'ld-binutils-2.0/ldfile.c.diffs: original size 1098, current size' "$Wc_c"
fi
# ============= ld-binutils-2.0/Makefile ==============
if test -f 'ld-binutils-2.0/Makefile' -a X"$1" != X"-c"; then
	echo 'x - skipping ld-binutils-2.0/Makefile (File already exists)'
else
echo 'x - extracting ld-binutils-2.0/Makefile (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'ld-binutils-2.0/Makefile' &&
# This file was generated automatically by configure.  Do not edit.
VPATH = .
links = sysdep.h
host_alias = mips-sgi-irix4
host_cpu = mips
host_vendor = sgi
host_os = irix4
target_alias = mips-sgi-irix4
target_cpu = mips
target_vendor = sgi
target_os = irix4
ALL=all.internal
# Makefile for the GNU linker ld (version 2)
# Copyright (C) 1989-1992 Free Software Foundation, Inc.
X
# This file is part of GNU ld..
X
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X
X
srcdir = .
X
prefix = /usr/local
X
program_transform_name = 
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
tooldir = $(libdir)
datadir = $(prefix)/lib
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
docdir = $(datadir)/doc
X
gcclibdir = $(libdir)/gcc/$(target_alias)
X
SHELL = /bin/sh
X
INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
AR = ar
AR_FLAGS = qv
CFLAGS = -g
MAKEINFO = makeinfo
RANLIB = ranlib
HOST_CC=$(CC)
BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ;  else echo flex ; fi`
X
#version=/`./../gcc/gcc -dumpversion`
version=
X
# Seach path to override the default search path for -lfoo libraries.
# If LIB_PATH is empty, the ones in the script (if any) are left alone.
# (The default is usually /lib:usr/lib:/usr/local/lib, unless building
# a cross-linker, in which case the default is empty.  See genscripts.sh.)
# Otherwise, they are replaced with the ones given in LIB_PATH,
# which may have the form: LIB_PATH=/lib:/usr/local/lib
LIB_PATH =
X
BASEDIR	= ../..
INCLUDE	= $(srcdir)/../include
INCLUDES = -I. -I$(srcdir)  -I$(INCLUDE) 
X
# Where to find texinfo.tex to format docn with TeX
TEXIDIR = $(srcdir)/../texinfo/fsf
X
# Whether to get roff to put indexing entries on stderr
TEXI2OPT =
# You neeed this to generate ld-index.ms (or .mm or .me)
# TEXI2OPT = -i
X
TEXI2ROFF=texi2roff
X
# Which roff program to use to generate index for texi2roff'd doc
ROFF = groff
X
#stuff for self hosting (can be overridden in config file).
HOSTING_CRT0=/lib/crt0.o
HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else echo $(libdir)/libgcc.a; fi`  -lc
HOSTING_EMU=LDEMULATION=$(EMUL); export LDEMULATION
X
C++ = g++ -fgnu-linker
X
### Host, target, and site specific Makefile fragments come in here.
###
X
LINTFLAGS =  $(INCLUDES) $(EXTRA_DEF) 
X
.SUFFIXES: .y .x .xr .xu .xn .xbn .sc .scu .scr .scn $(SUFFIXES) .cc
X
.c.o:
X	$(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $<
X
.cc.o:
X	$(C++) -c $(CFLAGS) -I$(srcdir) $<
X
# go directly to ld.new in case this ld isn't capable of
# linking native object on this host.  It can be renamed on
# install.
LD_PROG	= ld.new
X
# for self hosting
BFDLIB=./../bfd/libbfd.a
LIBIBERTY=./../libiberty/libiberty.a
X
ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
X	em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o \
X	em_h8300hms.o em_ebmon29k.o em_sun4.o em_gld960.o \
X	em_vanilla.o em_h8300xray.o em_st2000.o em_sa29200.o
X
EMULATION_OFILES=${ALL_EMULATIONS}
#EMULATION_OFILES=em_${EMUL}.o ${OTHER_EMULATIONS}
X
OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
X	ldwarn.o ldwrite.o ldexp.o  ldemul.o ldver.o ldmisc.o ldsym.o \
X	ldfile.o relax.o  lderror.o make-depend.o ${EMULATION_OFILES}
X
HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
X	ldsym.h ldctor.h ldlang.h ldexp.h \
X	ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
X
MANSOURCES=ld.tex
X
LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
X	em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c \
X	ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
X	relax.c lderror.c make-depend.c
X
GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h
GENERATED_HEADERS=ldgram.h ldemul-list.h
X
LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
X
BFDSOURCES=../../bfd/common/*.c
X
SOURCES= $(LDSOURCES) $(BFDSOURCES)
LINTSOURCES=   $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
X
STAGESTUFF = *.x *.x[runN] *.sc[runN] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) mkscript
X
all: Makefile $(LD_PROG)
X
check: bootstrap check-cdtest
info: ld.info
X
ldgram.h ldgram.c: ldgram.y
X	$(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
X	mv -f y.tab.c ldgram.c
X	mv -f y.tab.h ldgram.h
X
ldmain.o: ldmain.c
X	$(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) -DDEFAULT_EMULATION='"$(EMUL)"' -c $<
X
ldemul-list.h:  Makefile
X	(echo "/* This file is automatically generated.  DO NOT EDIT! */";\
X	for f in `echo " " ${EMULATION_OFILES} "" \
X	 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
X	    echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
X	done;\
X	echo "";\
X	echo "#define EMULATION_LIST \\";\
X	for f in `echo " " ${EMULATION_OFILES} "" \
X	 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
X	    echo "  &ld_$${f}_emulation, \\"; \
X	done;\
X	echo "  0") >ldemul-list.h
X
ldemul.o: ldemul-list.h
X
ldlex.c: ldlex.l
X	$(LEX) -I -Cem $(srcdir)/ldlex.l
X	mv lex.yy.c ldlex.c
X
# These all start with em_ so 'make clean' can find them.
X
GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${host_alias} ${target_alias}
GEN_DEPENDS=./mkscript $(srcdir)/genscripts.sh
X
em_sun4.c: $(srcdir)/sun4.sh \
X  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} sun4.sh
em_sun3.c: $(srcdir)/sun3.sh \
X  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} sun3.sh
em_go32.c: $(srcdir)/go32.sh \
X  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} go32.sh
em_news.c: $(srcdir)/news.sh \
X  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} news.sh
em_hp300bsd.c: $(srcdir)/hp300bsd.sh \
X  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} hp300bsd.sh
em_i386aout.c: $(srcdir)/i386aout.sh \
X  $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} i386aout.sh
em_ebmon29k.c: $(srcdir)/ebmon29k.sh \
X  $(srcdir)/generic.em $(srcdir)/ebmon29k.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} ebmon29k.sh
em_sa29200.c: $(srcdir)/sa29200.sh \
X  $(srcdir)/generic.em $(srcdir)/sa29200.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} sa29200.sh
em_a29k.c: $(srcdir)/a29k.sh \
X  $(srcdir)/generic.em $(srcdir)/a29k.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} a29k.sh
em_m88kbcs.c: $(srcdir)/m88kbcs.sh \
X  $(srcdir)/generic.em $(srcdir)/h8300hms.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} m88kbcs.sh
em_h8300hms.c: $(srcdir)/h8300hms.sh \
X  $(srcdir)/h8300hms.em $(srcdir)/h8300hms.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} h8300hms.sh
em_h8300xray.c: $(srcdir)/h8300xray.sh \
X  $(srcdir)/h8300xray.em $(srcdir)/h8300xray.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} h8300xray.sh
em_st2000.c: $(srcdir)/st2000.sh \
X  $(srcdir)/st2000.em $(srcdir)/st2000.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} st2000.sh
em_vanilla.c: $(srcdir)/vanilla.sh \
X  $(srcdir)/vanilla.em $(srcdir)/vanilla.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} vanilla.sh
em_lnk960.c: $(srcdir)/lnk960.sh \
X  $(srcdir)/lnk960.em $(srcdir)/i960.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} lnk960.sh
em_gld960.c: $(srcdir)/gld960.sh \
X  $(srcdir)/gld960.em $(srcdir)/i960.sc-sh ${GEN_DEPENDS}
X	${GENSCRIPTS} gld960.sh
X
$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
X	$(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
X
# Rules for testing by relinking ld itself.
X
ld-partial.o: ld.new
X	$(HOSTING_EMU); ./ld.new -o ld-partial.o -r $(OFILES)
ld1: ld-partial.o
X	$(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
X
ld1-full: ld.new
X	$(HOSTING_EMU); ./ld.new -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
X
ld2: ld1
X	$(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
X
ld3: ld2
X	$(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
X
bootstrap: ld3
X	cmp ld2 ld3
X
cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o
X	$(HOSTING_EMU); ./ld.new -o cdtest $(HOSTING_CRT0) \
X	  cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS)
X
check-cdtest: cdtest $(srcdir)/cdtest.exp
X	./cdtest >cdtest.out
X	diff $(srcdir)/cdtest.exp cdtest.out
X
######################################################################
# DOCUMENTATION TARGETS
# TeX output
ld.dvi: $(srcdir)/ld.texinfo
X	TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo
X	texindex ld.??
X	TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo
ldint.dvi: $(srcdir)/ldint.texinfo
X	TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ldint.texinfo
X	texindex ldint.??
X	TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ldint.texinfo
X
# info file for online browsing
ld.info: $(srcdir)/ld.texinfo
X	$(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo
X
ldint.info: $(srcdir)/ldint.texinfo
X	$(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
X
#separate targets for "ms", "me", and "mm" forms of roff doc
# Try to use a recent texi2roff.  v2 was put on prep in jan91.
# If you want an index, see texi2roff doc for postprocessing 
# and add -i to texi2roff invocations below.
# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
#    correspondint -e lines when later texi2roff's are current)
# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
# + @c's deleted explicitly because texi2roff sees texinfo commands in them
# + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
# + @alphaenumerate is ridiculously new, turned into @enumerate
X
ld.ms: $(srcdir)/ld.texinfo
X	sed -e '/\\input texinfo/d' \
X		-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
X		-e '/^@ifinfo/,/^@end ifinfo/d' \
X		-e '/^@c/d' \
X		-e 's/{.*,,/{/' \
X		-e 's/@ / /g' \
X		-e 's/^@alphaenumerate/@enumerate/g' \
X		-e 's/^@end alphaenumerate/@end enumerate/g' \
X		$(srcdir)/ld.texinfo | \
X	$(TEXI2ROFF) $(TEXI2OPT) -ms | \
X	sed -e 's/---/\\(em/g' \
X		>>ld.ms 
X
# index for roff output
ld-index.ms: ld.ms
X	$(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
X		sed -e '/: warning:/d' | \
X		texi2index >ld-index.ms
X
# roff output (-mm)
ld.mm: $(srcdir)/ld.texinfo
X	sed -e '/\\input texinfo/d' \
X		-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
X		-e '/^@ifinfo/,/^@end ifinfo/d' \
X		-e '/^@c/d' \
X		-e 's/{.*,,/{/' \
X		-e '/@noindent/d' \
X		-e 's/@ / /g' \
X		-e 's/^@alphaenumerate/@enumerate/g' \
X		-e 's/^@end alphaenumerate/@end enumerate/g' \
X		$(srcdir)/ld.texinfo | \
X	$(TEXI2ROFF) $(TEXI2OPT) -mm | \
X	sed -e 's/---/\\(em/g' \
X	>ld.mm 
X
# index for roff output
ld-index.mm: ld.mm
X	$(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
X		sed -e '/: warning:/d' | \
X		texi2index >ld-index.mm
X
# roff output (-me)
ld.me: $(srcdir)/ld.texinfo
X	sed -e '/\\input texinfo/d' \
X		-e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
X		-e '/^@ifinfo/,/^@end ifinfo/d' \
X		-e '/^@c/d' \
X		-e 's/{.*,,/{/' \
X		-e 's/@ / /g' \
X		-e 's/^@alphaenumerate/@enumerate/g' \
X		-e 's/^@end alphaenumerate/@end enumerate/g' \
X		$(srcdir)/ld.texinfo | \
X	$(TEXI2ROFF) $(TEXI2OPT) -me | \
X	sed -e 's/---/\\(em/g' \
X		>>ld.me 
X
# index for roff output
ld-index.me: ld.me
X	$(ROFF) -me ld.me 2>&1 1>/dev/null | \
X		sed -e '/: warning:/d' | \
X		texi2index >ld-index.me
X
X
######################################################################
X
./mkscript: $(srcdir)/mkscript.c
X	$(HOST_CC)  -o mkscript $(srcdir)/mkscript.c
X
ldlex.c: ldlex.l ldgram.h
ldlex.o: ldlex.c ldgram.h
ldgram.o: ldgram.c
ldgram.c:ldgram.y
X
h8300hms.o:h8300hms.c
h8300xray.o:h8300xray.c
st2000.o:st2000.c
X
stage1:	force
X	-mkdir stage1
X	-mv -f $(STAGESTUFF) $(LD_PROG) stage1
X	-(cd stage1 ; ln -s $(LD_PROG) ld)
X
stage2:	force
X	-mkdir stage2
X	-mv -f $(STAGESTUFF) $(LD_PROG) stage2
X	-(cd stage2 ; ln -s $(LD_PROG) ld)
X
stage3:	force
X	-mkdir stage3
X	-mv -f $(STAGESTUFF) $(LD_PROG) stage3
X	-(cd stage3 ; ln -s $(LD_PROG) ld)
X
against=stage2
X
comparison: force
X	for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
X
de-stage1: force
X	-(cd stage1 ; mv -f * ..)
X	-rm ld
X	-rmdir stage1
X
de-stage2: force
X	-(cd stage2 ; mv -f * ..)
X	-rm ld
X	-rmdir stage2
X
de-stage3: force
X	-(cd stage3 ; mv -f * ..)
X	-rm ld
X	-rmdir stage3
X
# Stuff that should be included in a distribution:
LDDISTSTUFF=ldgram.c ldgram.h ldlex.c ld.mm
diststuff: $(LDDISTSTUFF)
X
mostlyclean:
X	-rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
X	-rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out
clean: mostlyclean
X	-rm -f $(LD_PROG)
distclean: clean
X	-rm -f Makefile config.status TAGS
realclean: distclean
X	-rm -f $(LDDISTSTUFF)
X
lintlog:$(SOURCES) Makefile
X	$(LINT) -abhxzn  $(LINTFLAGS)  $(LINTSOURCES) \
| grep -v "pointer casts may be troublesome" \
| grep -v "possible pointer alignment problem" \
| grep -v "ignore" \
| grep -v "conversion from long may lose accuracy" \
| grep -v "warning: constant argument to NOT" \
| grep -v "enumeration type clash, operator CAST" \
| grep -v "warning: constant in conditional context"\
| grep -v "archive\.c"
X
X
tags TAGS:$(SOURCES) $(HEADERS)
X	etags -t $?
X
X
objdump:objdump.c 
X
.PHONY: install
install: $(LD_PROG)
X	-parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
X	if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
X	-if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
X	-parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
X	if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
X	-if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
X	-n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
X	rm -f $(bindir)/$$n; \
X	$(INSTALL_PROGRAM) ld.new $(bindir)/$$n; \
X	$(INSTALL_DATA) $(srcdir)/ld.1 $(man1dir)/$$n.1
X	-if [ -d $(tooldir) ]; then rm -f $(tooldir)/ld; $(INSTALL_PROGRAM) ld.new $(tooldir)/ld; else true; fi
X
install-info: info
X	-parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \
X	if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
X	-if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi
X	for i in ld.info* ; do \
X		$(INSTALL_DATA) $$i $(infodir)/$$i ; \
X	done
X
clean-info:
X	-rm -rf *.info*
X
#-----------------------------------------------------------------------------
#		'STANDARD' GNU/960 TARGETS BELOW THIS POINT
#
# 'VERSION' file must be present and contain a string of the form "x.y"
#-----------------------------------------------------------------------------
X
ver960.c: FORCE
X	rm -f ver960.c
X	echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
X
X
# This target should be invoked before building a new release.
# 'VERSION' file must be present and contain a string of the form "x.y"
#
roll:
X	@V=`cat VERSION`		; \
X	MAJ=`sed 's/\..*//' VERSION`	; \
X	MIN=`sed 's/.*\.//' VERSION`	; \
X	V=$$MAJ.`expr $$MIN + 1`	; \
X	rm -f VERSION			; \
X	echo $$V >VERSION		; \
X	echo Version $$V
X
X
dep: $(LDSOURCES)
X	mkdep $(CFLAGS) $?
X
# Dummy target to force execution of dependent targets.
#
force:
X
# Target to uncomment host-specific lines in this makefile.  Such lines must
# have the following string beginning in column 1: #__<hostname>__#
# Original Makefile is backed up as 'Makefile.old'.
#
# Invoke with:  make make HOST=xxx
#
make:
X	-@if test $(HOST)x = x ; then \
X		echo 'Specify "make make HOST=???"'; \
X		exit 1; \
X	fi ; \
X	grep -s "^#The next line was generated by 'make make'" Makefile; \
X	if test $$? = 0 ; then	\
X		echo "Makefile has already been processed with 'make make'";\
X		exit 1; \
X	fi ; \
X	mv -f Makefile Makefile.old; \
X	echo "#The next line was generated by 'make make'"	 >Makefile ; \
X	echo "HOST=$(HOST)"					>>Makefile ; \
X	echo							>>Makefile ; \
X	sed "s/^#__$(HOST)__#//" < Makefile.old			>>Makefile
X
#
X
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
X	$(SHELL) ./config.status
X
### mode:fundamental ***
### Local Variables: ***
### page-delimiter: "^#" ***
### End: ***
### end of file
X
X
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
SHAR_EOF
chmod 0644 ld-binutils-2.0/Makefile ||
echo 'restore of ld-binutils-2.0/Makefile failed'
Wc_c="`wc -c < 'ld-binutils-2.0/Makefile'`"
test 16691 -eq "$Wc_c" ||
	echo 'ld-binutils-2.0/Makefile: original size 16691, current size' "$Wc_c"
fi
exit 0
Technical Details
Message-ID: <gnusenet1993Mar6.041849.4354@microunity.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!world!enterpoop.mit.edu!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!microunity.com!brendan

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,99c9fd36941ecf3e,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-03-07 14:50:19 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!world!enterpoop.mit.edu!usc!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!microunity.com!brendan
From: brendan@microunity.com (Brendan Eich)
Newsgroups: gnu.gcc.help
Subject: Automatic incremental make-depend for GCC and GNU ld
Date: 7 Mar 1993 17:27:36 -0500
Organization: MicroUnity Systems Engineering Inc.
Lines: 2014
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <gnusenet1993Mar6.041849.4354@microunity.com>
Keywords: gcc, make, depend