home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume27 / dmake / part25 < prev    next >
Encoding:
Text File  |  1992-01-29  |  40.0 KB  |  1,301 lines

  1. Newsgroups: comp.sources.misc
  2. From: dvadura@plg.waterloo.edu (Dennis Vadura)
  3. Subject:  v27i126:  dmake - dmake Version 3.8, Part25/41
  4. Message-ID: <1992Jan28.214705.19867@sparky.imd.sterling.com>
  5. X-Md4-Signature: fbad8b9d45725532421e779d6fc09f8e
  6. Date: Tue, 28 Jan 1992 21:47:05 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
  10. Posting-number: Volume 27, Issue 126
  11. Archive-name: dmake/part25
  12. Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
  13. Supersedes: dmake: Volume 19, Issue 22-58
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. # this is dmake.shar.25 (part 25 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file dmake/msdos/mscdos/tempnam.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 25; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test -f _shar_wnt_.tmp; then
  33. sed 's/^X//' << 'SHAR_EOF' >> 'dmake/msdos/mscdos/tempnam.c' &&
  34. {
  35. X   static         int count = 0;
  36. X   register char *p, *q, *tmpdir;
  37. X   int            tl=0, dl=0, pl;
  38. X   char          buf[30];
  39. X
  40. X   pl = strlen(P_tmpdir);
  41. X
  42. X   if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
  43. X   if( dir != NULL ) dl = strlen(dir);
  44. X
  45. X   if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
  46. X     return(NULL);
  47. X
  48. X   *p = '\0';
  49. X
  50. X   if( (tl == 0) || (_access( strcpy(p, tmpdir), 0) != 0) )
  51. X     if( (dl == 0) || (_access( strcpy(p, dir), 0) != 0) )
  52. X    if( _access( strcpy(p, P_tmpdir), 0) != 0 )
  53. X       if( !prefix )
  54. X          prefix = "tp";
  55. X
  56. X   if(prefix)
  57. X   {
  58. X      *(p+strlen(p)+2) = '\0';
  59. X      (void)strncat(p, prefix, 2);
  60. X   }
  61. X
  62. X   sprintf( buf, "%08x", _psp );
  63. X   buf[6]='\0';
  64. X   (void)strcat(p, buf );
  65. X   sprintf( buf, "%04d", count++ );
  66. X   q=p+strlen(p)-6;
  67. X   *q++ = buf[0]; *q++ = buf[1];
  68. X   *q++ = buf[2]; *q++ = buf[3];
  69. X
  70. X   if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
  71. X
  72. X   return(p);
  73. }
  74. X
  75. X
  76. X
  77. _access( name, flag )
  78. char *name;
  79. int  flag;
  80. {
  81. X   char *p;
  82. X   int r;
  83. X
  84. X   if( name == NULL || !*name ) return(1);  /* NULL dir means current dir */
  85. X   r = access( name, flag );
  86. X   p = name+strlen(name)-1;
  87. X   if(*p != '/' && *p != '\\') strcat( p, "/" );
  88. X
  89. X   return( r );
  90. }
  91. SHAR_EOF
  92. chmod 0640 dmake/msdos/mscdos/tempnam.c ||
  93. echo 'restore of dmake/msdos/mscdos/tempnam.c failed'
  94. Wc_c="`wc -c < 'dmake/msdos/mscdos/tempnam.c'`"
  95. test 1754 -eq "$Wc_c" ||
  96.     echo 'dmake/msdos/mscdos/tempnam.c: original size 1754, current size' "$Wc_c"
  97. rm -f _shar_wnt_.tmp
  98. fi
  99. # ============= dmake/msdos/rmprq.c ==============
  100. if test -f 'dmake/msdos/rmprq.c' -a X"$1" != X"-c"; then
  101.     echo 'x - skipping dmake/msdos/rmprq.c (File already exists)'
  102.     rm -f _shar_wnt_.tmp
  103. else
  104. > _shar_wnt_.tmp
  105. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/rmprq.c' &&
  106. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/rmprq.c,v 1.1 1992/01/24 03:27:30 dvadura Exp $
  107. -- SYNOPSIS -- remove prerequisites code.
  108. -- 
  109. -- DESCRIPTION
  110. --    This code is different for DOS and for UNIX and parallel make
  111. --    architectures since the parallel case requires the rm's to be
  112. --    run in parallel, whereas DOS guarantees to run them sequentially.
  113. -- 
  114. -- AUTHOR
  115. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  116. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  117. --
  118. -- COPYRIGHT
  119. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  120. -- 
  121. --      This program is free software; you can redistribute it and/or
  122. --      modify it under the terms of the GNU General Public License
  123. --      (version 1), as published by the Free Software Foundation, and
  124. --      found in the file 'LICENSE' included with this distribution.
  125. -- 
  126. --      This program is distributed in the hope that it will be useful,
  127. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  128. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  129. --      GNU General Public License for more details.
  130. -- 
  131. --      You should have received a copy of the GNU General Public License
  132. --      along with this program;  if not, write to the Free Software
  133. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  134. --
  135. -- LOG
  136. --     $Log: rmprq.c,v $
  137. X * Revision 1.1  1992/01/24  03:27:30  dvadura
  138. X * dmake Version 3.8, Initial revision
  139. X *
  140. */
  141. X
  142. #include "extern.h"
  143. X
  144. PUBLIC void
  145. Remove_prq( tcp )
  146. CELLPTR tcp;
  147. {
  148. X   tcp->ce_flag &= ~(F_MADE|F_VISITED);
  149. X   tcp->ce_time  = 0L;
  150. X
  151. X   Make( tcp, NIL(LINK), NIL(CELL) );
  152. }
  153. SHAR_EOF
  154. chmod 0640 dmake/msdos/rmprq.c ||
  155. echo 'restore of dmake/msdos/rmprq.c failed'
  156. Wc_c="`wc -c < 'dmake/msdos/rmprq.c'`"
  157. test 1649 -eq "$Wc_c" ||
  158.     echo 'dmake/msdos/rmprq.c: original size 1649, current size' "$Wc_c"
  159. rm -f _shar_wnt_.tmp
  160. fi
  161. # ============= dmake/msdos/ruletab.c ==============
  162. if test -f 'dmake/msdos/ruletab.c' -a X"$1" != X"-c"; then
  163.     echo 'x - skipping dmake/msdos/ruletab.c (File already exists)'
  164.     rm -f _shar_wnt_.tmp
  165. else
  166. > _shar_wnt_.tmp
  167. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/ruletab.c' &&
  168. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/ruletab.c,v 1.1 1992/01/24 03:27:43 dvadura Exp $
  169. -- SYNOPSIS -- Default initial configuration of dmake.
  170. -- 
  171. -- DESCRIPTION
  172. --     Define here the initial set of rules that are defined before
  173. --    dmake performs any processing.
  174. --
  175. -- AUTHOR
  176. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  177. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  178. --
  179. -- COPYRIGHT
  180. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  181. -- 
  182. --      This program is free software; you can redistribute it and/or
  183. --      modify it under the terms of the GNU General Public License
  184. --      (version 1), as published by the Free Software Foundation, and
  185. --      found in the file 'LICENSE' included with this distribution.
  186. -- 
  187. --      This program is distributed in the hope that it will be useful,
  188. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  189. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  190. --      GNU General Public License for more details.
  191. -- 
  192. --      You should have received a copy of the GNU General Public License
  193. --      along with this program;  if not, write to the Free Software
  194. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  195. --
  196. -- LOG
  197. --     $Log: ruletab.c,v $
  198. X * Revision 1.1  1992/01/24  03:27:43  dvadura
  199. X * dmake Version 3.8, Initial revision
  200. X *
  201. */
  202. X
  203. /* These are control macros for dmake that MUST be defined at some point
  204. X * if they are NOT dmake will not work!  These are default definitions.  They
  205. X * may be overridden inside the .STARTUP makefile, they are here
  206. X * strictly so that dmake can parse the STARTUP makefile */
  207. X
  208. static char *_rules[] = {
  209. X    "MAXLINELENGTH := 2046",
  210. X    "MAXPROCESSLIMIT := 1",
  211. X    "MAXPROCESS := 1",
  212. X    ".IMPORT .IGNORE: ROOTDIR",
  213. X    ".MAKEFILES : makefile.mk makefile",
  214. X    ".SOURCE    : .NULL",
  215. #include "startup.h"
  216. X    0 };
  217. X
  218. char **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
  219. X
  220. SHAR_EOF
  221. chmod 0640 dmake/msdos/ruletab.c ||
  222. echo 'restore of dmake/msdos/ruletab.c failed'
  223. Wc_c="`wc -c < 'dmake/msdos/ruletab.c'`"
  224. test 1960 -eq "$Wc_c" ||
  225.     echo 'dmake/msdos/ruletab.c: original size 1960, current size' "$Wc_c"
  226. rm -f _shar_wnt_.tmp
  227. fi
  228. # ============= dmake/msdos/runargv.c ==============
  229. if test -f 'dmake/msdos/runargv.c' -a X"$1" != X"-c"; then
  230.     echo 'x - skipping dmake/msdos/runargv.c (File already exists)'
  231.     rm -f _shar_wnt_.tmp
  232. else
  233. > _shar_wnt_.tmp
  234. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/runargv.c' &&
  235. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/runargv.c,v 1.1 1992/01/24 03:27:35 dvadura Exp $
  236. -- SYNOPSIS -- run a sub process.
  237. -- 
  238. -- DESCRIPTION
  239. --    Use spawn to run a subprocess.
  240. --
  241. -- AUTHOR
  242. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  243. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  244. --
  245. -- COPYRIGHT
  246. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  247. -- 
  248. --      This program is free software; you can redistribute it and/or
  249. --      modify it under the terms of the GNU General Public License
  250. --      (version 1), as published by the Free Software Foundation, and
  251. --      found in the file 'LICENSE' included with this distribution.
  252. -- 
  253. --      This program is distributed in the hope that it will be useful,
  254. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  255. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  256. --      GNU General Public License for more details.
  257. -- 
  258. --      You should have received a copy of the GNU General Public License
  259. --      along with this program;  if not, write to the Free Software
  260. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  261. --
  262. -- LOG
  263. --     $Log: runargv.c,v $
  264. X * Revision 1.1  1992/01/24  03:27:35  dvadura
  265. X * dmake Version 3.8, Initial revision
  266. X *
  267. */
  268. X
  269. #include <process.h>
  270. #include <errno.h>
  271. #include "extern.h"
  272. #include "sysintf.h"
  273. X
  274. static int  _abort_flg = FALSE;
  275. static void _add_child ANSI((CELLPTR, int));
  276. static void _finished_child ANSI((int));
  277. X
  278. PUBLIC int
  279. runargv(target, ignore, group, last, shell, cmd)
  280. CELLPTR target;
  281. int     ignore;
  282. int    group;
  283. int    last;
  284. int    shell;
  285. char    *cmd;
  286. {
  287. #if ! defined(_MSC_VER)
  288. X   extern char **environ;
  289. #endif
  290. X   int status;
  291. X   char **argv;
  292. X   char path[MAX_PATH_LEN+1];
  293. X
  294. X   argv = Pack_argv( group, shell, cmd );
  295. X   _add_child(target, ignore);
  296. X
  297. X   /* Preserve the current working directory accross a spawn call 
  298. X    * DOS is brain dead about this. */
  299. X   strcpy(path,Get_current_dir());
  300. X   status = spawnvpe(P_WAIT, *argv, argv, environ);
  301. X   Set_dir(path);
  302. X
  303. X   if( status == -1 ) Error("%s: %s", argv[0], strerror(errno));
  304. X   _finished_child(status);
  305. X   if( last && !Doing_bang ) Update_time_stamp( target );
  306. X
  307. X   return( 0 );
  308. }
  309. X
  310. X
  311. PUBLIC void
  312. Clean_up_processes()
  313. {
  314. X   _abort_flg = TRUE;
  315. X   _finished_child(-1);
  316. }
  317. X
  318. X
  319. PUBLIC int
  320. Wait_for_child( abort_flg, pid )
  321. int abort_flg;
  322. int pid;
  323. {
  324. X   return(1);
  325. }
  326. X
  327. X
  328. static int     _valid = -1;
  329. static CELLPTR _tg;
  330. static int     _ignore;
  331. X
  332. static void
  333. _add_child( target, ignore )
  334. CELLPTR target;
  335. int    ignore;
  336. {
  337. X   _tg = target;
  338. X   _ignore = ignore;
  339. X   _valid = 0;
  340. X
  341. X   Current_target = NIL(CELL);
  342. }
  343. X
  344. X
  345. static void
  346. _finished_child(status)
  347. int    status;
  348. {
  349. X   if( _valid == -1 ) return;
  350. X   Unlink_temp_files( _tg );
  351. X   _valid = -1;
  352. X   Handle_result( status, _ignore, _abort_flg, _tg );
  353. }
  354. SHAR_EOF
  355. chmod 0640 dmake/msdos/runargv.c ||
  356. echo 'restore of dmake/msdos/runargv.c failed'
  357. Wc_c="`wc -c < 'dmake/msdos/runargv.c'`"
  358. test 2811 -eq "$Wc_c" ||
  359.     echo 'dmake/msdos/runargv.c: original size 2811, current size' "$Wc_c"
  360. rm -f _shar_wnt_.tmp
  361. fi
  362. # ============= dmake/msdos/spawn.c ==============
  363. if test -f 'dmake/msdos/spawn.c' -a X"$1" != X"-c"; then
  364.     echo 'x - skipping dmake/msdos/spawn.c (File already exists)'
  365.     rm -f _shar_wnt_.tmp
  366. else
  367. > _shar_wnt_.tmp
  368. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/spawn.c' &&
  369. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/spawn.c,v 1.1 1992/01/24 03:27:31 dvadura Exp $
  370. -- SYNOPSIS -- spawnvpe code to emulate spawnvpe call common to DOS compilers.
  371. -- 
  372. -- DESCRIPTION
  373. --    This implementation is further integrated into dmake in that it
  374. --    determines the program to execute and if it's extension is either
  375. --    .bat or .ksh it executes it using the appropriate shell based on the
  376. --    setting of .MKSARGS.  If .MKSARGS is set then in addition
  377. --    to the command tail getting built the arguments are also passed in the
  378. --    environment pursuant to the published MKS argument passing conventions.
  379. --    If the variable Swap_on_exec is set and the DOS OS supports it
  380. --    then the dmake executable image is swapped to secondary storage prior
  381. --    to running the child process.  This is requested by setting the
  382. --    appropriate flag in the call to exec.
  383. --
  384. --    This and the exec.asm routine are derived from work that was supplied
  385. --    to me by Kent Williams (williams@umaxc.weeg.uiowa.edu) and by
  386. --      Len Reed, (..!gatech!holos0!lbr or holos0!lbr@gatech.edu., Holos
  387. --    Software, Inc., Tucker, Ga.).  I sincerely acknowledge their help since
  388. --    their Turbo C, and MSC 6.0 code lead directly to this combined
  389. --    swapping exec that hopefully works with either compiler in all memory
  390. --    models.
  391. --
  392. -- AUTHOR
  393. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  394. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  395. --
  396. -- COPYRIGHT
  397. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  398. -- 
  399. --      This program is free software; you can redistribute it and/or
  400. --      modify it under the terms of the GNU General Public License
  401. --      (version 1), as published by the Free Software Foundation, and
  402. --      found in the file 'LICENSE' included with this distribution.
  403. -- 
  404. --      This program is distributed in the hope that it will be useful,
  405. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  406. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  407. --      GNU General Public License for more details.
  408. -- 
  409. --      You should have received a copy of the GNU General Public License
  410. --      along with this program;  if not, write to the Free Software
  411. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  412. --
  413. -- LOG
  414. --     $Log: spawn.c,v $
  415. X * Revision 1.1  1992/01/24  03:27:31  dvadura
  416. X * dmake Version 3.8, Initial revision
  417. X *
  418. */
  419. X
  420. #include <stdio.h>
  421. #include <stdlib.h>
  422. X
  423. #if defined(_MSC_VER) && _MSC_VER >= 600
  424. X    /* Ignore the MSC 6.0 library's "const"-riddled prototype
  425. X       for spawnvpe.
  426. X    */
  427. # define spawnvpe _ignore_msc_spawnvpe
  428. # include <process.h>
  429. # undef spawnvpe
  430. X  int spawnvpe(int, char *, char **, char **);
  431. #else
  432. # include <process.h>
  433. #endif
  434. X
  435. #include <dos.h>
  436. #include <errno.h>
  437. #include <string.h>
  438. #include <alloc.h>
  439. #include <fcntl.h>
  440. #include "extern.h"
  441. #include "dirlib.h"
  442. #include "exec.h"
  443. #include "sysintf.h"
  444. X
  445. extern int Interrupted;
  446. X
  447. /* variables and functions local to this file */
  448. static char     *_findexec ANSI((char *, int *));
  449. static char    **_getpath ANSI(());
  450. static char far *_dos_alloc ANSI((uint16));
  451. X
  452. static uint16 _swap_mask;
  453. static int    _mks_args;
  454. static char   dot_com[] = ".COM",
  455. X          dot_exe[] = ".EXE",
  456. X              dot_bat[] = ".BAT",
  457. X          dot_ksh[] = ".KSH";
  458. X
  459. /* Kinds of executables */
  460. #define SCR 1
  461. #define COM 2
  462. #define EXE 4
  463. #define ALL (SCR|COM|EXE)
  464. X
  465. /* How to make a long pointer */
  466. #define CF(x) (char far *)x
  467. X
  468. /* Make sure we know how to get a segment out of a long pointer */
  469. #ifndef FP_SEG
  470. #define FP_SEG(fp)    ((unsigned)((unsigned long)(fp) >> 16))
  471. #endif
  472. X
  473. X
  474. PUBLIC int
  475. spawnvpe(mode, program, av, ep)/*
  476. =================================
  477. X   Spawn a process using an environment and a vector of arguments.
  478. X   The code computes a new environment, puts the MKS arguments into
  479. X   it if need be, and calls the appropriate routines to search the
  480. X   path and to invoke the process. */
  481. int  mode;
  482. char *program;
  483. char **av;
  484. char **ep;
  485. {
  486. X   char **envp = ep;        /* Cause we are going to mess with it. */
  487. X   char **argv = av;        /* Same with this one.               */
  488. X   char cmdtail[129];
  489. X   char far *environment;
  490. X   char *tail;
  491. X   char *swptmp;
  492. X   unsigned int envsize;
  493. X   unsigned int cmdsize;
  494. X   int  cmdtailen;
  495. X   int  i;
  496. X   int  doswap;
  497. X
  498. X   /* First check to see if we can find the program to execute this way we
  499. X    * don't alloc the environment and other such stuff prior to figuring out
  500. X    * we don't know how to run the program. */
  501. find_program:
  502. X   if((program = _findexec(program, &i)) == NIL(char)) {
  503. X      errno = ENOENT;
  504. X      return( -1 );
  505. X   }
  506. X
  507. X   /* i is set to TRUE in _findexec if the exec is a shell
  508. X    * script (either .BAT or .KSH file), returns FALSE for all others. */
  509. X   if( i && !Packed_shell ) {
  510. X      /* Restore the spaces into the command line that were erased by
  511. X       * the previous call to Pack_argv.  This enables us to repack the
  512. X       * command as a shell command using Pack_argv again. */
  513. X      for( i=0; argv[i] != NIL(char); i++ ) {
  514. X         int x = strlen(argv[i]);
  515. X         if( argv[i+1] != NIL(char) ) argv[i][x] = ' ';
  516. X      }
  517. X
  518. X      argv = Pack_argv( FALSE, TRUE, *argv );
  519. X
  520. X      /* Go and find the program again, I hate goto's but it seems silly to
  521. X       * use tail recursion here just for aesthetic purity. */
  522. X      program = *argv;
  523. X      goto find_program;
  524. X   }
  525. X
  526. X   /* Compute size of *argv vector for passing as MKS style arguments */
  527. X   cmdsize = strlen(*argv)+2;
  528. X
  529. X   /* So we have decided on a program to run, therefore pack the command tail
  530. X    * and build the environment to pass to the exec code.  This loop packs the
  531. X    * DOS command tail, and computes the size of all arguments for the MKS
  532. X    * argument passing convention.  Note that we reserve one less byte in the
  533. X    * command tail if we are not using MKS style argument passing.
  534. X    *
  535. X    * Make sure the command tail contains at leat a space.  Some commands fail
  536. X    * to work if the command tail is only a \r, STUPID DOS! */
  537. X   cmdtailen = (_mks_args = ((Glob_attr & A_MKSARGS) != 0))?3:2;
  538. X   tail      = cmdtail+1;
  539. X
  540. X   if( argv[1] != NIL(char) )
  541. X      for( i=1; argv[i] != NIL(char); i++ ) {
  542. X     int arglen = strlen(argv[i]);
  543. X
  544. X     cmdsize += arglen+2;        /* Compute all args size for MKS */
  545. X
  546. X     if( (cmdtailen += arglen+1) <= 128 ) {
  547. X        register char *p = argv[i];
  548. X        tail[-1] = ' ';        /* put in the space */
  549. X        while( *tail++ = *p++ );    /* put in the arg   */
  550. X     }
  551. X     else if( !_mks_args ) {
  552. X        errno = E2BIG;        /* unless its MKS exit if arglist */
  553. X        return(-1);            /* is too long.              */
  554. X     }
  555. X      }
  556. X   else
  557. X      *tail++ = ' ';
  558. X
  559. X   /* Finish the command tail set up, placing the length in the first byte,
  560. X    * and the \r \n \0 at the end for DOS, MKS and us respectively. */
  561. X   *cmdtail = tail-cmdtail-2;
  562. X   tail[-1] = '\r';
  563. X   if( _mks_args ) *tail++ = '\n';
  564. X   *tail = '\0';
  565. X
  566. X   /* Compute size of environment, skipping any MKS arguments passed in our
  567. X    * environment */
  568. X   for(; *envp && **envp == '~'; envp++ );
  569. X   for(i=0, envsize=_mks_args?cmdsize:1; envp[i] != NIL(char); i++ )
  570. X      envsize += strlen(envp[i]) + 1;
  571. X
  572. X   /* Check the DOS version number here.  If it is < 3.0 then we don't
  573. X    * even want to think about executing the swapping code.   Permanently
  574. X    * set swap to 0. */
  575. X   doswap = (_osmajor < 3) ? 0 : Swap_on_exec;
  576. X
  577. X   /* Set up temporary file for swapping */
  578. X   swptmp = doswap?tempnam(NIL(char),"mk"):""; 
  579. X
  580. X   /* Allocate an appropriate sized environment block and align it on a
  581. X    * paragraph boundary.  It will later get copied to an appropriately low
  582. X    * place in the executable image so that when we swap out the environment
  583. X    * is still present.  Use
  584. X    *    _dos_alloc
  585. X    * to allocate the environment segment.  The segment is freed by the call
  586. X    * to exec. */
  587. X   environment = _dos_alloc( envsize = ((envsize+16)>>4) );
  588. X
  589. X   /* First copy the arguments preceeded by ~ character if we are using
  590. X    * MKS style argument passing */
  591. X   if( _mks_args )
  592. X      for(; *argv; argv++) {
  593. X         register char *p = *argv;
  594. X
  595. X     *environment++ = '~';
  596. X     while( *environment++ = *p++ );    /* Far dest, poss near ptr */
  597. X      }
  598. X
  599. X   /* Now stick in the current evironment vectors. */
  600. X   for(; *envp; envp++) {
  601. X      register char *p = *envp;
  602. X      while( *environment++ = *p++ );        /* Far dest, poss near ptr */
  603. X   }
  604. X   *environment = '\0';
  605. X
  606. X   /* Clear the interrupted flag, and exec  */
  607. X   Interrupted = 0;
  608. X   i = exec(doswap,CF(program),CF(cmdtail),FP_SEG(environment),CF(swptmp));
  609. X
  610. X   /* Now free the temporary file name */
  611. X   if( doswap ) FREE(swptmp);
  612. X
  613. X   /* If swap was interrupted then quit properly from dmake. */
  614. X   if( Interrupted ) Quit();
  615. X
  616. X   return(i);
  617. }
  618. X
  619. X
  620. PUBLIC void
  621. Hook_std_writes( file )
  622. char *file;
  623. {
  624. X   if( file!= NIL(char) ) {
  625. X      int mode = O_BINARY | O_WRONLY | O_CREAT | O_TRUNC;
  626. X      int handle;
  627. X
  628. X      if (*file == '+') {
  629. X          ++file;             /* -F +file means append to file */
  630. X          mode = O_BINARY | O_WRONLY | O_CREAT | O_APPEND;
  631. X      }
  632. X      handle = open(file, mode, S_IREAD | S_IWRITE);
  633. X      if (handle < 0) {
  634. X          Fatal( "Could not open -F file");
  635. X      }
  636. X      (void) lseek(handle, 0L, SEEK_END);
  637. X      do_hook_std_writes(handle);
  638. X   }
  639. X   else
  640. X      do_unhook_std_writes();
  641. }
  642. X
  643. X
  644. /*
  645. ** _findexec finds executables on the path.
  646. ** Note that it is pretty simple to add support for other executable types
  647. ** (shell scripts, etc.
  648. **
  649. ** This follows the command.com behavior very closely.
  650. */
  651. static char *
  652. _findexec( s, is_shell )/*
  653. ==========================
  654. X   Cloned closely from code provided by Kent Williams.  Stripped his down to
  655. X   a reduced search since dmake doesn't need to recompute the PATH vector
  656. X   each time it does the search since it cannot alter the path vector once
  657. X   it begins to make recipes.  Also modified it to use findfirst and findnext
  658. X   as provided for dirlib package that I got off the net. */
  659. char *s;
  660. int  *is_shell;
  661. {
  662. X   unsigned found_flags;
  663. X   char     **pathv = NIL(char *);
  664. X   char     *ext    = NIL(char);
  665. X   char     *buf    = NIL(char);
  666. X   char     *p[2];
  667. X   char     *dot_scr;
  668. X   char        *dot;
  669. X
  670. X   p[0] = ""; p[1] = NIL(char);
  671. X   if( strchr("./\\", *s) || s[1] == ':' )
  672. X      pathv = p;
  673. X   else if( (pathv = _getpath()) == NIL(char *) )
  674. X      return( NIL(char) );
  675. X
  676. X   /* Compute the extension we need if any. */
  677. X   if( (dot = strrchr(s,'.')) != NIL(char) &&
  678. X        dot > strrchr(s,'/') && dot > strrchr(s,'\\') )
  679. X      ext = dot+1;
  680. X
  681. X   dot_scr   = _mks_args ? dot_ksh : dot_bat;
  682. X   *is_shell = FALSE;
  683. X
  684. X   for( found_flags = 0; *pathv && !found_flags; pathv++ ) {
  685. X      DTA dta;
  686. X
  687. X      if( !ext ) {
  688. X     char *name;
  689. X     buf = Build_path( *pathv, name=_strjoin(s, ".???", -1, FALSE) );
  690. X     FREE(name);
  691. X      }
  692. X      else
  693. X     buf = Build_path( *pathv, s );
  694. X
  695. X      if( findfirst((char *)strupr(buf), &dta) != NIL(DTA) ) {
  696. X     if( !ext ) {
  697. X        char *dot;
  698. X
  699. X        /* search order is .com .exe (.ksh || .bat)
  700. X         * there has to be a '.' */
  701. X        do {
  702. X           dot = strrchr(dta.name,'.');
  703. X           if(0 == strcmp(dot,dot_com))
  704. X          found_flags |= COM;
  705. X           else if(0 == strcmp(dot,dot_exe))
  706. X          found_flags |= EXE;
  707. X           else if( 0 == strcmp(dot,dot_scr) )
  708. X          found_flags |= SCR;
  709. X        } while( found_flags != ALL && findnext(&dta) != NIL(DTA) );
  710. X
  711. X        if(found_flags & COM)      ext = dot_com;
  712. X        else if(found_flags & EXE) ext = dot_exe;
  713. X        else if(found_flags & SCR) {
  714. X           ext = dot_scr;
  715. X           *is_shell = TRUE;
  716. X        }
  717. X
  718. X        if( found_flags ) {
  719. X           char *name;
  720. X           buf = Build_path( *pathv, name=_strjoin(s,ext,-1,FALSE) );
  721. X           FREE(name);
  722. X           strupr(buf);
  723. X        }
  724. X     }
  725. X     else
  726. X        found_flags++;
  727. X      }
  728. X   }
  729. X
  730. X   return( found_flags ? buf : NIL(char) );
  731. }
  732. X
  733. X
  734. /*
  735. ** getpath turns the DOS path into a char *vector, It is gotten and
  736. ** transformed only once since dmake can't modify the value of PATH while
  737. ** it is making targets.
  738. */
  739. static char **
  740. _getpath()
  741. {
  742. X   static   char **dir = NIL(char *);
  743. X   register char *p;
  744. X
  745. X   if( !dir ) {
  746. X      register char *t;
  747. X      int           i;
  748. X      char          *semi = NIL(char);
  749. X
  750. X      if( (p = getenv("PATH")) == NIL(char) ) p = "";
  751. X      for( i=1, t=p; *t; t++ ) if( *t == ';' ) i++;
  752. X
  753. X      TALLOC(dir, i+1, char *);
  754. X      p   = _strdup(p);
  755. X
  756. X      for( i=0; p; p = semi ? (semi+1):NIL(char),i++ ){
  757. X     if( (semi = strchr(p,';')) != NIL(char) ) *semi = '\0';
  758. X     dir[i] = p;
  759. X      }
  760. X      dir[i]=NIL(char);
  761. X   }
  762. X
  763. X   return( dir );
  764. }
  765. X
  766. X
  767. static char far *
  768. _dos_alloc( size )/*
  769. ====================
  770. X   This routine allocates size paragraphs from DOS.  It changes the memory
  771. X   allocation strategy to allocate from the tail and then changes it back.
  772. X   to using first fit. */
  773. uint16 size;
  774. {
  775. X   union REGS r;
  776. X
  777. X   r.h.ah = 0x48;
  778. X   r.x.bx = size;
  779. X
  780. X   intdos( &r, &r );
  781. X   if( r.x.cflag ) No_ram();
  782. X   
  783. X   return( (char far *) MK_FP(r.x.ax, 0) );
  784. }
  785. SHAR_EOF
  786. chmod 0640 dmake/msdos/spawn.c ||
  787. echo 'restore of dmake/msdos/spawn.c failed'
  788. Wc_c="`wc -c < 'dmake/msdos/spawn.c'`"
  789. test 12759 -eq "$Wc_c" ||
  790.     echo 'dmake/msdos/spawn.c: original size 12759, current size' "$Wc_c"
  791. rm -f _shar_wnt_.tmp
  792. fi
  793. # ============= dmake/msdos/startup.h ==============
  794. if test -f 'dmake/msdos/startup.h' -a X"$1" != X"-c"; then
  795.     echo 'x - skipping dmake/msdos/startup.h (File already exists)'
  796.     rm -f _shar_wnt_.tmp
  797. else
  798. > _shar_wnt_.tmp
  799. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/startup.h' &&
  800. /* This file contains the default value of the MAKESTARTUP variable.
  801. X * You must set the quoted string below to the default path to the startup
  802. X * variable, so that it gets compiled in.  LEAVE ROOTDIR at the front of
  803. X * the path.  This allows the user to customize his environment for dmake
  804. X * by setting up a new ROOTDIR environment variable. */
  805. X
  806. "MAKESTARTUP := $(ROOTDIR)/etc/startup.mk",
  807. SHAR_EOF
  808. chmod 0640 dmake/msdos/startup.h ||
  809. echo 'restore of dmake/msdos/startup.h failed'
  810. Wc_c="`wc -c < 'dmake/msdos/startup.h'`"
  811. test 392 -eq "$Wc_c" ||
  812.     echo 'dmake/msdos/startup.h: original size 392, current size' "$Wc_c"
  813. rm -f _shar_wnt_.tmp
  814. fi
  815. # ============= dmake/msdos/stdarg.h ==============
  816. if test -f 'dmake/msdos/stdarg.h' -a X"$1" != X"-c"; then
  817.     echo 'x - skipping dmake/msdos/stdarg.h (File already exists)'
  818.     rm -f _shar_wnt_.tmp
  819. else
  820. > _shar_wnt_.tmp
  821. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/stdarg.h' &&
  822. /*
  823. X * stdarg.h
  824. X *
  825. X * defines ANSI style macros for accessing arguments of a function which takes
  826. X * a variable number of arguments
  827. X *
  828. X */
  829. X
  830. #if !defined(__STDARG)
  831. #define __STDARG
  832. X
  833. #if !defined(ZTC)
  834. #define __ss
  835. #endif
  836. X
  837. typedef char __ss *va_list;
  838. X
  839. #define va_dcl int va_alist
  840. #define va_start(ap,v)  ap = (va_list)&va_alist
  841. #define va_arg(ap,t)    ((t*)(ap += sizeof(t)))[-1]
  842. #define va_end(ap)      ap = NULL
  843. #endif
  844. SHAR_EOF
  845. chmod 0640 dmake/msdos/stdarg.h ||
  846. echo 'restore of dmake/msdos/stdarg.h failed'
  847. Wc_c="`wc -c < 'dmake/msdos/stdarg.h'`"
  848. test 417 -eq "$Wc_c" ||
  849.     echo 'dmake/msdos/stdarg.h: original size 417, current size' "$Wc_c"
  850. rm -f _shar_wnt_.tmp
  851. fi
  852. # ============= dmake/msdos/switchar.c ==============
  853. if test -f 'dmake/msdos/switchar.c' -a X"$1" != X"-c"; then
  854.     echo 'x - skipping dmake/msdos/switchar.c (File already exists)'
  855.     rm -f _shar_wnt_.tmp
  856. else
  857. > _shar_wnt_.tmp
  858. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/switchar.c' &&
  859. /*
  860. ** return switch char
  861. */
  862. #if defined(OS2) || defined(_MSC_VER)
  863. #include <stdlib.h>
  864. #endif
  865. #if !defined(OS2)
  866. #include <dos.h>
  867. #endif /* !OS2 */
  868. #include <stdio.h>
  869. #include "stdmacs.h"
  870. X
  871. getswitchar()/*
  872. ===============
  873. X   Try the environment first.  If you don't find SWITCHAR there, then use
  874. X   the DOS call.  The call is undocumented, and doesn't work for DOS versions
  875. X   4.0 and up, so the check of the environment will fix that. */
  876. {
  877. #if defined(__MSDOS__) || defined(M_I86)
  878. #if !defined(OS2)
  879. X   union REGS rg;
  880. #endif /* ! OS2 */
  881. X   static char *_env_switchar = NIL(char);
  882. X
  883. X   if( _env_switchar != NIL(char) ||
  884. X       (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
  885. X      return(*_env_switchar);
  886. X
  887. #if !defined(OS2)
  888. X   rg.h.ah = 0x37;      /* switch char request */
  889. X   rg.h.al = 0;         /* get (not set) */
  890. X
  891. X   intdos(&rg, &rg);
  892. X   return (rg.h.dl);
  893. #endif /* ! OS2 */
  894. #endif /* M_I86 */
  895. X
  896. X   return ('-');
  897. }
  898. SHAR_EOF
  899. chmod 0640 dmake/msdos/switchar.c ||
  900. echo 'restore of dmake/msdos/switchar.c failed'
  901. Wc_c="`wc -c < 'dmake/msdos/switchar.c'`"
  902. test 926 -eq "$Wc_c" ||
  903.     echo 'dmake/msdos/switchar.c: original size 926, current size' "$Wc_c"
  904. rm -f _shar_wnt_.tmp
  905. fi
  906. # ============= dmake/msdos/sysintf.h ==============
  907. if test -f 'dmake/msdos/sysintf.h' -a X"$1" != X"-c"; then
  908.     echo 'x - skipping dmake/msdos/sysintf.h (File already exists)'
  909.     rm -f _shar_wnt_.tmp
  910. else
  911. > _shar_wnt_.tmp
  912. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/sysintf.h' &&
  913. /*
  914. ** assorted bits of system interface
  915. */
  916. X
  917. #define STAT stat
  918. #define VOID_LCACHE(l,m)
  919. #define GETPID _psp
  920. X
  921. extern char * tempnam();
  922. extern char * getcwd();
  923. X
  924. /*
  925. ** standard C items
  926. */
  927. X
  928. /*
  929. ** DOS interface standard items
  930. */
  931. #define    chdir(p) _chdir(p)
  932. X
  933. /*
  934. ** make parameters
  935. */
  936. #ifdef _POSIX_NAME_MAX
  937. #undef _POSIX_NAME_MAX
  938. #endif
  939. #define _POSIX_NAME_MAX 12
  940. #define _POSIX_PATH_MAX 64
  941. #define    MAX_PATH_LEN    _POSIX_PATH_MAX
  942. SHAR_EOF
  943. chmod 0640 dmake/msdos/sysintf.h ||
  944. echo 'restore of dmake/msdos/sysintf.h failed'
  945. Wc_c="`wc -c < 'dmake/msdos/sysintf.h'`"
  946. test 420 -eq "$Wc_c" ||
  947.     echo 'dmake/msdos/sysintf.h: original size 420, current size' "$Wc_c"
  948. rm -f _shar_wnt_.tmp
  949. fi
  950. # ============= dmake/msdos/tccdos/config.h ==============
  951. if test ! -d 'dmake/msdos/tccdos'; then
  952.     mkdir 'dmake/msdos/tccdos'
  953. fi
  954. if test -f 'dmake/msdos/tccdos/config.h' -a X"$1" != X"-c"; then
  955.     echo 'x - skipping dmake/msdos/tccdos/config.h (File already exists)'
  956.     rm -f _shar_wnt_.tmp
  957. else
  958. > _shar_wnt_.tmp
  959. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/config.h' &&
  960. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/tccdos/config.h,v 1.1 1992/01/24 03:27:32 dvadura Exp $
  961. -- SYNOPSIS -- Configurarion include file.
  962. -- 
  963. -- DESCRIPTION
  964. --     There is one of these for each specific machine configuration.
  965. --    It can be used to further tweek the machine specific sources
  966. --    so that they compile.
  967. --
  968. -- AUTHOR
  969. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  970. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  971. --
  972. -- COPYRIGHT
  973. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  974. -- 
  975. --      This program is free software; you can redistribute it and/or
  976. --      modify it under the terms of the GNU General Public License
  977. --      (version 1), as published by the Free Software Foundation, and
  978. --      found in the file 'LICENSE' included with this distribution.
  979. -- 
  980. --      This program is distributed in the hope that it will be useful,
  981. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  982. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  983. --      GNU General Public License for more details.
  984. -- 
  985. --      You should have received a copy of the GNU General Public License
  986. --      along with this program;  if not, write to the Free Software
  987. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  988. --
  989. -- LOG
  990. --     $Log: config.h,v $
  991. X * Revision 1.1  1992/01/24  03:27:32  dvadura
  992. X * dmake Version 3.8, Initial revision
  993. X *
  994. */
  995. X
  996. /* define this for configurations that don't have the coreleft function
  997. X * so that the code compiles.  To my knowledge coreleft exists only on
  998. X * Turbo C, but it is needed here since the function is used in many debug
  999. X * macros. */
  1000. /*#define coreleft() 0L*/
  1001. extern unsigned int coreleft();
  1002. X
  1003. #define SIGQUIT    SIGTERM        /* turbo C doesn't understand SIGQUIT */
  1004. X
  1005. /* Turbo-C understands const declarations. */
  1006. #define CONST const
  1007. X
  1008. #ifndef MSDOS
  1009. #   define MSDOS 1
  1010. #endif
  1011. X
  1012. /* a small problem with pointer to voids on some unix machines needs this */
  1013. #define PVOID void *
  1014. SHAR_EOF
  1015. chmod 0640 dmake/msdos/tccdos/config.h ||
  1016. echo 'restore of dmake/msdos/tccdos/config.h failed'
  1017. Wc_c="`wc -c < 'dmake/msdos/tccdos/config.h'`"
  1018. test 2009 -eq "$Wc_c" ||
  1019.     echo 'dmake/msdos/tccdos/config.h: original size 2009, current size' "$Wc_c"
  1020. rm -f _shar_wnt_.tmp
  1021. fi
  1022. # ============= dmake/msdos/tccdos/config.mk ==============
  1023. if test -f 'dmake/msdos/tccdos/config.mk' -a X"$1" != X"-c"; then
  1024.     echo 'x - skipping dmake/msdos/tccdos/config.mk (File already exists)'
  1025.     rm -f _shar_wnt_.tmp
  1026. else
  1027. > _shar_wnt_.tmp
  1028. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/config.mk' &&
  1029. # This is the Turbo C 2.0 DOS configuration file for DMAKE
  1030. #    It simply modifies the values of SRC, and checks to see if
  1031. #    OSENVIRONMENT is defined.  If so it includes the appropriate
  1032. #    config.mk file.
  1033. #
  1034. # It also sets the values of .SOURCE.c and .SOURCE.h to include the local
  1035. # directory.
  1036. #
  1037. osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
  1038. X
  1039. # Definition of macros for library, and C startup code.
  1040. LDLIBS            = d:/cc/tcc/lib/c$(MODEL)
  1041. CSTARTUP    = d:/cc/tcc/lib/c0$(MODEL).obj
  1042. X
  1043. # The following sources are required for TURBO C 2.0
  1044. OSR_SRC = tempnam.c utime.c
  1045. .SETDIR=$(osrdir) : $(OSR_SRC)
  1046. X
  1047. SRC += $(OSR_SRC)
  1048. .SOURCE.h : $(osrdir)
  1049. X
  1050. # Local configuration modifications for CFLAGS.  Make sure your turboc.cfg
  1051. # file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line
  1052. # below!
  1053. #CFLAGS += -DM_I86=1 -D__STDC__=1
  1054. X
  1055. # You can get a smaller executable still, buy adding a -1 to the list of
  1056. # flags below, but then you can't run this on an 8086/88 cpu.
  1057. #CFLAGS += -1
  1058. CFLAGS  += -I$(osrdir) -f- -d -O -N- -w-nod $(C_$(MODEL))
  1059. ASFLAGS += -t -mx $(S_$(MODEL))
  1060. X
  1061. # Debugging information for Turbo-C
  1062. DB_CFLAGS  += -v
  1063. DB_LDFLAGS += /v
  1064. X
  1065. # See if we modify anything in the lower levels.
  1066. .IF $(OSENVIRONMENT) != $(NULL)
  1067. X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
  1068. .END
  1069. X
  1070. C_s =
  1071. C_m = -mm
  1072. C_c = -mc
  1073. C_l = -ml
  1074. X
  1075. S_s = -dmsmall
  1076. S_m = -dmmedium
  1077. S_c = -dmcompact
  1078. S_l = -dmlarge
  1079. SHAR_EOF
  1080. chmod 0640 dmake/msdos/tccdos/config.mk ||
  1081. echo 'restore of dmake/msdos/tccdos/config.mk failed'
  1082. Wc_c="`wc -c < 'dmake/msdos/tccdos/config.mk'`"
  1083. test 1400 -eq "$Wc_c" ||
  1084.     echo 'dmake/msdos/tccdos/config.mk: original size 1400, current size' "$Wc_c"
  1085. rm -f _shar_wnt_.tmp
  1086. fi
  1087. # ============= dmake/msdos/tccdos/lib.rsp ==============
  1088. if test -f 'dmake/msdos/tccdos/lib.rsp' -a X"$1" != X"-c"; then
  1089.     echo 'x - skipping dmake/msdos/tccdos/lib.rsp (File already exists)'
  1090.     rm -f _shar_wnt_.tmp
  1091. else
  1092. > _shar_wnt_.tmp
  1093. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/lib.rsp' &&
  1094. d:\cc\tcc\lib\cl
  1095. SHAR_EOF
  1096. chmod 0640 dmake/msdos/tccdos/lib.rsp ||
  1097. echo 'restore of dmake/msdos/tccdos/lib.rsp failed'
  1098. Wc_c="`wc -c < 'dmake/msdos/tccdos/lib.rsp'`"
  1099. test 17 -eq "$Wc_c" ||
  1100.     echo 'dmake/msdos/tccdos/lib.rsp: original size 17, current size' "$Wc_c"
  1101. rm -f _shar_wnt_.tmp
  1102. fi
  1103. # ============= dmake/msdos/tccdos/libswp.rsp ==============
  1104. if test -f 'dmake/msdos/tccdos/libswp.rsp' -a X"$1" != X"-c"; then
  1105.     echo 'x - skipping dmake/msdos/tccdos/libswp.rsp (File already exists)'
  1106.     rm -f _shar_wnt_.tmp
  1107. else
  1108. > _shar_wnt_.tmp
  1109. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/libswp.rsp' &&
  1110. d:\cc\tcc\lib\cl
  1111. SHAR_EOF
  1112. chmod 0640 dmake/msdos/tccdos/libswp.rsp ||
  1113. echo 'restore of dmake/msdos/tccdos/libswp.rsp failed'
  1114. Wc_c="`wc -c < 'dmake/msdos/tccdos/libswp.rsp'`"
  1115. test 17 -eq "$Wc_c" ||
  1116.     echo 'dmake/msdos/tccdos/libswp.rsp: original size 17, current size' "$Wc_c"
  1117. rm -f _shar_wnt_.tmp
  1118. fi
  1119. # ============= dmake/msdos/tccdos/mk.bat ==============
  1120. if test -f 'dmake/msdos/tccdos/mk.bat' -a X"$1" != X"-c"; then
  1121.     echo 'x - skipping dmake/msdos/tccdos/mk.bat (File already exists)'
  1122.     rm -f _shar_wnt_.tmp
  1123. else
  1124. > _shar_wnt_.tmp
  1125. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/mk.bat' &&
  1126. md objects
  1127. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  infer.c
  1128. copy infer.obj objects
  1129. del infer.obj
  1130. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  make.c
  1131. copy make.obj objects
  1132. del make.obj
  1133. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  stat.c
  1134. copy stat.obj objects
  1135. del stat.obj
  1136. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  expand.c
  1137. copy expand.obj objects
  1138. del expand.obj
  1139. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmstring.c
  1140. copy dmstring.obj objects
  1141. del dmstring.obj
  1142. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  hash.c
  1143. copy hash.obj objects
  1144. del hash.obj
  1145. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dag.c
  1146. copy dag.obj objects
  1147. del dag.obj
  1148. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmake.c
  1149. copy dmake.obj objects
  1150. del dmake.obj
  1151. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  path.c
  1152. copy path.obj objects
  1153. del path.obj
  1154. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  imacs.c
  1155. copy imacs.obj objects
  1156. del imacs.obj
  1157. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  sysintf.c
  1158. copy sysintf.obj objects
  1159. del sysintf.obj
  1160. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  parse.c
  1161. copy parse.obj objects
  1162. del parse.obj
  1163. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  getinp.c
  1164. copy getinp.obj objects
  1165. del getinp.obj
  1166. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  quit.c
  1167. copy quit.obj objects
  1168. del quit.obj
  1169. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  state.c
  1170. copy state.obj objects
  1171. del state.obj
  1172. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  basename.c
  1173. copy basename.obj objects
  1174. del basename.obj
  1175. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmdump.c
  1176. copy dmdump.obj objects
  1177. del dmdump.obj
  1178. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  macparse.c
  1179. copy macparse.obj objects
  1180. del macparse.obj
  1181. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  rulparse.c
  1182. copy rulparse.obj objects
  1183. del rulparse.obj
  1184. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  percent.c
  1185. copy percent.obj objects
  1186. del percent.obj
  1187. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  function.c
  1188. copy function.obj objects
  1189. del function.obj
  1190. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\ruletab.c
  1191. copy ruletab.obj objects
  1192. del ruletab.obj
  1193. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\dirbrk.c
  1194. copy dirbrk.obj objects
  1195. del dirbrk.obj
  1196. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\runargv.c
  1197. copy runargv.obj objects
  1198. del runargv.obj
  1199. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\arlib.c
  1200. copy arlib.obj objects
  1201. del arlib.obj
  1202. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\_chdir.c
  1203. copy _chdir.obj objects
  1204. del _chdir.obj
  1205. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\switchar.c
  1206. copy switchar.obj objects
  1207. del switchar.obj
  1208. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\rmprq.c
  1209. copy rmprq.obj objects
  1210. del rmprq.obj
  1211. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tee.c
  1212. copy tee.obj objects
  1213. del tee.obj
  1214. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\tempnam.c
  1215. copy tempnam.obj objects
  1216. del tempnam.obj
  1217. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\utime.c
  1218. copy utime.obj objects
  1219. del utime.obj
  1220. copy msdos\tccdos\startup.mk startup.mk
  1221. tlink  @msdos\tccdos\obj.rsp,dmake.exe,NUL.MAP,@msdos\tccdos\lib.rsp
  1222. SHAR_EOF
  1223. chmod 0640 dmake/msdos/tccdos/mk.bat ||
  1224. echo 'restore of dmake/msdos/tccdos/mk.bat failed'
  1225. Wc_c="`wc -c < 'dmake/msdos/tccdos/mk.bat'`"
  1226. test 3521 -eq "$Wc_c" ||
  1227.     echo 'dmake/msdos/tccdos/mk.bat: original size 3521, current size' "$Wc_c"
  1228. rm -f _shar_wnt_.tmp
  1229. fi
  1230. # ============= dmake/msdos/tccdos/mkswp.bat ==============
  1231. if test -f 'dmake/msdos/tccdos/mkswp.bat' -a X"$1" != X"-c"; then
  1232.     echo 'x - skipping dmake/msdos/tccdos/mkswp.bat (File already exists)'
  1233.     rm -f _shar_wnt_.tmp
  1234. else
  1235. > _shar_wnt_.tmp
  1236. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/mkswp.bat' &&
  1237. md objects
  1238. tasm -t -mx -dmlarge msdos\exec.asm;
  1239. mv exec.obj objects
  1240. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  infer.c
  1241. copy infer.obj objects
  1242. del infer.obj
  1243. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  make.c
  1244. copy make.obj objects
  1245. del make.obj
  1246. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  stat.c
  1247. copy stat.obj objects
  1248. del stat.obj
  1249. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  expand.c
  1250. copy expand.obj objects
  1251. del expand.obj
  1252. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmstring.c
  1253. copy dmstring.obj objects
  1254. del dmstring.obj
  1255. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  hash.c
  1256. copy hash.obj objects
  1257. del hash.obj
  1258. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dag.c
  1259. copy dag.obj objects
  1260. del dag.obj
  1261. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmake.c
  1262. copy dmake.obj objects
  1263. del dmake.obj
  1264. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  path.c
  1265. copy path.obj objects
  1266. del path.obj
  1267. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  imacs.c
  1268. copy imacs.obj objects
  1269. del imacs.obj
  1270. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  sysintf.c
  1271. copy sysintf.obj objects
  1272. del sysintf.obj
  1273. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  parse.c
  1274. copy parse.obj objects
  1275. del parse.obj
  1276. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  getinp.c
  1277. copy getinp.obj objects
  1278. del getinp.obj
  1279. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  quit.c
  1280. copy quit.obj objects
  1281. del quit.obj
  1282. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  state.c
  1283. copy state.obj objects
  1284. del state.obj
  1285. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  basename.c
  1286. copy basename.obj objects
  1287. del basename.obj
  1288. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmdump.c
  1289. copy dmdump.obj objects
  1290. del dmdump.obj
  1291. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  macparse.c
  1292. copy macparse.obj objects
  1293. del macparse.obj
  1294. SHAR_EOF
  1295. true || echo 'restore of dmake/msdos/tccdos/mkswp.bat failed'
  1296. fi
  1297. echo 'End of part 25, continue with part 26'
  1298. echo 26 > _shar_seq_.tmp
  1299. exit 0
  1300. exit 0 # Just in case...
  1301.