home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-29 | 40.0 KB | 1,301 lines |
- Newsgroups: comp.sources.misc
- From: dvadura@plg.waterloo.edu (Dennis Vadura)
- Subject: v27i126: dmake - dmake Version 3.8, Part25/41
- Message-ID: <1992Jan28.214705.19867@sparky.imd.sterling.com>
- X-Md4-Signature: fbad8b9d45725532421e779d6fc09f8e
- Date: Tue, 28 Jan 1992 21:47:05 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
- Posting-number: Volume 27, Issue 126
- Archive-name: dmake/part25
- Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
- Supersedes: dmake: Volume 19, Issue 22-58
-
- ---- Cut Here and feed the following to 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/mscdos/tempnam.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/mscdos/tempnam.c' &&
- {
- 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/mscdos/tempnam.c ||
- echo 'restore of dmake/msdos/mscdos/tempnam.c failed'
- Wc_c="`wc -c < 'dmake/msdos/mscdos/tempnam.c'`"
- test 1754 -eq "$Wc_c" ||
- echo 'dmake/msdos/mscdos/tempnam.c: original size 1754, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/msdos/rmprq.c ==============
- if test -f 'dmake/msdos/rmprq.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/msdos/rmprq.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/rmprq.c' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/rmprq.c,v 1.1 1992/01/24 03:27:30 dvadura Exp $
- -- SYNOPSIS -- remove prerequisites code.
- --
- -- DESCRIPTION
- -- This code is different for DOS and for UNIX and parallel make
- -- architectures since the parallel case requires the rm's to be
- -- run in parallel, whereas DOS guarantees to run them sequentially.
- --
- -- 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: rmprq.c,v $
- X * Revision 1.1 1992/01/24 03:27:30 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- */
- X
- #include "extern.h"
- X
- PUBLIC void
- Remove_prq( tcp )
- CELLPTR tcp;
- {
- X tcp->ce_flag &= ~(F_MADE|F_VISITED);
- X tcp->ce_time = 0L;
- X
- X Make( tcp, NIL(LINK), NIL(CELL) );
- }
- SHAR_EOF
- chmod 0640 dmake/msdos/rmprq.c ||
- echo 'restore of dmake/msdos/rmprq.c failed'
- Wc_c="`wc -c < 'dmake/msdos/rmprq.c'`"
- test 1649 -eq "$Wc_c" ||
- echo 'dmake/msdos/rmprq.c: original size 1649, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/msdos/ruletab.c ==============
- if test -f 'dmake/msdos/ruletab.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/msdos/ruletab.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/ruletab.c' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/ruletab.c,v 1.1 1992/01/24 03:27:43 dvadura Exp $
- -- SYNOPSIS -- Default initial configuration of dmake.
- --
- -- DESCRIPTION
- -- Define here the initial set of rules that are defined before
- -- dmake performs any processing.
- --
- -- 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: ruletab.c,v $
- X * Revision 1.1 1992/01/24 03:27:43 dvadura
- X * dmake Version 3.8, Initial revision
- 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
- static char *_rules[] = {
- X "MAXLINELENGTH := 2046",
- X "MAXPROCESSLIMIT := 1",
- X "MAXPROCESS := 1",
- X ".IMPORT .IGNORE: ROOTDIR",
- X ".MAKEFILES : makefile.mk makefile",
- X ".SOURCE : .NULL",
- #include "startup.h"
- X 0 };
- X
- char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
- X
- SHAR_EOF
- chmod 0640 dmake/msdos/ruletab.c ||
- echo 'restore of dmake/msdos/ruletab.c failed'
- Wc_c="`wc -c < 'dmake/msdos/ruletab.c'`"
- test 1960 -eq "$Wc_c" ||
- echo 'dmake/msdos/ruletab.c: original size 1960, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/msdos/runargv.c ==============
- if test -f 'dmake/msdos/runargv.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/msdos/runargv.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/runargv.c' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/runargv.c,v 1.1 1992/01/24 03:27:35 dvadura Exp $
- -- SYNOPSIS -- run a sub process.
- --
- -- DESCRIPTION
- -- Use spawn to run a subprocess.
- --
- -- 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: runargv.c,v $
- X * Revision 1.1 1992/01/24 03:27:35 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- */
- X
- #include <process.h>
- #include <errno.h>
- #include "extern.h"
- #include "sysintf.h"
- X
- static int _abort_flg = FALSE;
- static void _add_child ANSI((CELLPTR, int));
- static void _finished_child ANSI((int));
- X
- PUBLIC int
- runargv(target, ignore, group, last, shell, cmd)
- CELLPTR target;
- int ignore;
- int group;
- int last;
- int shell;
- char *cmd;
- {
- #if ! defined(_MSC_VER)
- X extern char **environ;
- #endif
- X int status;
- X char **argv;
- X char path[MAX_PATH_LEN+1];
- X
- X argv = Pack_argv( group, shell, cmd );
- X _add_child(target, ignore);
- X
- X /* Preserve the current working directory accross a spawn call
- X * DOS is brain dead about this. */
- X strcpy(path,Get_current_dir());
- X status = spawnvpe(P_WAIT, *argv, argv, environ);
- X Set_dir(path);
- X
- X if( status == -1 ) Error("%s: %s", argv[0], strerror(errno));
- X _finished_child(status);
- X if( last && !Doing_bang ) Update_time_stamp( target );
- X
- X return( 0 );
- }
- X
- X
- PUBLIC void
- Clean_up_processes()
- {
- X _abort_flg = TRUE;
- X _finished_child(-1);
- }
- X
- X
- PUBLIC int
- Wait_for_child( abort_flg, pid )
- int abort_flg;
- int pid;
- {
- X return(1);
- }
- X
- X
- static int _valid = -1;
- static CELLPTR _tg;
- static int _ignore;
- X
- static void
- _add_child( target, ignore )
- CELLPTR target;
- int ignore;
- {
- X _tg = target;
- X _ignore = ignore;
- X _valid = 0;
- X
- X Current_target = NIL(CELL);
- }
- X
- X
- static void
- _finished_child(status)
- int status;
- {
- X if( _valid == -1 ) return;
- X Unlink_temp_files( _tg );
- X _valid = -1;
- X Handle_result( status, _ignore, _abort_flg, _tg );
- }
- SHAR_EOF
- chmod 0640 dmake/msdos/runargv.c ||
- echo 'restore of dmake/msdos/runargv.c failed'
- Wc_c="`wc -c < 'dmake/msdos/runargv.c'`"
- test 2811 -eq "$Wc_c" ||
- echo 'dmake/msdos/runargv.c: original size 2811, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/msdos/spawn.c ==============
- if test -f 'dmake/msdos/spawn.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/msdos/spawn.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/spawn.c' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/spawn.c,v 1.1 1992/01/24 03:27:31 dvadura Exp $
- -- SYNOPSIS -- spawnvpe code to emulate spawnvpe call common to DOS compilers.
- --
- -- DESCRIPTION
- -- This implementation is further integrated into dmake in that it
- -- determines the program to execute and if it's extension is either
- -- .bat or .ksh it executes it using the appropriate shell based on the
- -- setting of .MKSARGS. If .MKSARGS is set then in addition
- -- to the command tail getting built the arguments are also passed in the
- -- environment pursuant to the published MKS argument passing conventions.
- -- If the variable Swap_on_exec is set and the DOS OS supports it
- -- then the dmake executable image is swapped to secondary storage prior
- -- to running the child process. This is requested by setting the
- -- appropriate flag in the call to exec.
- --
- -- This and the exec.asm routine are derived from work that was supplied
- -- to me by Kent Williams (williams@umaxc.weeg.uiowa.edu) and by
- -- Len Reed, (..!gatech!holos0!lbr or holos0!lbr@gatech.edu., Holos
- -- Software, Inc., Tucker, Ga.). I sincerely acknowledge their help since
- -- their Turbo C, and MSC 6.0 code lead directly to this combined
- -- swapping exec that hopefully works with either compiler in all memory
- -- models.
- --
- -- 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: spawn.c,v $
- X * Revision 1.1 1992/01/24 03:27:31 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- */
- X
- #include <stdio.h>
- #include <stdlib.h>
- X
- #if defined(_MSC_VER) && _MSC_VER >= 600
- X /* Ignore the MSC 6.0 library's "const"-riddled prototype
- X for spawnvpe.
- X */
- # define spawnvpe _ignore_msc_spawnvpe
- # include <process.h>
- # undef spawnvpe
- X int spawnvpe(int, char *, char **, char **);
- #else
- # include <process.h>
- #endif
- X
- #include <dos.h>
- #include <errno.h>
- #include <string.h>
- #include <alloc.h>
- #include <fcntl.h>
- #include "extern.h"
- #include "dirlib.h"
- #include "exec.h"
- #include "sysintf.h"
- X
- extern int Interrupted;
- X
- /* variables and functions local to this file */
- static char *_findexec ANSI((char *, int *));
- static char **_getpath ANSI(());
- static char far *_dos_alloc ANSI((uint16));
- X
- static uint16 _swap_mask;
- static int _mks_args;
- static char dot_com[] = ".COM",
- X dot_exe[] = ".EXE",
- X dot_bat[] = ".BAT",
- X dot_ksh[] = ".KSH";
- X
- /* Kinds of executables */
- #define SCR 1
- #define COM 2
- #define EXE 4
- #define ALL (SCR|COM|EXE)
- X
- /* How to make a long pointer */
- #define CF(x) (char far *)x
- X
- /* Make sure we know how to get a segment out of a long pointer */
- #ifndef FP_SEG
- #define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
- #endif
- X
- X
- PUBLIC int
- spawnvpe(mode, program, av, ep)/*
- =================================
- X Spawn a process using an environment and a vector of arguments.
- X The code computes a new environment, puts the MKS arguments into
- X it if need be, and calls the appropriate routines to search the
- X path and to invoke the process. */
- int mode;
- char *program;
- char **av;
- char **ep;
- {
- X char **envp = ep; /* Cause we are going to mess with it. */
- X char **argv = av; /* Same with this one. */
- X char cmdtail[129];
- X char far *environment;
- X char *tail;
- X char *swptmp;
- X unsigned int envsize;
- X unsigned int cmdsize;
- X int cmdtailen;
- X int i;
- X int doswap;
- X
- X /* First check to see if we can find the program to execute this way we
- X * don't alloc the environment and other such stuff prior to figuring out
- X * we don't know how to run the program. */
- find_program:
- X if((program = _findexec(program, &i)) == NIL(char)) {
- X errno = ENOENT;
- X return( -1 );
- X }
- X
- X /* i is set to TRUE in _findexec if the exec is a shell
- X * script (either .BAT or .KSH file), returns FALSE for all others. */
- X if( i && !Packed_shell ) {
- X /* Restore the spaces into the command line that were erased by
- X * the previous call to Pack_argv. This enables us to repack the
- X * command as a shell command using Pack_argv again. */
- X for( i=0; argv[i] != NIL(char); i++ ) {
- X int x = strlen(argv[i]);
- X if( argv[i+1] != NIL(char) ) argv[i][x] = ' ';
- X }
- X
- X argv = Pack_argv( FALSE, TRUE, *argv );
- X
- X /* Go and find the program again, I hate goto's but it seems silly to
- X * use tail recursion here just for aesthetic purity. */
- X program = *argv;
- X goto find_program;
- X }
- X
- X /* Compute size of *argv vector for passing as MKS style arguments */
- X cmdsize = strlen(*argv)+2;
- X
- X /* So we have decided on a program to run, therefore pack the command tail
- X * and build the environment to pass to the exec code. This loop packs the
- X * DOS command tail, and computes the size of all arguments for the MKS
- X * argument passing convention. Note that we reserve one less byte in the
- X * command tail if we are not using MKS style argument passing.
- X *
- X * Make sure the command tail contains at leat a space. Some commands fail
- X * to work if the command tail is only a \r, STUPID DOS! */
- X cmdtailen = (_mks_args = ((Glob_attr & A_MKSARGS) != 0))?3:2;
- X tail = cmdtail+1;
- X
- X if( argv[1] != NIL(char) )
- X for( i=1; argv[i] != NIL(char); i++ ) {
- X int arglen = strlen(argv[i]);
- X
- X cmdsize += arglen+2; /* Compute all args size for MKS */
- X
- X if( (cmdtailen += arglen+1) <= 128 ) {
- X register char *p = argv[i];
- X tail[-1] = ' '; /* put in the space */
- X while( *tail++ = *p++ ); /* put in the arg */
- X }
- X else if( !_mks_args ) {
- X errno = E2BIG; /* unless its MKS exit if arglist */
- X return(-1); /* is too long. */
- X }
- X }
- X else
- X *tail++ = ' ';
- X
- X /* Finish the command tail set up, placing the length in the first byte,
- X * and the \r \n \0 at the end for DOS, MKS and us respectively. */
- X *cmdtail = tail-cmdtail-2;
- X tail[-1] = '\r';
- X if( _mks_args ) *tail++ = '\n';
- X *tail = '\0';
- X
- X /* Compute size of environment, skipping any MKS arguments passed in our
- X * environment */
- X for(; *envp && **envp == '~'; envp++ );
- X for(i=0, envsize=_mks_args?cmdsize:1; envp[i] != NIL(char); i++ )
- X envsize += strlen(envp[i]) + 1;
- X
- X /* Check the DOS version number here. If it is < 3.0 then we don't
- X * even want to think about executing the swapping code. Permanently
- X * set swap to 0. */
- X doswap = (_osmajor < 3) ? 0 : Swap_on_exec;
- X
- X /* Set up temporary file for swapping */
- X swptmp = doswap?tempnam(NIL(char),"mk"):"";
- X
- X /* Allocate an appropriate sized environment block and align it on a
- X * paragraph boundary. It will later get copied to an appropriately low
- X * place in the executable image so that when we swap out the environment
- X * is still present. Use
- X * _dos_alloc
- X * to allocate the environment segment. The segment is freed by the call
- X * to exec. */
- X environment = _dos_alloc( envsize = ((envsize+16)>>4) );
- X
- X /* First copy the arguments preceeded by ~ character if we are using
- X * MKS style argument passing */
- X if( _mks_args )
- X for(; *argv; argv++) {
- X register char *p = *argv;
- X
- X *environment++ = '~';
- X while( *environment++ = *p++ ); /* Far dest, poss near ptr */
- X }
- X
- X /* Now stick in the current evironment vectors. */
- X for(; *envp; envp++) {
- X register char *p = *envp;
- X while( *environment++ = *p++ ); /* Far dest, poss near ptr */
- X }
- X *environment = '\0';
- X
- X /* Clear the interrupted flag, and exec */
- X Interrupted = 0;
- X i = exec(doswap,CF(program),CF(cmdtail),FP_SEG(environment),CF(swptmp));
- X
- X /* Now free the temporary file name */
- X if( doswap ) FREE(swptmp);
- X
- X /* If swap was interrupted then quit properly from dmake. */
- X if( Interrupted ) Quit();
- X
- X return(i);
- }
- X
- X
- PUBLIC void
- Hook_std_writes( file )
- char *file;
- {
- X if( file!= NIL(char) ) {
- X int mode = O_BINARY | O_WRONLY | O_CREAT | O_TRUNC;
- X int handle;
- X
- X if (*file == '+') {
- X ++file; /* -F +file means append to file */
- 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 12759 -eq "$Wc_c" ||
- echo 'dmake/msdos/spawn.c: original size 12759, 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
- #if !defined(ZTC)
- #define __ss
- #endif
- X
- typedef char __ss *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 417 -eq "$Wc_c" ||
- echo 'dmake/msdos/stdarg.h: original size 417, 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
- */
- #ifdef _POSIX_NAME_MAX
- #undef _POSIX_NAME_MAX
- #endif
- #define _POSIX_NAME_MAX 12
- #define _POSIX_PATH_MAX 64
- #define MAX_PATH_LEN _POSIX_PATH_MAX
- 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 420 -eq "$Wc_c" ||
- echo 'dmake/msdos/sysintf.h: original size 420, 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 1992/01/24 03:27:32 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 1992/01/24 03:27:32 dvadura
- X * dmake Version 3.8, Initial revision
- 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
- X
- /* a small problem with pointer to voids on some unix machines needs this */
- #define PVOID void *
- 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 2009 -eq "$Wc_c" ||
- echo 'dmake/msdos/tccdos/config.h: original size 2009, 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
- copy infer.obj objects
- del infer.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml make.c
- copy make.obj objects
- del make.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml stat.c
- copy stat.obj objects
- del stat.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml expand.c
- copy expand.obj objects
- del expand.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dmstring.c
- copy dmstring.obj objects
- del dmstring.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml hash.c
- copy hash.obj objects
- del hash.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dag.c
- copy dag.obj objects
- del dag.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dmake.c
- copy dmake.obj objects
- del dmake.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml path.c
- copy path.obj objects
- del path.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml imacs.c
- copy imacs.obj objects
- del imacs.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml sysintf.c
- copy sysintf.obj objects
- del sysintf.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml parse.c
- copy parse.obj objects
- del parse.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml getinp.c
- copy getinp.obj objects
- del getinp.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml quit.c
- copy quit.obj objects
- del quit.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml state.c
- copy state.obj objects
- del state.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml basename.c
- copy basename.obj objects
- del basename.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dmdump.c
- copy dmdump.obj objects
- del dmdump.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml macparse.c
- copy macparse.obj objects
- del macparse.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml rulparse.c
- copy rulparse.obj objects
- del rulparse.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml percent.c
- copy percent.obj objects
- del percent.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml function.c
- copy function.obj objects
- del function.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\ruletab.c
- copy ruletab.obj objects
- del ruletab.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\dirbrk.c
- copy dirbrk.obj objects
- del dirbrk.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\runargv.c
- copy runargv.obj objects
- del runargv.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\arlib.c
- copy arlib.obj objects
- del arlib.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\_chdir.c
- copy _chdir.obj objects
- del _chdir.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\switchar.c
- copy switchar.obj objects
- del switchar.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\rmprq.c
- copy rmprq.obj objects
- del rmprq.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\tee.c
- copy tee.obj objects
- del tee.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\tccdos\tempnam.c
- copy tempnam.obj objects
- del tempnam.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml msdos\tccdos\utime.c
- copy utime.obj objects
- del utime.obj
- copy msdos\tccdos\startup.mk startup.mk
- tlink @msdos\tccdos\obj.rsp,dmake.exe,NUL.MAP,@msdos\tccdos\lib.rsp
- 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 3521 -eq "$Wc_c" ||
- echo 'dmake/msdos/tccdos/mk.bat: original size 3521, 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
- copy infer.obj objects
- del infer.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml make.c
- copy make.obj objects
- del make.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml stat.c
- copy stat.obj objects
- del stat.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml expand.c
- copy expand.obj objects
- del expand.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dmstring.c
- copy dmstring.obj objects
- del dmstring.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml hash.c
- copy hash.obj objects
- del hash.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dag.c
- copy dag.obj objects
- del dag.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dmake.c
- copy dmake.obj objects
- del dmake.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml path.c
- copy path.obj objects
- del path.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml imacs.c
- copy imacs.obj objects
- del imacs.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml sysintf.c
- copy sysintf.obj objects
- del sysintf.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml parse.c
- copy parse.obj objects
- del parse.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml getinp.c
- copy getinp.obj objects
- del getinp.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml quit.c
- copy quit.obj objects
- del quit.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml state.c
- copy state.obj objects
- del state.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml basename.c
- copy basename.obj objects
- del basename.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml dmdump.c
- copy dmdump.obj objects
- del dmdump.obj
- tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml macparse.c
- copy macparse.obj objects
- del macparse.obj
- SHAR_EOF
- true || echo 'restore of dmake/msdos/tccdos/mkswp.bat failed'
- fi
- echo 'End of part 25, continue with part 26'
- echo 26 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
-