[comp.sources.misc] v15i054: dmake version 3.6

dvadura@watdragon.waterloo.edu (Dennis Vadura) (10/15/90)

Posting-number: Volume 15, Issue 54
Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
Archive-name: dmake-3.6/part02

#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file unix/sysvr1/runargv.c continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file unix/sysvr1/runargv.c"
sed 's/^X//' << 'SHAR_EOF' >> unix/sysvr1/runargv.c
X
X   for( i=0; i<Max_proc; i++ )
X      if( _procs[i].pr_valid &&
X	  _procs[i].pr_how == how &&
X	  _procs[i].pr_target == cp  )
X	 break;
X	 
X   return( i != Max_proc );
X}
X
X
Xstatic void
X_attach_cmd( cmd, group, ignore, cp, how, last, shell )
Xchar    *cmd;
Xint	group;
Xint     ignore;
XCELLPTR cp;
XHOWPTR  how;
Xint     last;
Xint     shell;
X{
X   register int i;
X   RCPPTR rp;
X
X   for( i=0; i<Max_proc; i++ )
X      if( _procs[i].pr_valid &&
X	  _procs[i].pr_how == how &&
X	  _procs[i].pr_target == cp  )
X	 break;
X
X   TALLOC( rp, 1, RCP );
X   rp->prp_cmd   = _strdup(cmd);
X   rp->prp_group = group;
X   rp->prp_ignore= ignore;
X   rp->prp_last  = last;
X   rp->prp_shell = shell;
X   rp->prp_dir   = _strdup(Get_current_dir());
X
X   if( _procs[i].pr_recipe == NIL(RCP) )
X      _procs[i].pr_recipe = _procs[i].pr_recipe_end = rp;
X   else {
X      _procs[i].pr_recipe_end->prp_next = rp;
X      _procs[i].pr_recipe_end = rp;
X   }
X}
SHAR_EOF
echo "File unix/sysvr1/runargv.c is complete"
chmod 0440 unix/sysvr1/runargv.c || echo "restore of unix/sysvr1/runargv.c fails"
echo "x - extracting unix/sysvr1/putenv.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr1/putenv.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr1/RCS/putenv.c,v 1.1 90/10/06 12:06:30 dvadura Exp $
X-- SYNOPSIS -- my own putenv for BSD like systems.
X-- 
X-- DESCRIPTION
X-- 	This originally came from MKS, but I rewrote it to fix a bug with
X--	replacing existing strings, probably never happened but the code
X--	was wrong nonetheless.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	putenv.c,v $
X * Revision 1.1  90/10/06  12:06:30  dvadura
X * dmake Release, Version 3.6
X * 
X*/
X
X#include <stdio.h>
X#include <string.h>
X
Xint
Xputenv( str )/*
X===============
X   Take a string of the form NAME=value and stick it into the environment.
X   We do this by allocating a new set of pointers if we have to add a new
X   string and by replacing an existing pointer if the value replaces the value
X   of an existing string. */
Xchar *str;
X{
X   extern char **environ;		/* The current environment. */
X   static char **ourenv = NULL;		/* A new environment	    */
X   register char **p;
X   register char *q;
X   int      size;
X
X   /* First search the current environment and see if we can replace a
X    * string. */
X   for( p=environ; *p; p++ ) {
X      register char *s = str;
X
X      for( q = *p; *q && *s && *s == *q; q++, s++ )
X	 if( *s == '=' ) {
X	    *p = str;
X	    return(0);			/* replaced it so go away */
X	 }
X   }
X
X   /* Ok, can't replace a string so need to grow the environment. */
X   size = p - environ + 2;	/* size of new environment */
X				/* size of old is size-1   */
X
X   /* It's the first time, so allocate a new environment since we don't know
X    * where the old one is comming from. */
X   if( ourenv == NULL ) {
X      if( (ourenv = (char **) malloc( sizeof(char *)*size )) == NULL )
X	 return(1);
X
X      memcpy( (char *)ourenv, (char *)environ, (size-2)*sizeof(char *) );
X   }
X   else if( (ourenv = (char **)realloc( ourenv, size*sizeof(char *))) == NULL )
X      return(1);
X
X   ourenv[--size] = NULL;
X   ourenv[--size] = str;
X
X   environ = ourenv;
X   return(0);
X}
SHAR_EOF
chmod 0440 unix/sysvr1/putenv.c || echo "restore of unix/sysvr1/putenv.c fails"
echo "x - extracting unix/sysvr1/make.sh (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr1/make.sh &&
Xmkdir objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O infer.c
Xmv infer.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O make.c
Xmv make.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O stat.c
Xmv stat.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O expand.c
Xmv expand.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O string.c
Xmv string.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O hash.c
Xmv hash.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O dag.c
Xmv dag.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O dmake.c
Xmv dmake.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O path.c
Xmv path.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O imacs.c
Xmv imacs.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O sysintf.c
Xmv sysintf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O parse.c
Xmv parse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O getinp.c
Xmv getinp.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O quit.c
Xmv quit.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O basename.c
Xmv basename.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O dump.c
Xmv dump.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O macparse.c
Xmv macparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O rulparse.c
Xmv rulparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O percent.c
Xmv percent.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O function.c
Xmv function.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/arlib.c
Xmv arlib.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/dirbrk.c
Xmv dirbrk.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/explode.c
Xmv explode.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/rmprq.c
Xmv rmprq.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/ruletab.c
Xmv ruletab.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/sysvr1/runargv.c
Xmv runargv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/sysvr1 -O unix/sysvr1/vfprintf.c
Xmv vfprintf.o objects
Xcc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/runargv.o objects/vfprintf.o 
SHAR_EOF
chmod 0640 unix/sysvr1/make.sh || echo "restore of unix/sysvr1/make.sh fails"
echo "x - extracting unix/sysvr1/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr1/config.mk &&
X# This is the SysV R3 UNIX configuration file for DMAKE
X#	It simply modifies the values of SRC, and checks to see if
X#	OSENVIRONMENT is defined.  If so it includes the appropriate
X#	config.mk file.
X#
X# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
X# directory.
X#
Xosrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
X
X# The following are required sources
XOSDSRC := runargv.c vfprintf.c
XSRC    += $(OSDSRC)
X.SETDIR=$(osrdir) : $(OSDSRC)
X
X.SOURCE.h : $(osrdir)
X
X# Local configuration modifications for CFLAGS, there's local SysV includes
X# too.
XCFLAGS += -I$(osrdir)
X
X# See if we modify anything in the lower levels.
X.IF $(OSENVIRONMENT) != $(NULL)
X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
X.END
SHAR_EOF
chmod 0640 unix/sysvr1/config.mk || echo "restore of unix/sysvr1/config.mk fails"
echo "x - extracting unix/sysvr1/config.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysvr1/config.h &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr1/RCS/config.h,v 1.1 90/10/06 12:06:28 dvadura Exp $
X-- SYNOPSIS -- Configurarion include file.
X-- 
X-- DESCRIPTION
X-- 	There is one of these for each specific machine configuration.
X--	It can be used to further tweek the machine specific sources
X--	so that they compile.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	config.h,v $
X * Revision 1.1  90/10/06  12:06:28  dvadura
X * dmake Release, Version 3.6
X * 
X*/
X
X/* define this for configurations that don't have the coreleft function
X * so that the code compiles.  To my knowledge coreleft exists only on
X * Turbo C, but it is needed here since the function is used in many debug
X * macros. */
X#define coreleft() 0L
X
X/* Define the getcwd function that is used in the code, since BSD does
X * not have getcwd, but call it getwd instead. */
Xextern char *getcwd ANSI((char *, int));
X
X/* Define setvbuf, SysV doesn't have one */
X#define setvbuf(fp, bp, type, len) setbuf( fp, NULL );
X
X/* need to define size_t */
Xtypedef long size_t;
SHAR_EOF
chmod 0440 unix/sysvr1/config.h || echo "restore of unix/sysvr1/config.h fails"
echo "x - extracting unix/sysintf.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/sysintf.h &&
X/*
X** assorted bits of system interface, for common routines inside dmake.
X** System specific code can be found in the config.h files for each
X** of the system specifications.
X*/
X#include <sys/stat.h>
X#include <signal.h>
X
X#define STAT stat
X#define VOID_LCACHE(l,m) (void) void_lcache(l,m)
X
X/*
X** standard C items
X*/
X#include "stdmacs.h"
X
X/*
X** DOS interface standard items
X*/
X#define	getswitchar()	'-'
X
X/*
X** make parameters
X*/
X#define	MAX_PATH_LEN	1024
SHAR_EOF
chmod 0440 unix/sysintf.h || echo "restore of unix/sysintf.h fails"
echo "x - extracting unix/startup.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/startup.h &&
X/* This file contains the default value of the MAKESTARTUP variable.
X * You must set the quoted string below to the default path to the startup
X * variable, so that it gets compiled in.  LEAVE ROOTDIR at the front of
X * the path.  This allows the user to customize his environment for dmake
X * by setting up a new ROOTDIR environment variable. */
X
X"MAKESTARTUP := $(ROOTDIR)/usr/software/dmake/data/startup.mk",
SHAR_EOF
chmod 0440 unix/startup.h || echo "restore of unix/startup.h fails"
echo "x - extracting unix/ruletab.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/ruletab.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/ruletab.c,v 1.1 90/10/06 12:07:08 dvadura Exp $
X-- SYNOPSIS -- Default initial configuration of dmake.
X-- 
X-- DESCRIPTION
X-- 	Define here the initial set of rules that are defined before
X--	dmake performs any processing.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	ruletab.c,v $
X * Revision 1.1  90/10/06  12:07:08  dvadura
X * dmake Release, Version 3.6
X * 
X*/
X
X/* These are control macros for dmake that MUST be defined at some point
X * if they are NOT dmake will not work!  These are default definitions.  They
X * may be overridden inside the .STARTUP makefile, they are here
X * strictly so that dmake can parse the STARTUP makefile */
X
Xstatic char *_rules[] = {
X	"MAXPROCESSLIMIT := 10",
X	"MAXLINELENGTH := 8190",
X	".IMPORT .IGNORE: ROOTDIR",
X	".MAKEFILES : makefile.mk Makefile makefile",
X	".SOURCE    : .NULL",
X#include "startup.h"
X	0 };
X
Xchar **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
SHAR_EOF
chmod 0440 unix/ruletab.c || echo "restore of unix/ruletab.c fails"
echo "x - extracting unix/rmprq.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/rmprq.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/rmprq.c,v 1.1 90/10/06 12:07:06 dvadura Exp $
X-- SYNOPSIS -- remove prerequisites code.
X-- 
X-- DESCRIPTION
X--	This code is different for DOS and for UNIX and parallel make
X--	architectures since the parallel case requires the rm's to be
X--	run in parallel, whereas DOS guarantees to run them sequentially.
X-- 
X-- AUTHOR
X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	rmprq.c,v $
X * Revision 1.1  90/10/06  12:07:06  dvadura
X * dmake Release, Version 3.6
X * 
X*/
X
X#include "extern.h"
X#include "alloc.h"
X
Xvoid
XRemove_prq( tcp )
XCELLPTR tcp;
X{
X   static  LINKPTR rlp = NIL(LINK);
X   static  flag = 0;
X   static  HASHPTR m_at, m_q, m_b, m_g, m_l, m_bb, m_up;
X   char    *m_at_s, *m_g_s, *m_q_s, *m_b_s, *m_l_s, *m_bb_s, *m_up_s;
X   LINKPTR tlp;
X
X   tcp->ce_flag         &= ~(F_MADE|F_VISITED);
X   tcp->CE_HOW->hw_flag &= ~(F_MADE|F_VISITED);
X   tcp->ce_time          = 0L;
X
X   for( tlp=rlp; tlp !=NIL(LINK); tlp=tlp->cl_next )
X      if( (tlp->cl_prq->ce_flag & (F_VISITED|F_MADE)) != F_VISITED )
X	 break;
X
X   if( tlp == NIL(LINK) ) {
X      TALLOC(tlp, 1, LINK);
X      TALLOC(tlp->cl_prq, 1, CELL);
X      tlp->cl_next = rlp;
X      rlp = tlp;
X   }
X
X   *tlp->cl_prq = *tcp;
X
X   /* We save the dynamic macro values here, as it is possible that the
X    * .REMOVE recipe is getting executed for a target while some other target
X    * is in the middle of executing it's list of recipe lines, in this case
X    * the values of $@ etc, must be preserved so that when we return to
X    * complete the other recipe we must make certain that the values of it's
X    * dynamic macros are unmodified. */
X
X   if( !flag ) {
X      /* Do the getting of the macros only once. */
X      flag = 1;
X      m_at = Get_name("@", Macs, TRUE, NIL(CELL));
X      m_g  = Get_name(">", Macs, TRUE, NIL(CELL));
X      m_q  = Get_name("?", Macs, TRUE, NIL(CELL));
X      m_b  = Get_name("<", Macs, TRUE, NIL(CELL));
X      m_l  = Get_name("&", Macs, TRUE, NIL(CELL));
X      m_bb = Get_name("*", Macs, TRUE, NIL(CELL));
X      m_up = Get_name("^", Macs, TRUE, NIL(CELL));
X   }
X
X   m_at_s = m_at->ht_value; m_at->ht_value = NIL(char);
X   m_g_s  = m_g->ht_value;  m_g->ht_value  = NIL(char);
X   m_q_s  = m_q->ht_value;  m_q->ht_value  = NIL(char);
X   m_b_s  = m_b->ht_value;  m_b->ht_value  = NIL(char);
X   m_l_s  = m_l->ht_value;  m_l->ht_value  = NIL(char);
X   m_bb_s = m_bb->ht_value; m_bb->ht_value = NIL(char);
X   m_up_s = m_up->ht_value; m_up->ht_value = NIL(char);
X
X   Make( tlp->cl_prq, tlp->cl_prq->CE_HOW, NIL(CELL) );
X
X   m_at->ht_value = m_at_s;
X   m_g->ht_value  = m_g_s;
X   m_q->ht_value  = m_q_s;
X   m_b->ht_value  = m_b_s;
X   m_l->ht_value  = m_l_s;
X   m_bb->ht_value = m_bb_s;
X   m_up->ht_value = m_up_s;
X}
SHAR_EOF
chmod 0440 unix/rmprq.c || echo "restore of unix/rmprq.c fails"
echo "x - extracting unix/explode.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/explode.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/explode.c,v 1.1 90/10/06 12:07:03 dvadura Exp $
X-- SYNOPSIS -- Routines to explode dag if .SETDIR targets present.
X-- 
X-- DESCRIPTION
X--	These routines are called by parallel dmake implementations to
X--	explode the dmake DAG at .SETDIR targets so that parallel makes
X--	can traverse common portions of the DAG in parallel.
X-- 
X-- AUTHOR
X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	explode.c,v $
X * Revision 1.1  90/10/06  12:07:03  dvadura
X * dmake Release, Version 3.6
X * 
X*/
X
X#include "extern.h"
X#include "alloc.h"
X#include "db.h"
X
XCELLPTR
XExplode_cell( cp, dir )
XCELLPTR cp;
XCELLPTR dir;
X{
X   int explode = FALSE;
X   CELLPTR root;
X   CELLPTR tcp;
X   CELLPTR ocp;
X   HOWPTR  fhow = NIL(HOW);
X
X
X   if( cp == NIL(CELL) ) return(cp);
X
X   ocp = cp;
X   if( (root = cp->ce_name->CP_ROOT) != dir ) {
X      if( cp->ce_name->CP_ROOT != NIL(CELL) ) {
X	 HASHPTR name;
X
X	 tcp  = Def_cell(cp->CE_NAME, dir);
X	 name = tcp->ce_name;
X	 *tcp = *cp;
X	 tcp->ce_name = name;
X
X	 cp = tcp;
X	 explode = TRUE;
X      }
X   }
X   else if( root && root == dir )
X      return( cp );
X
X   /* The code here is required, as it takes care of the .UPDATEALL common
X    * targets. */
X   tcp = cp;
X   do {
X      tcp->ce_name->CP_ROOT = dir;
X
X      if( tcp->CE_HOW != fhow ) {
X	 tcp->CE_HOW = Explode_how( tcp->CE_HOW, cp->ce_dir?cp:dir, explode );
X	 if( tcp == cp ) fhow = tcp->CE_HOW;
X      }
X
X      if( explode && tcp->ce_all )
X         if( tcp->ce_all != ocp ) {
X	    CELLPTR ttcp = Def_cell( tcp->ce_all->CE_NAME, dir );
X	    HASHPTR name = ttcp->ce_name;
X
X	    *ttcp = *tcp->ce_all;
X	    ttcp->ce_name = name;
X	    tcp->ce_all   = ttcp;
X	    ttcp->CE_HOW  = fhow;
X	 }
X	 else
X	    tcp->ce_all = cp;
X
X      tcp = tcp->ce_all;
X   }
X   while( tcp != NIL(CELL) && tcp != cp );
X
X   return( cp );
X}
X
X
XHOWPTR
XExplode_how( how, dir, copy )
XHOWPTR  how;
XCELLPTR dir;
Xint     copy;
X{
X   if( how == NIL(HOW) ) return( how );
X
X   if( copy ) {
X      HOWPTR thow;
X
X      TALLOC( thow, 1, HOW );
X      *thow = *how;
X      how = thow;
X   }
X
X   how->hw_next = Explode_how( how->hw_next, dir, copy );
X   how->hw_prq  = Explode_prq( how->hw_prq, dir, copy );
X
X   return( how );
X}
X
X
XLINKPTR
XExplode_prq( prq, dir, copy )
XLINKPTR prq;
XCELLPTR dir;
Xint     copy;
X{
X   if( prq == NIL(LINK) ) return(prq);
X
X   if( copy ) {
X      LINKPTR tprq;
X
X      TALLOC( tprq, 1, LINK );
X      *tprq = *prq;
X      prq = tprq;
X   }
X
X   prq->cl_next = Explode_prq( prq->cl_next, dir, copy );
X   prq->cl_prq  = Explode_cell( prq->cl_prq, dir );
X
X   return( prq );
X}
SHAR_EOF
chmod 0440 unix/explode.c || echo "restore of unix/explode.c fails"
echo "x - extracting unix/dirbrk.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/dirbrk.c &&
X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/dirbrk.c,v 1.1 90/10/06 12:07:00 dvadura Exp $
X-- SYNOPSIS -- define the directory separator string.
X-- 
X-- DESCRIPTION
X-- 	Define this string for any character that may appear in a path name
X--	and can be used as a directory separator.  Also provide a function
X--	to indicate if a given path begins at the root of the file system.
X--
X-- AUTHOR
X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
X--
X-- COPYRIGHT
X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
X-- 
X--      This program is free software; you can redistribute it and/or
X--      modify it under the terms of the GNU General Public License
X--      (version 1), as published by the Free Software Foundation, and
X--      found in the file 'LICENSE' included with this distribution.
X-- 
X--      This program is distributed in the hope that it will be useful,
X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X--      GNU General Public License for more details.
X-- 
X--      You should have received a copy of the GNU General Public License
X--      along with this program;  if not, write to the Free Software
X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X--
X-- LOG
X--     $Log:	dirbrk.c,v $
X * Revision 1.1  90/10/06  12:07:00  dvadura
X * dmake Release, Version 3.6
X * 
X*/
X
X#include "extern.h"
X
X/* Unix only uses / */
Xchar*	DirBrkStr = "/";
X
X/*
X** Return TRUE if the name is the full specification of a path name to a file
X** starting at the root of the file system, otherwise return FALSE
X*/
Xint
XIf_root_path(name)
Xchar *name;
X{
X   return( strchr(DirBrkStr, *name) != NIL(char) );
X}
SHAR_EOF
chmod 0440 unix/dirbrk.c || echo "restore of unix/dirbrk.c fails"
echo "x - extracting unix/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/config.mk &&
X# This is an OS specific configuration file
X#	It assumes that OBJDIR, TARGET and DEBUG are previously defined.
X#	It defines	CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
X#			PRINTER, PRINTFLAGS
X#	It augments	SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
X#
XPRINTER		= hw
XPRINTFLAGS	= -P$(PRINTER)
XSTARTUPFILE	= $(OS)/startup.mk
XCPPFLAGS 	= $(CFLAGS)
XLDOBJS		= $(CSTARTUP) $(OBJDIR)/{$(<:f)}
XLDARGS		= $(LDFLAGS) -o $@ $(LDOBJS) $(LDLIBS)
X
X# Debug flags
XDB_CFLAGS	= -g -DDBUG
XDB_LDFLAGS	= -g
XDB_LDLIBS	=
X
X# NO Debug flags
XNDB_CFLAGS	= -O
XNDB_LDFLAGS	=
XNDB_LDLIBS	=
X
X# Local configuration modifications for CFLAGS.
XCFLAGS         += -I$(OS)
X
X# Sources that must be defined for each different version
XOSSRC := arlib.c dirbrk.c explode.c rmprq.c ruletab.c
XSRC  += $(OSSRC)
X.SETDIR=$(OS) : $(OSSRC)
X
X# Set source dirs so that we can find files named in this
X# config file.
X.SOURCE.h : $(OS)
X
X# See if we modify anything in the lower levels.
X.IF $(OSRELEASE) != $(NULL)
X   .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
X.END
X
X# Set the proper macros based on whether we are making the debugging version
X# or not.
X.IF $(DEBUG)
X   CFLAGS	+= $(DB_CFLAGS)
X   LDFLAGS	+= $(DB_LDFLAGS)
X   LDLIBS	+= $(DB_LDLIBS)
X
X   SILENT	:= $(.SILENT)
X   .SILENT	:= yes
X   TARGET	:= db$(TARGET)
X   OBJDIR	:= $(OBJDIR).dbg
X   .SILENT	:= $(SILENT)
X
X    SRC		+= dbug.c malloc.c
X    HDR		+= db.h 
X    .SETDIR=common : dbug.c malloc.c
X.ELSE
X   CFLAGS	+= $(NDB_CFLAGS)
X   LDFLAGS	+= $(NDB_LDFLAGS)
X   LDLIBS	+= $(NDB_LDLIBS)
X.END
SHAR_EOF
chmod 0640 unix/config.mk || echo "restore of unix/config.mk fails"
echo mkdir - unix/bsd43
mkdir unix/bsd43
echo mkdir - unix/bsd43/vf
mkdir unix/bsd43/vf
echo "x - extracting unix/bsd43/vf/vfprintf.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/vfprintf.c &&
X/*
X * Copyright (c) 1988 Regents of the University of California.
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms are permitted
X * provided that the above copyright notice and this paragraph are
X * duplicated in all such forms and that any documentation,
X * advertising materials, and other materials related to such
X * distribution and use acknowledge that the software was developed
X * by the University of California, Berkeley.  The name of the
X * University may not be used to endorse or promote products derived
X * from this software without specific prior written permission.
X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X */
X
X#if defined(LIBC_SCCS) && !defined(lint)
Xstatic char sccsid[] = "@(#)vfprintf.c	5.2 (Berkeley) 6/27/88";
X#endif /* LIBC_SCCS and not lint */
X
X#include <stdio.h>
X#include <varargs.h>
X
Xint
Xvfprintf(iop, fmt, ap)
X	FILE *iop;
X	char *fmt;
X	va_list ap;
X{
X	int len;
X	char localbuf[BUFSIZ];
X
X	if (iop->_flag & _IONBF) {
X		iop->_flag &= ~_IONBF;
X		iop->_ptr = iop->_base = localbuf;
X		len = _doprnt(fmt, ap, iop);
X		(void) fflush(iop);
X		iop->_flag |= _IONBF;
X		iop->_base = NULL;
X		iop->_bufsiz = 0;
X		iop->_cnt = 0;
X	} else
X		len = _doprnt(fmt, ap, iop);
X
X	return (ferror(iop) ? EOF : len);
X}
X
SHAR_EOF
chmod 0440 unix/bsd43/vf/vfprintf.c || echo "restore of unix/bsd43/vf/vfprintf.c fails"
echo "x - extracting unix/bsd43/vf/startup.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/startup.mk &&
X# Generic UNIX DMAKE startup file.  Customize to suit your needs.
X# Should work for both SYSV, and BSD 4.3
X# See the documentation for a description of internally defined macros.
X#
X# Disable warnings for macros redefined here that were given
X# on the command line.
X__.SILENT := $(.SILENT)
X.SILENT   := yes
X
X# Configuration parameters for DMAKE startup.mk file
X# Set these to NON-NULL if you wish to turn the parameter on.
X_HAVE_RCS	:= yes		# yes => RCS  is installed.
X_HAVE_SCCS	:= yes		# yes => SCCS is installed.
X
X# Applicable suffix definitions
XA := .a		# Libraries
XE :=		# Executables
XF := .f		# Fortran
XO := .o		# Objects
XP := .p		# Pascal
XS := .s		# Assembler sources
XV := ,v		# RCS suffix
X
X# Recipe execution configurations
XSHELL		:= /bin/sh
XSHELLFLAGS	:= -ce
XGROUPSHELL	:= $(SHELL)
XGROUPFLAGS	:= 
XSHELLMETAS	:= |();&<>?*][$$:\\#`'"
XGROUPSUFFIX	:=
XDIVFILE		 = $(TMPFILE)
X
X# Standard C-language command names and flags
X   CPP	   := /lib/cpp		# C-preprocessor
X   CC      := cc		# C-compiler and flags
X   CFLAGS  +=
X
X   AS      := as		# Assembler and flags
X   ASFLAGS += 
X
X   LD       = $(CC)		# Loader and flags
X   LDFLAGS +=
X   LDLIBS   =
X
X# Definition of $(MAKE) macro for recursive makes.
X   MAKE = $(MAKECMD) $(MFLAGS)
X
X# Definition of Print command for this system.
X   PRINT = lpr
X
X# Language and Parser generation Tools and their flags
X   YACC	  := yacc		# standard yacc
X   YFLAGS +=
X   YTAB	  := y.tab		# yacc output files name stem.
X
X   LEX	  := lex		# standard lex
X   LFLAGS +=
X   LEXYY  := lex.yy		# lex output file
X
X# Other Compilers, Tools and their flags
X   PC	:= pc			# pascal compiler
X   RC	:= f77			# ratfor compiler
X   FC	:= f77			# fortran compiler
X
X   CO	   := co		# check out for RCS
X   COFLAGS += -q
X
X   AR     := ar			# archiver
X   ARFLAGS+= ruv
X
X   RM	   := /bin/rm		# remove a file command
X   RMFLAGS +=
X
X# Implicit generation rules for making inferences.
X# We don't provide .yr or .ye rules here.  They're obsolete.
X# Rules for making *$O
X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
X   %$O : %$S ; $(AS) $(ASFLAGS) $<
X   %$O : %.cl ; class -c $<
X   %$O : %.e %.r %.F %$F
X	$(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
X# Executables
X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
X# lex and yacc rules
X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
X
X# This rule tells how to make *.out from it's immediate list of prerequisites
X# UNIX only.
X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
X# RCS support
X.IF $(_HAVE_RCS)
X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
X.END
X
X# SCCS support
X.IF $(_HAVE_SCCS)
X   % : s.% ; get $@
X   .NOINFER : s.%
X.END
X
X# Recipe to make archive files.
X%$A :
X[
X   $(AR) $(ARFLAGS) $@ $?
X   $(RM) $(RMFLAGS) $?
X   ranlib $@
X]
X
X# DMAKE uses this recipe to remove intermediate targets
X.REMOVE :; $(RM) -f $<
X
X# AUGMAKE extensions for SYSV compatibility
X@B = $(@:b)
X@D = $(@:d)
X@F = $(@:f)
X*B = $(*:b)
X*D = $(*:d)
X*F = $(*:f)
X<B = $(<:b)
X<D = $(<:d)
X<F = $(<:f)
X?B = $(?:b)
X?F = $(?:f)
X?D = $(?:d)
X
X# Turn warnings back to previous setting.
X.SILENT := $(__.SILENT)
X
X# Local startup file if any
X.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 unix/bsd43/vf/startup.mk || echo "restore of unix/bsd43/vf/startup.mk fails"
echo "x - extracting unix/bsd43/vf/memcpy.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/memcpy.c &&
Xchar *
Xmemcpy(t, f, n)
Xregister char *t, *f;
Xregister n;
X{
X   register char *p = t;
X
X   while( --n >= 0 ) *t++ = *f++;
X
X   return (p);
X}
SHAR_EOF
chmod 0440 unix/bsd43/vf/memcpy.c || echo "restore of unix/bsd43/vf/memcpy.c fails"
echo "x - extracting unix/bsd43/vf/make.sh (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/make.sh &&
Xmkdir objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O infer.c
Xmv infer.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O make.c
Xmv make.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O stat.c
Xmv stat.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O expand.c
Xmv expand.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O string.c
Xmv string.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O hash.c
Xmv hash.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dag.c
Xmv dag.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dmake.c
Xmv dmake.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O path.c
Xmv path.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O imacs.c
Xmv imacs.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O sysintf.c
Xmv sysintf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O parse.c
Xmv parse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O getinp.c
Xmv getinp.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O quit.c
Xmv quit.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O basename.c
Xmv basename.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O dump.c
Xmv dump.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O macparse.c
Xmv macparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O rulparse.c
Xmv rulparse.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O percent.c
Xmv percent.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O function.c
Xmv function.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/arlib.c
Xmv arlib.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/dirbrk.c
Xmv dirbrk.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/explode.c
Xmv explode.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/rmprq.c
Xmv rmprq.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/ruletab.c
Xmv ruletab.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/putenv.c
Xmv putenv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/tempnam.c
Xmv tempnam.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/utime.c
Xmv utime.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/setvbuf.c
Xmv setvbuf.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/runargv.c
Xmv runargv.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/memcpy.c
Xmv memcpy.o objects
Xcc -c -DHELP -I. -Icommon -Iunix -Iunix/bsd43 -Iunix/bsd43/vf -O unix/bsd43/vf/vfprintf.c
Xmv vfprintf.o objects
Xcc  -o dmake  objects/infer.o objects/make.o objects/stat.o objects/expand.o objects/string.o objects/hash.o objects/dag.o objects/dmake.o objects/path.o objects/imacs.o objects/sysintf.o objects/parse.o objects/getinp.o objects/quit.o objects/basename.o objects/dump.o objects/macparse.o objects/rulparse.o objects/percent.o objects/function.o objects/arlib.o objects/dirbrk.o objects/explode.o objects/rmprq.o objects/ruletab.o objects/putenv.o objects/tempnam.o objects/utime.o objects/setvbuf.o objects/run


argv.o objects/memcpy.o objects/vfprintf.o 
SHAR_EOF
chmod 0640 unix/bsd43/vf/make.sh || echo "restore of unix/bsd43/vf/make.sh fails"
echo "x - extracting unix/bsd43/vf/ctype.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/ctype.h &&
X/*	ctype.h	4.2	85/09/04	*/
X
X#define	_U	01
X#define	_L	02
X#define	_N	04
X#define	_S	010
X#define _P	020
X#define _C	040
X#define _X	0100
X#define	_B	0200
X
Xextern	char	_ctype_[];
X
X#define	isalpha(c)	((_ctype_+1)[c]&(_U|_L))
X#define	isupper(c)	((_ctype_+1)[c]&_U)
X#define	islower(c)	((_ctype_+1)[c]&_L)
X#define	isdigit(c)	((_ctype_+1)[c]&_N)
X#define	isxdigit(c)	((_ctype_+1)[c]&(_N|_X))
X#define	isspace(c)	((_ctype_+1)[c]&_S)
X#define ispunct(c)	((_ctype_+1)[c]&_P)
X#define isalnum(c)	((_ctype_+1)[c]&(_U|_L|_N))
X#define isprint(c)	((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
X#define isgraph(c)	((_ctype_+1)[c]&(_P|_U|_L|_N))
X#define iscntrl(c)	((_ctype_+1)[c]&_C)
X#define isascii(c)	((unsigned)(c)<=0177)
X#define toupper(c)	((c)-'a'+'A')
X#define tolower(c)	((c)-'A'+'a')
X#define toascii(c)	((c)&0177)
SHAR_EOF
chmod 0440 unix/bsd43/vf/ctype.h || echo "restore of unix/bsd43/vf/ctype.h fails"
echo "x - extracting unix/bsd43/vf/config.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/vf/config.mk &&
X# This config file adds vfprintf.c and memcpy.c for those systems that
X# do not have it.
X#
X
Xosredir := $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)$(OSENVIRONMENT)
X
X# The following sources are required for BSD4.3
XOSDESRC := memcpy.c vfprintf.c
XSRC    += $(OSDESRC)
X.SETDIR=$(osredir) : $(OSDESRC)
X
XCFLAGS += -I$(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)
SHAR_EOF
chmod 0640 unix/bsd43/vf/config.mk || echo "restore of unix/bsd43/vf/config.mk fails"
echo mkdir - unix/bsd43/uw
mkdir unix/bsd43/uw
echo "x - extracting unix/bsd43/uw/startup.mk (Text)"
sed 's/^X//' << 'SHAR_EOF' > unix/bsd43/uw/startup.mk &&
X# Generic UNIX DMAKE startup file.  Customize to suit your needs.
X# Should work for both SYSV, and BSD 4.3
X# See the documentation for a description of internally defined macros.
X#
X# Disable warnings for macros redefined here that were given
X# on the command line.
X__.SILENT := $(.SILENT)
X.SILENT   := yes
X
X# Configuration parameters for DMAKE startup.mk file
X# Set these to NON-NULL if you wish to turn the parameter on.
X_HAVE_RCS	:= yes		# yes => RCS  is installed.
X_HAVE_SCCS	:= yes		# yes => SCCS is installed.
X
X# Applicable suffix definitions
XA := .a		# Libraries
XE :=		# Executables
XF := .f		# Fortran
XO := .o		# Objects
XP := .p		# Pascal
XS := .s		# Assembler sources
XV := ,v		# RCS suffix
X
X# Recipe execution configurations
XSHELL		:= /bin/sh
XSHELLFLAGS	:= -ce
XGROUPSHELL	:= $(SHELL)
XGROUPFLAGS	:= 
XSHELLMETAS	:= |();&<>?*][$$:\\#`'"
XGROUPSUFFIX	:=
XDIVFILE		 = $(TMPFILE)
X
X# Standard C-language command names and flags
X   CPP	   := /lib/cpp		# C-preprocessor
X   CC      := cc		# C-compiler and flags
X   CFLAGS  +=
X
X   AS      := as		# Assembler and flags
X   ASFLAGS += 
X
X   LD       = $(CC)		# Loader and flags
X   LDFLAGS +=
X   LDLIBS   =
X
X# Definition of $(MAKE) macro for recursive makes.
X   MAKE = $(MAKECMD) $(MFLAGS)
X
X# Definition of Print command for this system.
X   PRINT = lpr
X
X# Language and Parser generation Tools and their flags
X   YACC	  := yacc		# standard yacc
X   YFLAGS +=
X   YTAB	  := y.tab		# yacc output files name stem.
X
X   LEX	  := lex		# standard lex
X   LFLAGS +=
X   LEXYY  := lex.yy		# lex output file
X
X# Other Compilers, Tools and their flags
X   PC	:= pc			# pascal compiler
X   RC	:= f77			# ratfor compiler
X   FC	:= f77			# fortran compiler
X
X   CO	   := co		# check out for RCS
X   COFLAGS += -q
X
X   AR     := ar			# archiver
X   ARFLAGS+= ruv
X
X   RM	   := /bin/rm		# remove a file command
X   RMFLAGS +=
X
X# Implicit generation rules for making inferences.
X# We don't provide .yr or .ye rules here.  They're obsolete.
X# Rules for making *$O
X   %$O : %.c ; $(CC) -o $@ $(CFLAGS) -c $<
X   %$O : %$P ; $(PC) -o $@ $(PFLAGS) -c $<
X   %$O : %$S ; $(AS) -o $@ $(ASFLAGS) $<
X   %$O : %.cl ; class -c $<
X   %$O : %.e %.r %.F %$F
X	$(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
X# Executables
X   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
X
X# lex and yacc rules
X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
X
X# This rule tells how to make *.out from it's immediate list of prerequisites
X# UNIX only.
X   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
X
X# RCS support
X.IF $(_HAVE_RCS)
X   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
X.END
X
X# SCCS support
X.IF $(_HAVE_SCCS)
SHAR_EOF
echo "End of part 2"
echo "File unix/bsd43/uw/startup.mk is continued in part 3"
echo "3" > s2_seq_.tmp
exit 0