home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume15 / dmake-3.6 / part08 < prev    next >
Text File  |  1990-10-14  |  41KB  |  1,362 lines

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