[comp.sources.misc] v19i046: dmake - dmake version 3.7, Part25/37

Dennis Vadura <dvadura@watdragon.waterloo.edu> (05/13/91)

Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
Posting-number: Volume 19, Issue 46
Archive-name: dmake/part25
Supersedes: dmake-3.6: Volume 15, Issue 52-77

---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is dmake.shar.25 (part 25 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file dmake/msdos/spawn.c continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 25; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test -f _shar_wnt_.tmp; then
sed 's/^X//' << 'SHAR_EOF' >> 'dmake/msdos/spawn.c' &&
X          mode = O_BINARY | O_WRONLY | O_CREAT | O_APPEND;
X      }
X      handle = open(file, mode, S_IREAD | S_IWRITE);
X      if (handle < 0) {
X          Fatal( "Could not open -F file");
X      }
X      (void) lseek(handle, 0L, SEEK_END);
X      do_hook_std_writes(handle);
X   }
X   else
X      do_unhook_std_writes();
}
X
X
/*
** _findexec finds executables on the path.
** Note that it is pretty simple to add support for other executable types
** (shell scripts, etc.
**
** This follows the command.com behavior very closely.
*/
static char *
_findexec( s, is_shell )/*
==========================
X   Cloned closely from code provided by Kent Williams.  Stripped his down to
X   a reduced search since dmake doesn't need to recompute the PATH vector
X   each time it does the search since it cannot alter the path vector once
X   it begins to make recipes.  Also modified it to use findfirst and findnext
X   as provided for dirlib package that I got off the net. */
char *s;
int  *is_shell;
{
X   unsigned found_flags;
X   char     **pathv = NIL(char *);
X   char     *ext    = NIL(char);
X   char     *buf    = NIL(char);
X   char     *p[2];
X   char     *dot_scr;
X   char	    *dot;
X
X   p[0] = ""; p[1] = NIL(char);
X   if( strchr("./\\", *s) || s[1] == ':' )
X      pathv = p;
X   else if( (pathv = _getpath()) == NIL(char *) )
X      return( NIL(char) );
X
X   /* Compute the extension we need if any. */
X   if( (dot = strrchr(s,'.')) != NIL(char) &&
X        dot > strrchr(s,'/') && dot > strrchr(s,'\\') )
X      ext = dot+1;
X
X   dot_scr   = _mks_args ? dot_ksh : dot_bat;
X   *is_shell = FALSE;
X
X   for( found_flags = 0; *pathv && !found_flags; pathv++ ) {
X      DTA dta;
X
X      if( !ext ) {
X	 char *name;
X	 buf = Build_path( *pathv, name=_strjoin(s, ".???", -1, FALSE) );
X	 FREE(name);
X      }
X      else
X	 buf = Build_path( *pathv, s );
X
X      if( findfirst((char *)strupr(buf), &dta) != NIL(DTA) ) {
X	 if( !ext ) {
X	    char *dot;
X
X	    /* search order is .com .exe (.ksh || .bat)
X	     * there has to be a '.' */
X	    do {
X	       dot = strrchr(dta.name,'.');
X	       if(0 == strcmp(dot,dot_com))
X		  found_flags |= COM;
X	       else if(0 == strcmp(dot,dot_exe))
X		  found_flags |= EXE;
X	       else if( 0 == strcmp(dot,dot_scr) )
X		  found_flags |= SCR;
X	    } while( found_flags != ALL && findnext(&dta) != NIL(DTA) );
X
X	    if(found_flags & COM)      ext = dot_com;
X	    else if(found_flags & EXE) ext = dot_exe;
X	    else if(found_flags & SCR) {
X	       ext = dot_scr;
X	       *is_shell = TRUE;
X	    }
X
X	    if( found_flags ) {
X	       char *name;
X	       buf = Build_path( *pathv, name=_strjoin(s,ext,-1,FALSE) );
X	       FREE(name);
X	       strupr(buf);
X	    }
X	 }
X	 else
X	    found_flags++;
X      }
X   }
X
X   return( found_flags ? buf : NIL(char) );
}
X
X
/*
** getpath turns the DOS path into a char *vector, It is gotten and
** transformed only once since dmake can't modify the value of PATH while
** it is making targets.
*/
static char **
_getpath()
{
X   static   char **dir = NIL(char *);
X   register char *p;
X
X   if( !dir ) {
X      register char *t;
X      int           i;
X      char          *semi = NIL(char);
X
X      if( (p = getenv("PATH")) == NIL(char) ) p = "";
X      for( i=1, t=p; *t; t++ ) if( *t == ';' ) i++;
X
X      TALLOC(dir, i+1, char *);
X      p   = _strdup(p);
X
X      for( i=0; p; p = semi ? (semi+1):NIL(char),i++ ){
X	 if( (semi = strchr(p,';')) != NIL(char) ) *semi = '\0';
X	 dir[i] = p;
X      }
X      dir[i]=NIL(char);
X   }
X
X   return( dir );
}
X
X
static char far *
_dos_alloc( size )/*
====================
X   This routine allocates size paragraphs from DOS.  It changes the memory
X   allocation strategy to allocate from the tail and then changes it back.
X   to using first fit. */
uint16 size;
{
X   union REGS r;
X
X   r.h.ah = 0x48;
X   r.x.bx = size;
X
X   intdos( &r, &r );
X   if( r.x.cflag ) No_ram();
X   
X   return( (char far *) MK_FP(r.x.ax, 0) );
}
SHAR_EOF
chmod 0640 dmake/msdos/spawn.c ||
echo 'restore of dmake/msdos/spawn.c failed'
Wc_c="`wc -c < 'dmake/msdos/spawn.c'`"
test 12750 -eq "$Wc_c" ||
	echo 'dmake/msdos/spawn.c: original size 12750, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/startup.h ==============
if test -f 'dmake/msdos/startup.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/startup.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/startup.h' &&
/* 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
"MAKESTARTUP := $(ROOTDIR)/etc/startup.mk",
SHAR_EOF
chmod 0640 dmake/msdos/startup.h ||
echo 'restore of dmake/msdos/startup.h failed'
Wc_c="`wc -c < 'dmake/msdos/startup.h'`"
test 392 -eq "$Wc_c" ||
	echo 'dmake/msdos/startup.h: original size 392, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/stdarg.h ==============
if test -f 'dmake/msdos/stdarg.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/stdarg.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/stdarg.h' &&
/*
X * stdarg.h
X *
X * defines ANSI style macros for accessing arguments of a function which takes
X * a variable number of arguments
X *
X */
X
#if !defined(__STDARG)
#define __STDARG
X
typedef char *va_list;
X
#define va_dcl int va_alist
#define va_start(ap,v)  ap = (va_list)&va_alist
#define va_arg(ap,t)    ((t*)(ap += sizeof(t)))[-1]
#define va_end(ap)      ap = NULL
#endif
SHAR_EOF
chmod 0640 dmake/msdos/stdarg.h ||
echo 'restore of dmake/msdos/stdarg.h failed'
Wc_c="`wc -c < 'dmake/msdos/stdarg.h'`"
test 373 -eq "$Wc_c" ||
	echo 'dmake/msdos/stdarg.h: original size 373, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/switchar.c ==============
if test -f 'dmake/msdos/switchar.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/switchar.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/switchar.c' &&
/*
** return switch char
*/
#if defined(OS2) || defined(_MSC_VER)
#include <stdlib.h>
#endif
#if !defined(OS2)
#include <dos.h>
#endif /* !OS2 */
#include <stdio.h>
#include "stdmacs.h"
X
getswitchar()/*
===============
X   Try the environment first.  If you don't find SWITCHAR there, then use
X   the DOS call.  The call is undocumented, and doesn't work for DOS versions
X   4.0 and up, so the check of the environment will fix that. */
{
#if defined(__MSDOS__) || defined(M_I86)
#if !defined(OS2)
X   union REGS rg;
#endif /* ! OS2 */
X   static char *_env_switchar = NIL(char);
X
X   if( _env_switchar != NIL(char) ||
X       (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
X      return(*_env_switchar);
X
#if !defined(OS2)
X   rg.h.ah = 0x37;      /* switch char request */
X   rg.h.al = 0;         /* get (not set) */
X
X   intdos(&rg, &rg);
X   return (rg.h.dl);
#endif /* ! OS2 */
#endif /* M_I86 */
X
X   return ('-');
}
SHAR_EOF
chmod 0640 dmake/msdos/switchar.c ||
echo 'restore of dmake/msdos/switchar.c failed'
Wc_c="`wc -c < 'dmake/msdos/switchar.c'`"
test 926 -eq "$Wc_c" ||
	echo 'dmake/msdos/switchar.c: original size 926, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/sysintf.h ==============
if test -f 'dmake/msdos/sysintf.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/sysintf.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/sysintf.h' &&
/*
** assorted bits of system interface
*/
X
#define STAT stat
#define VOID_LCACHE(l,m)
#define GETPID _psp
X
extern char * tempnam();
extern char * getcwd();
X
/*
** standard C items
*/
X
/*
** DOS interface standard items
*/
#define	chdir(p) _chdir(p)
X
/*
** make parameters
*/
#define	MAX_PATH_LEN	64
X
SHAR_EOF
chmod 0640 dmake/msdos/sysintf.h ||
echo 'restore of dmake/msdos/sysintf.h failed'
Wc_c="`wc -c < 'dmake/msdos/sysintf.h'`"
test 301 -eq "$Wc_c" ||
	echo 'dmake/msdos/sysintf.h: original size 301, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/config.h ==============
if test ! -d 'dmake/msdos/tccdos'; then
    mkdir 'dmake/msdos/tccdos'
fi
if test -f 'dmake/msdos/tccdos/config.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/config.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/config.h' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/tccdos/config.h,v 1.1 91/05/06 15:26:02 dvadura Exp $
-- SYNOPSIS -- Configurarion include file.
-- 
-- DESCRIPTION
-- 	There is one of these for each specific machine configuration.
--	It can be used to further tweek the machine specific sources
--	so that they compile.
--
-- AUTHOR
--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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.
--
-- LOG
--     $Log:	config.h,v $
X * Revision 1.1  91/05/06  15:26:02  dvadura
X * dmake Release Version 3.7
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. */
/*#define coreleft() 0L*/
extern unsigned int coreleft();
X
#define SIGQUIT	SIGTERM		/* turbo C doesn't understand SIGQUIT */
X
/* Turbo-C understands const declarations. */
#define CONST const
X
#ifndef MSDOS
#   define MSDOS 1
#endif
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/config.h ||
echo 'restore of dmake/msdos/tccdos/config.h failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/config.h'`"
test 1897 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/config.h: original size 1897, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/config.mk ==============
if test -f 'dmake/msdos/tccdos/config.mk' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/config.mk (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/config.mk' &&
# This is the Turbo C 2.0 DOS configuration file for DMAKE
#	It simply modifies the values of SRC, and checks to see if
#	OSENVIRONMENT is defined.  If so it includes the appropriate
#	config.mk file.
#
# It also sets the values of .SOURCE.c and .SOURCE.h to include the local
# directory.
#
osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
X
# Definition of macros for library, and C startup code.
LDLIBS	        = d:/cc/tcc/lib/c$(MODEL)
CSTARTUP	= d:/cc/tcc/lib/c0$(MODEL).obj
X
# The following sources are required for TURBO C 2.0
OSR_SRC = tempnam.c utime.c
.SETDIR=$(osrdir) : $(OSR_SRC)
X
SRC += $(OSR_SRC)
.SOURCE.h : $(osrdir)
X
# Local configuration modifications for CFLAGS.  Make sure your turboc.cfg
# file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line
# below!
#CFLAGS += -DM_I86=1 -D__STDC__=1
X
# You can get a smaller executable still, buy adding a -1 to the list of
# flags below, but then you can't run this on an 8086/88 cpu.
#CFLAGS += -1
CFLAGS  += -I$(osrdir) -f- -d -O -N- -w-nod $(C_$(MODEL))
ASFLAGS += -t -mx $(S_$(MODEL))
X
# Debugging information for Turbo-C
DB_CFLAGS  += -v
DB_LDFLAGS += /v
X
# See if we modify anything in the lower levels.
.IF $(OSENVIRONMENT) != $(NULL)
X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
.END
X
C_s =
C_m = -mm
C_c = -mc
C_l = -ml
X
S_s = -dmsmall
S_m = -dmmedium
S_c = -dmcompact
S_l = -dmlarge
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/config.mk ||
echo 'restore of dmake/msdos/tccdos/config.mk failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/config.mk'`"
test 1400 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/config.mk: original size 1400, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/lib.rsp ==============
if test -f 'dmake/msdos/tccdos/lib.rsp' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/lib.rsp (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/lib.rsp' &&
d:\cc\tcc\lib\cl
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/lib.rsp ||
echo 'restore of dmake/msdos/tccdos/lib.rsp failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/lib.rsp'`"
test 17 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/lib.rsp: original size 17, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/libswp.rsp ==============
if test -f 'dmake/msdos/tccdos/libswp.rsp' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/libswp.rsp (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/libswp.rsp' &&
d:\cc\tcc\lib\cl
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/libswp.rsp ||
echo 'restore of dmake/msdos/tccdos/libswp.rsp failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/libswp.rsp'`"
test 17 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/libswp.rsp: original size 17, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/mk.bat ==============
if test -f 'dmake/msdos/tccdos/mk.bat' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/mk.bat (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/mk.bat' &&
md objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  infer.c
mv infer.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  make.c
mv make.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  stat.c
mv stat.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  expand.c
mv expand.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmstring.c
mv dmstring.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  hash.c
mv hash.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dag.c
mv dag.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmake.c
mv dmake.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  path.c
mv path.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  imacs.c
mv imacs.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  sysintf.c
mv sysintf.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  parse.c
mv parse.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  getinp.c
mv getinp.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  quit.c
mv quit.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  state.c
mv state.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  basename.c
mv basename.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmdump.c
mv dmdump.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  macparse.c
mv macparse.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  rulparse.c
mv rulparse.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  percent.c
mv percent.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  function.c
mv function.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\ruletab.c
mv ruletab.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\dirbrk.c
mv dirbrk.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\runargv.c
mv runargv.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\arlib.c
mv arlib.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\_chdir.c
mv _chdir.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\switchar.c
mv switchar.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\rmprq.c
mv rmprq.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tee.c
mv tee.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\tempnam.c
mv tempnam.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\utime.c
mv utime.obj objects
tlink @\tmp\mkAAA010368,dmake.exe,NUL.MAP,@\tmp\mkBAA010368
copy msdos\tccdos\startup.mk startup.mk
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/mk.bat ||
echo 'restore of dmake/msdos/tccdos/mk.bat failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/mk.bat'`"
test 2992 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/mk.bat: original size 2992, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/mkswp.bat ==============
if test -f 'dmake/msdos/tccdos/mkswp.bat' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/mkswp.bat (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/mkswp.bat' &&
md objects
tasm -t -mx -dmlarge msdos\exec.asm;
mv exec.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  infer.c
mv infer.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  make.c
mv make.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  stat.c
mv stat.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  expand.c
mv expand.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmstring.c
mv dmstring.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  hash.c
mv hash.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dag.c
mv dag.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmake.c
mv dmake.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  path.c
mv path.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  imacs.c
mv imacs.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  sysintf.c
mv sysintf.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  parse.c
mv parse.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  getinp.c
mv getinp.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  quit.c
mv quit.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  state.c
mv state.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  basename.c
mv basename.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmdump.c
mv dmdump.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  macparse.c
mv macparse.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  rulparse.c
mv rulparse.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  percent.c
mv percent.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  function.c
mv function.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\ruletab.c
mv ruletab.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\dirbrk.c
mv dirbrk.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\runargv.c
mv runargv.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\arlib.c
mv arlib.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\_chdir.c
mv _chdir.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\switchar.c
mv switchar.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\rmprq.c
mv rmprq.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\find.c
mv find.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\spawn.c
mv spawn.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\tempnam.c
mv tempnam.obj objects
tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\utime.c
mv utime.obj objects
tlink @\tmp\mkAAA010396,dmake.exe,NUL.MAP,@\tmp\mkBAA010396
copy msdos\tccdos\startup.mk startup.mk
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/mkswp.bat ||
echo 'restore of dmake/msdos/tccdos/mkswp.bat failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/mkswp.bat'`"
test 3146 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/mkswp.bat: original size 3146, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/obj.rsp ==============
if test -f 'dmake/msdos/tccdos/obj.rsp' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/obj.rsp (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/obj.rsp' &&
d:\cc\tcc\lib\c0l.obj+
objects\infer.obj+
objects\make.obj+
objects\stat.obj+
objects\expand.obj+
objects\dmstring.obj+
objects\hash.obj+
objects\dag.obj+
objects\dmake.obj+
objects\path.obj+
objects\imacs.obj+
objects\sysintf.obj+
objects\parse.obj+
objects\getinp.obj+
objects\quit.obj+
objects\state.obj+
objects\basename.obj+
objects\dmdump.obj+
objects\macparse.obj+
objects\rulparse.obj+
objects\percent.obj+
objects\function.obj+
objects\ruletab.obj+
objects\dirbrk.obj+
objects\runargv.obj+
objects\arlib.obj+
objects\_chdir.obj+
objects\switchar.obj+
objects\rmprq.obj+
objects\tee.obj+
objects\tempnam.obj+
objects\utime.obj
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/obj.rsp ||
echo 'restore of dmake/msdos/tccdos/obj.rsp failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/obj.rsp'`"
test 635 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/obj.rsp: original size 635, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/objswp.rsp ==============
if test -f 'dmake/msdos/tccdos/objswp.rsp' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/objswp.rsp (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/objswp.rsp' &&
d:\cc\tcc\lib\c0l.obj+
objects\exec.obj+
objects\infer.obj+
objects\make.obj+
objects\stat.obj+
objects\expand.obj+
objects\dmstring.obj+
objects\hash.obj+
objects\dag.obj+
objects\dmake.obj+
objects\path.obj+
objects\imacs.obj+
objects\sysintf.obj+
objects\parse.obj+
objects\getinp.obj+
objects\quit.obj+
objects\state.obj+
objects\basename.obj+
objects\dmdump.obj+
objects\macparse.obj+
objects\rulparse.obj+
objects\percent.obj+
objects\function.obj+
objects\ruletab.obj+
objects\dirbrk.obj+
objects\runargv.obj+
objects\arlib.obj+
objects\_chdir.obj+
objects\switchar.obj+
objects\rmprq.obj+
objects\find.obj+
objects\spawn.obj+
objects\tempnam.obj+
objects\utime.obj
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/objswp.rsp ||
echo 'restore of dmake/msdos/tccdos/objswp.rsp failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/objswp.rsp'`"
test 673 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/objswp.rsp: original size 673, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/public.h ==============
if test -f 'dmake/msdos/tccdos/public.h' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/public.h (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/public.h' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/tccdos/RCS/public.h,v 1.1 91/05/06 15:26:04 dvadura Exp Locker: dvadura $
-- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
--
-- SYNOPSIS -- Local functions exported to be visible by others.
--
-- DESCRIPTION
--      This file is generated by 'genpub'.  Function declarations
--      that appear in this file are extracted by 'genpub' from
--      source files.  Any function in the source file whose definition
--      appears like:
--
--          PUBLIC return_type
--          function( arg_list );
--          type_expr1 arg1;
--          ...
--
--      has its definition extracted and a line of the form:
--
--          return_type function ANSI((type_expr1,type_expr2,...));
--
--      entered into the output file.
--
-- AUTHOR
--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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.
--
-- LOG
--     $Log:	public.h,v $
X * Revision 1.1  91/05/06  15:26:04  dvadura
X * dmake Release Version 3.7
X * 
*/
X
#ifndef _DMAKE_PUBLIC_h
#define _DMAKE_PUBLIC_h
X
void Infer_recipe ANSI((CELLPTR, CELLPTR));
int Make_targets ANSI(());
int Exec_commands ANSI((CELLPTR));
void Pop_dir ANSI((int));
void Append_line ANSI((char *, int, FILE *, char *, int, int));
void Stat_target ANSI((CELLPTR, int));
char * Expand ANSI((char *));
char * Apply_edit ANSI((char *, char *, char *, int, int));
void Map_esc ANSI((char *));
char* Apply_modifiers ANSI((int, char *));
char* Tokenize ANSI((char *, char *));
char * _strjoin ANSI((char *, char *, int, int));
char * _stradd ANSI((char *, char *, int));
char * _strapp ANSI((char *, char *));
char * _strdup ANSI((char *));
char * _strpbrk ANSI((char *, char *));
char * _strspn ANSI((char *, char *));
char * _strstr ANSI((char *, char *));
char * _substr ANSI((char *, char *));
uint16 Hash ANSI((char *, uint32 *));
HASHPTR Get_name ANSI((char *, HASHPTR *, int));
HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
HASHPTR Def_macro ANSI((char *, char *, int));
CELLPTR Def_cell ANSI((char *));
LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
void Clear_prerequisites ANSI((CELLPTR));
int Test_circle ANSI((CELLPTR, int));
STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
t_attr Rcp_attribute ANSI((char *));
int main ANSI((int, char **));
FILE * Openfile ANSI((char *, int, int));
FILE * Closefile ANSI(());
FILE * Search_file ANSI((char *, char **));
char * Filename ANSI(());
void No_ram ANSI(());
int Usage ANSI((int));
int Version ANSI(());
char * Get_suffix ANSI((char *));
char * Build_path ANSI((char *, char *));
void Make_rules ANSI(());
void Create_macro_vars ANSI(());
time_t Do_stat ANSI((char *, char *, char **));
int Do_touch ANSI((char *, char *, char **));
void Void_lib_cache ANSI((char *, char *));
time_t Do_time ANSI(());
int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
char ** Pack_argv ANSI((int, int, char *));
char * Read_env_string ANSI((char *));
int Write_env_string ANSI((char *, char *));
void ReadEnvironment ANSI(());
void Catch_signals ANSI((void (*)()));
void Clear_signals ANSI(());
void Prolog ANSI((int, char* []));
void Epilog ANSI((int));
char * Get_current_dir ANSI(());
int Set_dir ANSI((char*));
char Get_switch_char ANSI(());
FILE* Get_temp ANSI((char **, char *, int));
FILE * Start_temp ANSI((char *, CELLPTR, char **));
void Open_temp_error ANSI((char *, char *));
void Link_temp ANSI((CELLPTR, FILE *, char *));
void Close_temp ANSI((CELLPTR, FILE *));
void Unlink_temp_files ANSI((CELLPTR));
void Handle_result ANSI((int, int, int, CELLPTR));
void Update_time_stamp ANSI((CELLPTR));
void Parse ANSI((FILE *));
int Get_line ANSI((char *, FILE *));
char * Do_comment ANSI((char *, char **, int));
char * Get_token ANSI((TKSTRPTR, char *, int));
void Quit ANSI(());
void Read_state ANSI(());
void Write_state ANSI(());
int Check_state ANSI((CELLPTR, STRINGPTR *, int));
char* basename ANSI((char *));
void Dump ANSI(());
void Dump_recipe ANSI((STRINGPTR));
int Parse_macro ANSI((char *, int));
int Macro_op ANSI((char *));
int Parse_rule_def ANSI((int *));
int Rule_op ANSI((char *));
void Add_recipe_to_list ANSI((char *, int, int));
void Bind_rules_to_targets ANSI((int));
int Set_group_attributes ANSI((char *));
DFALINKPTR Match_dfa ANSI((char *));
void Check_circle_dfa ANSI(());
void Add_nfa ANSI((char *));
char * Exec_function ANSI((char *));
int If_root_path ANSI((char *));
int runargv ANSI((CELLPTR, int, int, int, int, char *));
void Clean_up_processes ANSI(());
int Wait_for_child ANSI((int, int));
time_t seek_arch ANSI((char*, char*));
int touch_arch ANSI((char*, char*));
int _chdir ANSI((char *));
void Remove_prq ANSI((CELLPTR));
void Hook_std_writes ANSI((char *));
X
#endif
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/public.h ||
echo 'restore of dmake/msdos/tccdos/public.h failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/public.h'`"
test 5622 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/public.h: original size 5622, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/startup.mk ==============
if test -f 'dmake/msdos/tccdos/startup.mk' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/startup.mk (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/startup.mk' &&
# MSDOS DMAKE startup file.  Customize to suit your needs.
# Assumes MKS toolkit for the tool commands, and Turbo-C.  Change as req'd.
# See the documentation for a description of internally defined macros.
#
# Disable warnings for macros redefined here that were given
# on the command line.
__.SILENT := $(.SILENT)
.SILENT   := yes
X
# Configuration parameters for DMAKE startup.mk file
# Set these to NON-NULL if you wish to turn the parameter on.
_HAVE_RCS	:= yes		# yes => RCS  is installed.
_HAVE_SCCS	:= 		# yes => SCCS is installed.
X
# Applicable suffix definitions
A := .lib	# Libraries
E := .exe	# Executables
F := .for	# Fortran
O := .obj	# Objects
P := .pas	# Pascal
S := .asm	# Assembler sources
V := 		# RCS suffix
X
# See if these are defined
TMPDIR := $(ROOTDIR)/tmp
.IMPORT .IGNORE : TMPDIR SHELL COMSPEC
X
# Recipe execution configurations
# First set SHELL, If it is not defined, use COMSPEC, otherwise
# it is assumed to be MKS Korn SHELL.
.IF $(SHELL) == $(NULL)
.IF $(COMSPEC) == $(NULL)
X   SHELL := $(ROOTDIR)/bin/sh$E
.ELSE
X   SHELL := $(COMSPEC)
.END
.END
GROUPSHELL := $(SHELL)
X
# Now set remaining arguments depending on which SHELL we
# are going to use.  COMSPEC (assumed to be command.com) or
# MKS Korn Shell.
.IF $(SHELL)==$(COMSPEC)
X   SHELLFLAGS  := $(SWITCHAR)c
X   GROUPFLAGS  := $(SHELLFLAGS)
X   SHELLMETAS  := *"?<>
X   GROUPSUFFIX := .bat
X   DIRSEPSTR   := \\
X   DIVFILE      = $(TMPFILE:s,/,\)
.ELSE
X   SHELLFLAGS  := -c
X   GROUPFLAGS  := 
X   SHELLMETAS  := *"?<>|()&][$$\#`'
X   GROUPSUFFIX := .ksh
X   .MKSARGS    := yes
X   DIVFILE      = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}})
X   DIVSEP_shell_yes := \\\
X   DIVSEP_shell_no  := \\
.END
X
# Standard C-language command names and flags
X   CC      := tcc		# C-compiler and flags
X   CFLAGS  +=
X
X   AS      := tasm		# Assembler and flags
X   ASFLAGS += 
X
X   LD       = tlink		# Loader and flags
X   LDFLAGS +=
X   LDLIBS   =
X
# Definition of $(MAKE) macro for recursive makes.
X   MAKE = $(MAKECMD) $(MFLAGS)
X
# Language and Parser generation Tools and their flags
X   YACC	  := yacc		# standard yacc
X   YFLAGS +=
X   YTAB	  := ytab		# yacc output files name stem.
X
X   LEX	  := lex		# standard lex
X   LFLAGS +=
X   LEXYY  := lex_yy		# lex output file
X
# Other Compilers, Tools and their flags
X   PC	:= tpc			# pascal compiler
X   RC	:= anyf77		# ratfor compiler
X   FC	:= anyf77		# fortran compiler
X
X   CO	   := co		# check out for RCS
X   COFLAGS += -q
X
X   AR     := ar			# archiver
X   ARFLAGS+= ruv
X
X   RM	   := rm		# remove a file command
X   RMFLAGS +=
X
# Implicit generation rules for making inferences.
# We don't provide .yr or .ye rules here.  They're obsolete.
# Rules for making *$O
X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
X   %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\);
X   %$O : %.cl ; class -c $<
X   %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
X
# Executables
X   %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
X
# lex and yacc rules
X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
X
# RCS support
.IF $(_HAVE_RCS)
X   % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
X   .NOINFER : $$(@:d)RCS/$$(@:f)$V
.END
X
# SCCS support
.IF $(_HAVE_SCCS)
X   % : s.% ; get $@
X   .NOINFER : s.%
.END
X
# Recipe to make archive files.
%$A :
[
X   $(AR) $(ARFLAGS) $@ $?
X   $(RM) $(RMFLAGS) $?
]
X
# DMAKE uses this recipe to remove intermediate targets
.REMOVE :; $(RM) -f $<
X
# AUGMAKE extensions for SYSV compatibility
@B = $(@:b)
@D = $(@:d)
@F = $(@:f)
*B = $(*:b)
*D = $(*:d)
*F = $(*:f)
<B = $(<:b)
<D = $(<:d)
<F = $(<:f)
?B = $(?:b)
?F = $(?:f)
?D = $(?:d)
X
# Turn warnings back to previous setting.
.SILENT := $(__.SILENT)
X
# Local init file if any, gets parsed before user makefile
.INCLUDE .IGNORE: "_startup.mk"
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/startup.mk ||
echo 'restore of dmake/msdos/tccdos/startup.mk failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/startup.mk'`"
test 3795 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/startup.mk: original size 3795, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/tempnam.c ==============
if test -f 'dmake/msdos/tccdos/tempnam.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/tempnam.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/tempnam.c' &&
/*LINTLIBRARY*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dos.h>
X
#if defined(max)
#   undef  max
#endif
#define max(A,B) (((A)<(B))?(B):(A))
X
extern char *mktemp();
extern int access();
int _access();
X
/* Turbo C stdio.h doesn't define P_tmpdir, so let's do it here */
/* Under DOS leave the default tmpdir pointing here!		*/
static char *P_tmpdir = "";
X
char *
tempnam(dir, prefix)
char *dir;		/* use this directory please (if non-NULL) */
char *prefix;		/* use this (if non-NULL) as filename prefix */
{
X   static         int count = 0;
X   register char *p, *q, *tmpdir;
X   int            tl=0, dl=0, pl;
X   char		  buf[30];
X
X   pl = strlen(P_tmpdir);
X
X   if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
X   if( dir != NULL ) dl = strlen(dir);
X
X   if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
X     return(NULL);
X
X   *p = '\0';
X
X   if( (tl == 0) || (_access( strcpy(p, tmpdir), 0) != 0) )
X     if( (dl == 0) || (_access( strcpy(p, dir), 0) != 0) )
X	if( _access( strcpy(p, P_tmpdir), 0) != 0 )
X	   if( !prefix )
X	      prefix = "tp";
X
X   if(prefix)
X   {
X      *(p+strlen(p)+2) = '\0';
X      (void)strncat(p, prefix, 2);
X   }
X
X   sprintf( buf, "%08x", _psp );
X   buf[6]='\0';
X   (void)strcat(p, buf );
X   sprintf( buf, "%04d", count++ );
X   q=p+strlen(p)-6;
X   *q++ = buf[0]; *q++ = buf[1];
X   *q++ = buf[2]; *q++ = buf[3];
X
X   if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
X
X   return(p);
}
X
X
X
_access( name, flag )
char *name;
int  flag;
{
X   char *p;
X   int r;
X
X   if( name == NULL || !*name ) return(1);  /* NULL dir means current dir */
X   r = access( name, flag );
X   p = name+strlen(name)-1;
X   if(*p != '/' && *p != '\\') strcat( p, "/" );
X
X   return( r );
}
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/tempnam.c ||
echo 'restore of dmake/msdos/tccdos/tempnam.c failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/tempnam.c'`"
test 1724 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/tempnam.c: original size 1724, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tccdos/utime.c ==============
if test -f 'dmake/msdos/tccdos/utime.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tccdos/utime.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/utime.c' &&
/*
** change access and modify times of file
*/
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
X
int
utime(name, timep)/*
====================
X    Broken for turbo C it only sets the file time to the current time by
X    touching a character in the file */
char*	name;
time_t	timep[2];
{
X	struct  stat buf;
X	int	fil;
X	char	data;
X
X	if (stat(name, &buf) != 0)
X		return (-1);
X	if (buf.st_size != 0)  {
X		if ((fil = open(name, O_RDWR, S_IWRITE)) < 0)
X			return (-1);
X		if (read(fil, &data, 1) < 1) {
X			close(fil);
X			return (-1);
X		}
X		lseek(fil, 0L, 0);
X		if (write(fil, &data, 1) < 1) {
X			close(fil);
X			return (-1);
X		}
X		close(fil);
X		return (0);
X	} else 	if ((fil = creat(name, S_IWRITE)) < 0) {
X		return (-1);
X	} else {
X		close(fil);
X		return (0);
X	}
}
SHAR_EOF
chmod 0640 dmake/msdos/tccdos/utime.c ||
echo 'restore of dmake/msdos/tccdos/utime.c failed'
Wc_c="`wc -c < 'dmake/msdos/tccdos/utime.c'`"
test 767 -eq "$Wc_c" ||
	echo 'dmake/msdos/tccdos/utime.c: original size 767, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= dmake/msdos/tee.c ==============
if test -f 'dmake/msdos/tee.c' -a X"$1" != X"-c"; then
	echo 'x - skipping dmake/msdos/tee.c (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tee.c' &&
/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/RCS/tee.c,v 1.1 91/05/06 15:25:36 dvadura Exp $
-- SYNOPSIS -- Hook_std_writes() dummy call for non swapping MSDOS versions.
-- 
-- DESCRIPTION
--
-- AUTHOR
--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
--
-- COPYRIGHT
--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
-- 
--      This program is free software; you can redistribute it and/or
--      modify it under the terms of the GNU General Public License
--      (version 1), as published by the Free Software Foundation, and
--      found in the file 'LICENSE' included with this distribution.
-- 
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warrant 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
SHAR_EOF
true || echo 'restore of dmake/msdos/tee.c failed'
fi
echo 'End of part 25, continue with part 26'
echo 26 > _shar_seq_.tmp
exit 0

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.