#  FILE NAME is 'mk_split'
#
#  @(#)mk_split	1.1 84/06/13
#
#  This awk file is called by the script 'fortsplit'.
#
#  This awk file breaks up the composite make file into 1 or more routine
#  make files and a master make file.  The routine make files are named
#  X.make, where X is a number beginning at 1, and the master make file is
#  named makefile.
#
#  The file works by searching until it finds a comment line which indicates
#  the beginning of either a routine make file or the master make file.  This
#  line is either
#
#     # Makefile #X  (X is the number of the routine make file) or,
#     # Master make file
#
#  When one of these lines is found, editor commands to write the associated
#  lines to a file are generated.
#
BEGIN {
        name = 1;
      }
{
  if ( $0 ~ /Makefile #/ )
    {
      print ( "/Makefile/,/sccs get \$@/ w " name ".make" );
      print ( "/sccs get \$@/" );
      name++;
    }
  else if ( $0 ~ /Master makefile/ )
      print ( "/Master/,/sccs get \$@/ w makefile" );
}


