home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume15 / dmake-3.6 / patch02 < prev    next >
Text File  |  1990-12-16  |  40KB  |  1,210 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: dvadura@watdragon.waterloo.edu
  3. subject: v15i091: dmake version 3.6 patch 1 (part 02/5)
  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 91
  8. Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  9. Archive-name: dmake-3.6/patch02
  10.  
  11. #!/bin/sh
  12. # this is part 2 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file dm36.p1 continued
  15. #
  16. CurArch=2
  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. sed 's/^X//' << 'SHAR_EOF' >> dm36.p1
  27. XX{
  28. XX   struct ar_hdr arhdr;                /* external archive header */
  29. XX
  30. XX   fseek(f, - (off_t) (sizeof(arhdr) - sizeof(arhdr.ar_name)), 1);
  31. XX
  32. XX#if ASCARCH
  33. XX   fprintf(f, "%lu", now);
  34. XX#else
  35. XX   fwrite((char *)now, sizeof(now), 1, f);
  36. XX#endif
  37. XX
  38. XX   return( ferror(f) ? 0 : 1 );
  39. XX}
  40. XX
  41. XX
  42. XX#if LC
  43. XXtypedef struct mem {
  44. XX   time_t    m_time;        /* modify time of member*/
  45. XX   struct mem    *m_next;    /* next member in lib    */
  46. XX   char        m_valid;    /* valid cache entry    */
  47. XX   char     m_name[1];    /* lib member name    */
  48. XX} MEM, *MEMPTR;
  49. XX
  50. XXtypedef struct lib {
  51. XX   struct lib    *lb_next;    /* next library in list */
  52. XX   struct mem    *lb_members;    /* list of lib members    */
  53. XX   char        lb_valid;    /* valid cache entry    */
  54. XX   char     *lb_name;    /* library name        */
  55. XX} LIB, *LIBPTR;
  56. XX
  57. XXstatic LIBPTR _cache = NIL(LIB);
  58. XXstatic MEMPTR _find_member ANSI(( LIBPTR, char * ));
  59. XX
  60. XXstatic int
  61. XX_check_cache( name, lib, pmtime, touch )/*
  62. XX==========================================
  63. XX   Check to see if we have cached member in lib, if so return time in pmtime
  64. XX   and return TRUE, otherwise return FALSE, if touch is TRUE then touch
  65. XX   the archive member instead. */
  66. XXchar   *name;
  67. XXchar   *lib;
  68. XXtime_t *pmtime;
  69. XXint    touch;
  70. XX{
  71. XX   register MEMPTR mp;
  72. XX   register LIBPTR lp;
  73. XX
  74. XX   for( lp=_cache; lp != NIL(LIB) && lp->lb_name != lib; lp=lp->lb_next );
  75. XX   if( lp == NIL(LIB) ) return( FALSE );
  76. XX
  77. XX   mp = _find_member( lp, name );
  78. XX   if( mp == NIL(MEM) || !mp->m_valid ) return( FALSE );
  79. XX
  80. XX   if( touch == TRUE )
  81. XX   {
  82. XX      mp->m_time = *pmtime;
  83. XX      mp->m_valid = 1;
  84. XX   }
  85. XX   else
  86. XX      *pmtime = mp->m_time;
  87. XX
  88. XX   lp->lb_valid   = 1;
  89. XX   lp->lb_members = mp;
  90. XX
  91. XX   return( TRUE );
  92. XX}
  93. XX
  94. XX
  95. XX
  96. XXstatic int
  97. XX_cache_member( name, lib, mtime )/*
  98. XX===================================
  99. XX   Cache name in lib along with it's time */
  100. XXchar   *name;
  101. XXchar   *lib;
  102. XXtime_t mtime;
  103. XX{
  104. XX   register MEMPTR mp;
  105. XX   register LIBPTR lp;
  106. XX
  107. XX   for( lp=_cache;
  108. XX    lp != NIL(LIB) && lp->lb_name != NIL(char) && lp->lb_name != lib;
  109. XX    lp=lp->lb_next);
  110. XX
  111. XX   if( lp == NIL(LIB) )
  112. XX   {
  113. XX      lp = (LIBPTR) malloc(sizeof(LIB));
  114. XX      if( lp == NIL(LIB) ) No_ram();
  115. XX
  116. XX      lp->lb_name    = lib;
  117. XX      lp->lb_members = NIL(MEM);
  118. XX      lp->lb_next    = _cache;
  119. XX      lp->lb_valid   = 0;
  120. XX      _cache = lp;
  121. XX   }
  122. XX
  123. XX   /* On UNIX ar does not allow multiple copies of the same .o file to live
  124. XX    * in the same AR file.  If this is not TRUE then use the commented out
  125. XX    * version to set the value of mp. */
  126. XX
  127. XX   /*mp = _find_member(lp, name);*/
  128. XX   mp = NIL(MEM);
  129. XX
  130. XX   if( mp == NIL(MEM) )
  131. XX   {
  132. XX      mp = (MEMPTR) malloc(sizeof(char)*offsetof(MEM,m_name[strlen(name)+1]));
  133. XX      if( mp == NIL(MEM) ) No_ram();
  134. XX
  135. XX      strcpy( mp->m_name, name );
  136. XX      mp->m_time     = mtime;
  137. XX
  138. XX      if( lp->lb_members == NIL(MEM) ) {
  139. XX     mp->m_next     = mp;
  140. XX     lp->lb_members = mp;
  141. XX      }
  142. XX      else {
  143. XX     mp->m_next = lp->lb_members->m_next;
  144. XX     lp->lb_members->m_next = mp;
  145. XX     lp->lb_members = mp;
  146. XX      }
  147. XX   }
  148. XX   else
  149. XX      mp->m_time = mtime;
  150. XX
  151. XX   mp->m_valid = 1;
  152. XX
  153. XX   return( lp->lb_valid );
  154. XX}
  155. XX
  156. XX
  157. XXstatic MEMPTR
  158. XX_find_member( lp, name )
  159. XXLIBPTR lp;
  160. XXchar   *name;
  161. XX{
  162. XX   register MEMPTR mp = lp->lb_members;
  163. XX
  164. XX   if( mp == NIL(MEM) ) return(mp);
  165. XX
  166. XX   do {
  167. XX      if( !strcmp(mp->m_name, name ) ) return( mp );
  168. XX      mp = mp->m_next;
  169. XX   }
  170. XX   while( mp != lp->lb_members );
  171. XX
  172. XX   return( NIL(MEM) );
  173. XX}
  174. XX#endif
  175. XX
  176. XX
  177. XX
  178. XXvoid
  179. XXvoid_lcache( lib, member )/*
  180. XX============================
  181. XX   Void the library cache for lib.  If member is NIL(char) then nuke all
  182. XX   of the members, if member is NOT NIL(char) then invalidate only that
  183. XX   member. */
  184. XXchar *lib;
  185. XXchar *member;
  186. XX{
  187. XX#if LC
  188. XX   register LIBPTR lp;
  189. XX   register MEMPTR mp;
  190. XX   register MEMPTR tmp;
  191. XX
  192. XX   for( lp=_cache; lp != NIL(LIB) && lp->lb_name != lib; lp=lp->lb_next );
  193. XX   if( lp == NIL(LIB) ) return;
  194. XX
  195. XX   if( member == NIL(char) ) {
  196. XX      mp = lp->lb_members;
  197. XX      do {
  198. XX     tmp = mp->m_next;
  199. XX     (void) free( mp );
  200. XX     mp = tmp;
  201. XX      } while( mp != lp->lb_members );
  202. XX
  203. XX      lp->lb_valid   = 0;
  204. XX      lp->lb_members = NIL(MEM);
  205. XX      lp->lb_name    = NIL(char);
  206. XX   }
  207. XX   else {
  208. XX      mp=lp->lb_members;
  209. XX      do {
  210. XX     if( strcmp( member, mp->m_name) == 0 ) {
  211. XX        lp->lb_members = mp->m_next;
  212. XX        mp->m_valid = 0;
  213. XX     }
  214. XX       
  215. XX     mp=mp->m_next;
  216. XX      } while( mp != lp->lb_members );
  217. XX   }
  218. XX#endif
  219. XX}
  220. XSHAR_EOF
  221. Xchmod 0640 tos/arlib.c || echo "restore of tos/arlib.c fails"
  222. Xset `wc -c tos/arlib.c`;Sum=$1
  223. Xif test "$Sum" != "13301"
  224. Xthen echo original size 13301, current size $Sum;fi
  225. Xsed 's/^X//' << 'SHAR_EOF' > tos/config.h &&
  226. XX/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/sysvr3/RCS/config.h,v 1.1 90/10/06 12:06:39 dvadura Exp $
  227. XX-- SYNOPSIS -- Configurarion include file.
  228. XX-- 
  229. XX-- DESCRIPTION
  230. XX--     There is one of these for each specific machine configuration.
  231. XX--    It can be used to further tweek the machine specific sources
  232. XX--    so that they compile.
  233. XX--
  234. XX-- AUTHOR
  235. XX--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  236. XX--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  237. XX--
  238. XX-- COPYRIGHT
  239. XX--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  240. XX-- 
  241. XX--      This program is free software; you can redistribute it and/or
  242. XX--      modify it under the terms of the GNU General Public License
  243. XX--      (version 1), as published by the Free Software Foundation, and
  244. XX--      found in the file 'LICENSE' included with this distribution.
  245. XX-- 
  246. XX--      This program is distributed in the hope that it will be useful,
  247. XX--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  248. XX--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  249. XX--      GNU General Public License for more details.
  250. XX-- 
  251. XX--      You should have received a copy of the GNU General Public License
  252. XX--      along with this program;  if not, write to the Free Software
  253. XX--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  254. XX--
  255. XX-- LOG
  256. XX--     $Log:    config.h,v $
  257. XX * Revision 1.1  90/10/06  12:06:39  dvadura
  258. XX * dmake Release, Version 3.6
  259. XX * 
  260. XX*/
  261. XX
  262. XX#include <osbind.h>
  263. XX
  264. XX/* define this for configurations that don't have the coreleft function
  265. XX * so that the code compiles.  To my knowledge coreleft exists only on
  266. XX * Turbo C, but it is needed here since the function is used in many debug
  267. XX * macros. */
  268. XX#define coreleft() Malloc(-1L)
  269. XX
  270. XX/* Define the getcwd function that is used in the code, since BSD does
  271. XX * not have getcwd, but call it getwd instead. */
  272. XXextern char *getcwd ANSI((char *, int));
  273. XX
  274. XX/*No parallelism in TOS so don't need to explode the graph. */
  275. XX#define Explode_prq(a,b,c)
  276. XSHAR_EOF
  277. Xchmod 0640 tos/config.h || echo "restore of tos/config.h fails"
  278. Xset `wc -c tos/config.h`;Sum=$1
  279. Xif test "$Sum" != "1974"
  280. Xthen echo original size 1974, current size $Sum;fi
  281. Xsed 's/^X//' << 'SHAR_EOF' > tos/config.mk &&
  282. XX# This is an OS specific configuration file
  283. XX#    It assumes that OBJDIR, TARGET and DEBUG are previously defined.
  284. XX#    It defines    CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
  285. XX#            PRINTER, PRINTFLAGS
  286. XX#    It augments    SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
  287. XX#
  288. XXPRINTER        = hw
  289. XXPRINTFLAGS    = -P$(PRINTER)
  290. XXSTARTUPFILE    = $(OS)/startup.mk
  291. XXCPPFLAGS     = $(CFLAGS)
  292. XXLDOBJS        = $(CSTARTUP) $(OBJDIR)/{$(<:f)}
  293. XXLDARGS        = $(LDFLAGS) -o $@ $(OBJDIR)/*$O
  294. XXLDFLAGS           += -s
  295. XXLD        = $(CC)
  296. XX
  297. XX# Debug flags
  298. XXDB_CFLAGS    = -g -DDBUG
  299. XXDB_LDFLAGS    = -g
  300. XXDB_LDLIBS    =
  301. XX
  302. XX# NO Debug flags
  303. XXNDB_CFLAGS    = -O
  304. XXNDB_LDFLAGS    =
  305. XXNDB_LDLIBS    =
  306. XX
  307. XX# Local configuration modifications for CFLAGS.
  308. XXCFLAGS         += -I$(OS)
  309. XX
  310. XX# Sources that must be defined for each different version
  311. XXOSSRC := arlib.c dirbrk.c rmprq.c ruletab.c runargv.c
  312. XXSRC  += $(OSSRC)
  313. XX.SETDIR=$(OS) : $(OSSRC)
  314. XX
  315. XX# Set source dirs so that we can find files named in this
  316. XX# config file.
  317. XX.SOURCE.h : $(OS)
  318. XX
  319. XX# See if we modify anything in the lower levels.
  320. XX.IF $(OSRELEASE) != $(NULL)
  321. XX   .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
  322. XX.END
  323. XX
  324. XX# Set the proper macros based on whether we are making the debugging version
  325. XX# or not.
  326. XX.IF $(DEBUG)
  327. XX   CFLAGS    += $(DB_CFLAGS)
  328. XX   LDFLAGS    += $(DB_LDFLAGS)
  329. XX   LDLIBS    += $(DB_LDLIBS)
  330. XX
  331. XX   SILENT    := $(.SILENT)
  332. XX   .SILENT    := yes
  333. XX   TARGET    := db$(TARGET)
  334. XX   OBJDIR    := $(OBJDIR).dbg
  335. XX   .SILENT    := $(SILENT)
  336. XX
  337. XX    SRC        += dbug.c malloc.c
  338. XX    HDR        += db.h 
  339. XX    .SETDIR=common : dbug.c malloc.c
  340. XX.ELSE
  341. XX   CFLAGS    += $(NDB_CFLAGS)
  342. XX   LDFLAGS    += $(NDB_LDFLAGS)
  343. XX   LDLIBS    += $(NDB_LDLIBS)
  344. XX.END
  345. XSHAR_EOF
  346. Xchmod 0640 tos/config.mk || echo "restore of tos/config.mk fails"
  347. Xset `wc -c tos/config.mk`;Sum=$1
  348. Xif test "$Sum" != "1536"
  349. Xthen echo original size 1536, current size $Sum;fi
  350. Xsed 's/^X//' << 'SHAR_EOF' > tos/dirbrk.c &&
  351. XX/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/dirbrk.c,v 1.1 90/10/06 12:07:00 dvadura Exp $
  352. XX-- SYNOPSIS -- define the directory separator string.
  353. XX-- 
  354. XX-- DESCRIPTION
  355. XX--     Define this string for any character that may appear in a path name
  356. XX--    and can be used as a directory separator.  Also provide a function
  357. XX--    to indicate if a given path begins at the root of the file system.
  358. XX--
  359. XX-- AUTHOR
  360. XX--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  361. XX--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  362. XX--
  363. XX-- COPYRIGHT
  364. XX--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  365. XX-- 
  366. XX--      This program is free software; you can redistribute it and/or
  367. XX--      modify it under the terms of the GNU General Public License
  368. XX--      (version 1), as published by the Free Software Foundation, and
  369. XX--      found in the file 'LICENSE' included with this distribution.
  370. XX-- 
  371. XX--      This program is distributed in the hope that it will be useful,
  372. XX--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  373. XX--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  374. XX--      GNU General Public License for more details.
  375. XX-- 
  376. XX--      You should have received a copy of the GNU General Public License
  377. XX--      along with this program;  if not, write to the Free Software
  378. XX--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  379. XX--
  380. XX-- LOG
  381. XX--     $Log:    dirbrk.c,v $
  382. XX * Revision 1.1  90/10/06  12:07:00  dvadura
  383. XX * dmake Release, Version 3.6
  384. XX * 
  385. XX*/
  386. XX
  387. XX#include "extern.h"
  388. XX#include <ctype.h>
  389. XX
  390. XX/* tos uses /, \, and : */
  391. XXchar*    DirBrkStr = "/\\:";
  392. XX
  393. XX/*
  394. XX** Return TRUE if the name is the full specification of a path name to a file
  395. XX** starting at the root of the file system, otherwise return FALSE
  396. XX*/
  397. XXint
  398. XXIf_root_path(name)
  399. XXchar *name;
  400. XX{
  401. XX   return( (strchr(DirBrkStr, *name) != NIL(char)) ||
  402. XX           (isalpha(*name) && name[1] == ':') );
  403. XX}
  404. XSHAR_EOF
  405. Xchmod 0640 tos/dirbrk.c || echo "restore of tos/dirbrk.c fails"
  406. Xset `wc -c tos/dirbrk.c`;Sum=$1
  407. Xif test "$Sum" != "1883"
  408. Xthen echo original size 1883, current size $Sum;fi
  409. Xsed 's/^X//' << 'SHAR_EOF' > tos/make.sh &&
  410. XXmkdir objects
  411. XXgcc -c -DHELP -I. -Icommon -Itos -O infer.c
  412. XXmv infer.o objects
  413. XXgcc -c -DHELP -I. -Icommon -Itos -O make.c
  414. XXmv make.o objects
  415. XXgcc -c -DHELP -I. -Icommon -Itos -O stat.c
  416. XXmv stat.o objects
  417. XXgcc -c -DHELP -I. -Icommon -Itos -O expand.c
  418. XXmv expand.o objects
  419. XXgcc -c -DHELP -I. -Icommon -Itos -O string.c
  420. XXmv string.o objects
  421. XXgcc -c -DHELP -I. -Icommon -Itos -O hash.c
  422. XXmv hash.o objects
  423. XXgcc -c -DHELP -I. -Icommon -Itos -O dag.c
  424. XXmv dag.o objects
  425. XXgcc -c -DHELP -I. -Icommon -Itos -O dmake.c
  426. XXmv dmake.o objects
  427. XXgcc -c -DHELP -I. -Icommon -Itos -O path.c
  428. XXmv path.o objects
  429. XXgcc -c -DHELP -I. -Icommon -Itos -O imacs.c
  430. XXmv imacs.o objects
  431. XXgcc -c -DHELP -I. -Icommon -Itos -O sysintf.c
  432. XXmv sysintf.o objects
  433. XXgcc -c -DHELP -I. -Icommon -Itos -O parse.c
  434. XXmv parse.o objects
  435. XXgcc -c -DHELP -I. -Icommon -Itos -O getinp.c
  436. XXmv getinp.o objects
  437. XXgcc -c -DHELP -I. -Icommon -Itos -O quit.c
  438. XXmv quit.o objects
  439. XXgcc -c -DHELP -I. -Icommon -Itos -O basename.c
  440. XXmv basename.o objects
  441. XXgcc -c -DHELP -I. -Icommon -Itos -O dump.c
  442. XXmv dump.o objects
  443. XXgcc -c -DHELP -I. -Icommon -Itos -O macparse.c
  444. XXmv macparse.o objects
  445. XXgcc -c -DHELP -I. -Icommon -Itos -O rulparse.c
  446. XXmv rulparse.o objects
  447. XXgcc -c -DHELP -I. -Icommon -Itos -O percent.c
  448. XXmv percent.o objects
  449. XXgcc -c -DHELP -I. -Icommon -Itos -O function.c
  450. XXmv function.o objects
  451. XXgcc -c -DHELP -I. -Icommon -Itos -O tos/arlib.c
  452. XXmv arlib.o objects
  453. XXgcc -c -DHELP -I. -Icommon -Itos -O tos/dirbrk.c
  454. XXmv dirbrk.o objects
  455. XXgcc -c -DHELP -I. -Icommon -Itos -O tos/rmprq.c
  456. XXmv rmprq.o objects
  457. XXgcc -c -DHELP -I. -Icommon -Itos -O tos/ruletab.c
  458. XXmv ruletab.o objects
  459. XXgcc -c -DHELP -I. -Icommon -Itos -O tos/runargv.c
  460. XXmv runargv.o objects
  461. XXgcc -s  -o dmake objects/*.o
  462. XSHAR_EOF
  463. Xchmod 0640 tos/make.sh || echo "restore of tos/make.sh fails"
  464. Xset `wc -c tos/make.sh`;Sum=$1
  465. Xif test "$Sum" != "1670"
  466. Xthen echo original size 1670, current size $Sum;fi
  467. Xsed 's/^X//' << 'SHAR_EOF' > tos/rmprq.c &&
  468. XX/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/rmprq.c,v 1.1 90/10/06 12:07:06 dvadura Exp $
  469. XX-- SYNOPSIS -- remove prerequisites code.
  470. XX-- 
  471. XX-- DESCRIPTION
  472. XX--    This code is different for DOS and for UNIX and parallel make
  473. XX--    architectures since the parallel case requires the rm's to be
  474. XX--    run in parallel, whereas DOS guarantees to run them sequentially.
  475. XX-- 
  476. XX-- AUTHOR
  477. XX--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  478. XX--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  479. XX--
  480. XX-- COPYRIGHT
  481. XX--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  482. XX-- 
  483. XX--      This program is free software; you can redistribute it and/or
  484. XX--      modify it under the terms of the GNU General Public License
  485. XX--      (version 1), as published by the Free Software Foundation, and
  486. XX--      found in the file 'LICENSE' included with this distribution.
  487. XX-- 
  488. XX--      This program is distributed in the hope that it will be useful,
  489. XX--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  490. XX--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  491. XX--      GNU General Public License for more details.
  492. XX-- 
  493. XX--      You should have received a copy of the GNU General Public License
  494. XX--      along with this program;  if not, write to the Free Software
  495. XX--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  496. XX--
  497. XX-- LOG
  498. XX--     $Log:    rmprq.c,v $
  499. XX * Revision 1.1  90/10/06  12:07:06  dvadura
  500. XX * dmake Release, Version 3.6
  501. XX * 
  502. XX*/
  503. XX
  504. XX#include "extern.h"
  505. XX#include "alloc.h"
  506. XX
  507. XXvoid
  508. XXRemove_prq( tcp )
  509. XXCELLPTR tcp;
  510. XX{
  511. XX   tcp->ce_flag         &= ~(F_MADE|F_VISITED);
  512. XX   tcp->CE_HOW->hw_flag &= ~(F_MADE|F_VISITED);
  513. XX   tcp->ce_time          = 0L;
  514. XX
  515. XX   Make( tcp, tcp->CE_HOW, NIL(CELL) );
  516. XX}
  517. XSHAR_EOF
  518. Xchmod 0640 tos/rmprq.c || echo "restore of tos/rmprq.c fails"
  519. Xset `wc -c tos/rmprq.c`;Sum=$1
  520. Xif test "$Sum" != "1718"
  521. Xthen echo original size 1718, current size $Sum;fi
  522. Xsed 's/^X//' << 'SHAR_EOF' > tos/ruletab.c &&
  523. XX/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/unix/RCS/ruletab.c,v 1.1 90/10/06 12:07:08 dvadura Exp $
  524. XX-- SYNOPSIS -- Default initial configuration of dmake.
  525. XX-- 
  526. XX-- DESCRIPTION
  527. XX--     Define here the initial set of rules that are defined before
  528. XX--    dmake performs any processing.
  529. XX--
  530. XX-- AUTHOR
  531. XX--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  532. XX--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  533. XX--
  534. XX-- COPYRIGHT
  535. XX--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  536. XX-- 
  537. XX--      This program is free software; you can redistribute it and/or
  538. XX--      modify it under the terms of the GNU General Public License
  539. XX--      (version 1), as published by the Free Software Foundation, and
  540. XX--      found in the file 'LICENSE' included with this distribution.
  541. XX-- 
  542. XX--      This program is distributed in the hope that it will be useful,
  543. XX--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  544. XX--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  545. XX--      GNU General Public License for more details.
  546. XX-- 
  547. XX--      You should have received a copy of the GNU General Public License
  548. XX--      along with this program;  if not, write to the Free Software
  549. XX--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  550. XX--
  551. XX-- LOG
  552. XX--     $Log:    ruletab.c,v $
  553. XX * Revision 1.1  90/10/06  12:07:08  dvadura
  554. XX * dmake Release, Version 3.6
  555. XX * 
  556. XX*/
  557. XX
  558. XX/* These are control macros for dmake that MUST be defined at some point
  559. XX * if they are NOT dmake will not work!  These are default definitions.  They
  560. XX * may be overridden inside the .STARTUP makefile, they are here
  561. XX * strictly so that dmake can parse the STARTUP makefile */
  562. XX
  563. XXstatic char *_rules[] = {
  564. XX    "MAXPROCESSLIMIT := 10",
  565. XX    "MAXLINELENGTH := 8190",
  566. XX    ".IMPORT .IGNORE: ROOTDIR",
  567. XX    ".MAKEFILES : makefile.mk Makefile makefile",
  568. XX    ".SOURCE    : .NULL",
  569. XX#include "startup.h"
  570. XX    0 };
  571. XX
  572. XXchar **Rule_tab = _rules; /* for sundry reasons in Get_environment() */
  573. XSHAR_EOF
  574. Xchmod 0640 tos/ruletab.c || echo "restore of tos/ruletab.c fails"
  575. Xset `wc -c tos/ruletab.c`;Sum=$1
  576. Xif test "$Sum" != "1940"
  577. Xthen echo original size 1940, current size $Sum;fi
  578. Xsed 's/^X//' << 'SHAR_EOF' > tos/runargv.c &&
  579. XX/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/RCS/runargv.c,v 1.1 90/10/06 12:05:30 dvadura Exp $
  580. XX-- SYNOPSIS -- run a sub process.
  581. XX-- 
  582. XX-- DESCRIPTION
  583. XX--    Use spawn to run a subprocess.
  584. XX--
  585. XX-- AUTHOR
  586. XX--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  587. XX--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  588. XX--
  589. XX-- COPYRIGHT
  590. XX--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  591. XX-- 
  592. XX--      This program is free software; you can redistribute it and/or
  593. XX--      modify it under the terms of the GNU General Public License
  594. XX--      (version 1), as published by the Free Software Foundation, and
  595. XX--      found in the file 'LICENSE' included with this distribution.
  596. XX-- 
  597. XX--      This program is distributed in the hope that it will be useful,
  598. XX--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  599. XX--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  600. XX--      GNU General Public License for more details.
  601. XX-- 
  602. XX--      You should have received a copy of the GNU General Public License
  603. XX--      along with this program;  if not, write to the Free Software
  604. XX--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  605. XX--
  606. XX-- LOG
  607. XX--     $Log:    runargv.c,v $
  608. XX * Revision 1.1  90/10/06  12:05:30  dvadura
  609. XX * dmake Release, Version 3.6
  610. XX * 
  611. XX*/
  612. XX
  613. XX#include "sysintf.h"
  614. XX#include "extern.h"
  615. XX#include <process.h>
  616. XX#include <string.h>
  617. XX#include <errno.h>
  618. XX
  619. XXstatic int  _abort_flg = FALSE;
  620. XXstatic void _add_child ANSI((CELLPTR, HOWPTR, int));
  621. XXstatic void _finished_child ANSI((int));
  622. XX
  623. XXint
  624. XXrunargv(target, how, ignore, group, last, shell, cmd)
  625. XXCELLPTR target;
  626. XXHOWPTR  how;
  627. XXint     ignore;
  628. XXint    group;
  629. XXint    last;
  630. XXint    shell;
  631. XXchar    *cmd;
  632. XX{
  633. XX   int status;
  634. XX   char **argv;
  635. XX
  636. XX   argv = Pack_argv( group, shell, cmd );
  637. XX   _add_child(target, how, ignore);
  638. XX   status = spawnvp(P_WAIT, *argv, argv);
  639. XX   if( status == -1 ) Error("%s: %s", argv[0], strerror(errno));
  640. XX   _finished_child(status);
  641. XX   if( last && !Doing_bang ) Update_time_stamp( target, how );
  642. XX
  643. XX   return( 0 );
  644. XX}
  645. XX
  646. XX
  647. XXvoid
  648. XXClean_up_processes()
  649. XX{
  650. XX   _abort_flg = TRUE;
  651. XX   _finished_child(-1);
  652. XX}
  653. XX
  654. XX
  655. XXint
  656. XXWait_for_child( abort_flg, pid )
  657. XXint abort_flg;
  658. XXint pid;
  659. XX{
  660. XX   return(1);
  661. XX}
  662. XX
  663. XX
  664. XXstatic int     _valid = -1;
  665. XXstatic CELLPTR _tg;
  666. XXstatic HOWPTR  _how;
  667. XXstatic int     _ignore;
  668. XX
  669. XXstatic void
  670. XX_add_child( target, how, ignore )
  671. XXCELLPTR target;
  672. XXHOWPTR  how;
  673. XXint    ignore;
  674. XX{
  675. XX   _tg = target;
  676. XX   _ignore = ignore;
  677. XX   _how    = how;
  678. XX   _valid = 0;
  679. XX
  680. XX   Current_target = NIL(HOW);
  681. XX}
  682. XX
  683. XX
  684. XXstatic void
  685. XX_finished_child(status)
  686. XXint    status;
  687. XX{
  688. XX   if( _valid == -1 ) return;
  689. XX   Unlink_temp_files( _how );
  690. XX   _valid = -1;
  691. XX   Handle_result( status, _ignore, _abort_flg, _tg );
  692. XX}
  693. XSHAR_EOF
  694. Xchmod 0640 tos/runargv.c || echo "restore of tos/runargv.c fails"
  695. Xset `wc -c tos/runargv.c`;Sum=$1
  696. Xif test "$Sum" != "2637"
  697. Xthen echo original size 2637, current size $Sum;fi
  698. Xsed 's/^X//' << 'SHAR_EOF' > tos/startup.h &&
  699. XX/* This file contains the default value of the MAKESTARTUP variable.
  700. XX * You must set the quoted string below to the default path to the startup
  701. XX * variable, so that it gets compiled in.  LEAVE ROOTDIR at the front of
  702. XX * the path.  This allows the user to customize his environment for dmake
  703. XX * by setting up a new ROOTDIR environment variable. */
  704. XX
  705. XX"MAKESTARTUP := $(ROOTDIR)/etc/startup.mk",
  706. XSHAR_EOF
  707. Xchmod 0640 tos/startup.h || echo "restore of tos/startup.h fails"
  708. Xset `wc -c tos/startup.h`;Sum=$1
  709. Xif test "$Sum" != "392"
  710. Xthen echo original size 392, current size $Sum;fi
  711. Xsed 's/^X//' << 'SHAR_EOF' > tos/startup.mk &&
  712. XX# Generic UNIX DMAKE startup file.  Customize to suit your needs.
  713. XX# Should work for both SYSV, and BSD 4.3
  714. XX# See the documentation for a description of internally defined macros.
  715. XX#
  716. XX# Disable warnings for macros redefined here that were given
  717. XX# on the command line.
  718. XX__.SILENT := $(.SILENT)
  719. XX.SILENT   := yes
  720. XX
  721. XX# Configuration parameters for DMAKE startup.mk file
  722. XX# Set these to NON-NULL if you wish to turn the parameter on.
  723. XX_HAVE_RCS    :=         # yes => RCS  is installed.
  724. XX_HAVE_SCCS    :=         # yes => SCCS is installed.
  725. XX
  726. XX# Applicable suffix definitions
  727. XXA := .olb    # Libraries
  728. XXE :=        # Executables
  729. XXF := .f        # Fortran
  730. XXO := .o        # Objects
  731. XXP := .p        # Pascal
  732. XXS := .s        # Assembler sources
  733. XXV := ,v        # RCS suffix
  734. XX
  735. XX# Recipe execution configurations
  736. XXSHELL        := /bin/sh
  737. XXSHELLFLAGS    := 
  738. XXGROUPSHELL    := $(SHELL)
  739. XXGROUPFLAGS    := 
  740. XXSHELLMETAS    := |();&<>?*][$$:\\#`'"
  741. XXGROUPSUFFIX    := .bat
  742. XXDIVFILE         = $(TMPFILE)
  743. XX
  744. XX# Standard C-language command names and flags
  745. XX   CPP       := /gnu/lib/cpp    # C-preprocessor
  746. XX   CC      := gcc        # C-compiler and flags
  747. XX   CFLAGS  +=
  748. XX
  749. XX   AS      := /gnu/lib/as    # Assembler and flags
  750. XX   ASFLAGS += 
  751. XX
  752. XX   LD       = $(CC)        # Loader and flags
  753. XX   LDFLAGS +=
  754. XX   LDLIBS   =
  755. XX
  756. XX# Definition of $(MAKE) macro for recursive makes.
  757. XX   MAKE = $(MAKECMD) $(MFLAGS)
  758. XX
  759. XX# Definition of Print command for this system.
  760. XX   PRINT = lpr
  761. XX
  762. XX# Language and Parser generation Tools and their flags
  763. XX   YACC      := yacc        # standard yacc
  764. XX   YFLAGS +=
  765. XX   YTAB      := y.tab        # yacc output files name stem.
  766. XX
  767. XX   LEX      := lex        # standard lex
  768. XX   LFLAGS +=
  769. XX   LEXYY  := lex.yy        # lex output file
  770. XX
  771. XX# Other Compilers, Tools and their flags
  772. XX   PC    := pc            # pascal compiler
  773. XX   RC    := f77            # ratfor compiler
  774. XX   FC    := f77            # fortran compiler
  775. XX
  776. XX   CO       := co        # check out for RCS
  777. XX   COFLAGS += -q
  778. XX
  779. XX   AR     := gar        # archiver
  780. XX   ARFLAGS+= ruv
  781. XX
  782. XX   RM       := /gnu/bin/rm    # remove a file command
  783. XX   RMFLAGS +=
  784. XX
  785. XX# Implicit generation rules for making inferences.
  786. XX# We don't provide .yr or .ye rules here.  They're obsolete.
  787. XX# Rules for making *$O
  788. XX   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  789. XX   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  790. XX   %$O : %$S ; $(AS) $(ASFLAGS) $<
  791. XX   %$O : %.cl ; class -c $<
  792. XX   %$O : %.e %.r %.F %$F
  793. XX    $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  794. XX
  795. XX# Executables
  796. XX   %$E : %$O ; $(LD) $(LDFLAGS) -o $@ $< $(LDLIBES)
  797. XX
  798. XX# lex and yacc rules
  799. XX   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  800. XX   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  801. XX
  802. XX# This rule tells how to make *.out from it's immediate list of prerequisites
  803. XX# UNIX only.
  804. XX   %.out :; $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
  805. XX
  806. XX# RCS support
  807. XX.IF $(_HAVE_RCS)
  808. XX   % : %$V $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  809. XX   .NOINFER : %$V $$(@:d)RCS/$$(@:f)$V
  810. XX.END
  811. XX
  812. XX# SCCS support
  813. XX.IF $(_HAVE_SCCS)
  814. XX   % : s.% ; get $@
  815. XX   .NOINFER : s.%
  816. XX.END
  817. XX
  818. XX# Recipe to make archive files.
  819. XX%$A :
  820. XX[
  821. XX   $(AR) $(ARFLAGS) $@ $?
  822. XX   $(RM) $(RMFLAGS) $?
  823. XX   ranlib $@
  824. XX]
  825. XX
  826. XX# DMAKE uses this recipe to remove intermediate targets
  827. XX.REMOVE :; $(RM) -f $<
  828. XX
  829. XX# AUGMAKE extensions for SYSV compatibility
  830. XX@B = $(@:b)
  831. XX@D = $(@:d)
  832. XX@F = $(@:f)
  833. XX*B = $(*:b)
  834. XX*D = $(*:d)
  835. XX*F = $(*:f)
  836. XX<B = $(<:b)
  837. XX<D = $(<:d)
  838. XX<F = $(<:f)
  839. XX?B = $(?:b)
  840. XX?F = $(?:f)
  841. XX?D = $(?:d)
  842. XX
  843. XX# Turn warnings back to previous setting.
  844. XX.SILENT := $(__.SILENT)
  845. XX
  846. XX# Local startup file if any
  847. XX.INCLUDE .IGNORE: "_startup.mk"
  848. XSHAR_EOF
  849. Xchmod 0640 tos/startup.mk || echo "restore of tos/startup.mk fails"
  850. Xset `wc -c tos/startup.mk`;Sum=$1
  851. Xif test "$Sum" != "3233"
  852. Xthen echo original size 3233, current size $Sum;fi
  853. Xsed 's/^X//' << 'SHAR_EOF' > tos/sysintf.h &&
  854. XX/*
  855. XX** assorted bits of system interface, for common routines inside dmake.
  856. XX** System specific code can be found in the config.h files for each
  857. XX** of the system specifications.
  858. XX*/
  859. XX#include <sys/stat.h>
  860. XX#include <signal.h>
  861. XX
  862. XX#define STAT stat
  863. XX#define VOID_LCACHE(l,m) (void) void_lcache(l,m)
  864. XX
  865. XX/*
  866. XX** standard C items
  867. XX*/
  868. XX#include "stdmacs.h"
  869. XX
  870. XX/*
  871. XX** DOS interface standard items
  872. XX*/
  873. XX#define    getswitchar()    '-'
  874. XX
  875. XX/*
  876. XX** make parameters
  877. XX*/
  878. XX#define    MAX_PATH_LEN    1024
  879. XSHAR_EOF
  880. Xchmod 0640 tos/sysintf.h || echo "restore of tos/sysintf.h fails"
  881. Xset `wc -c tos/sysintf.h`;Sum=$1
  882. Xif test "$Sum" != "454"
  883. Xthen echo original size 454, current size $Sum;fi
  884. X
  885. X
  886. X# Now create the file of patches and apply patch appropriately
  887. X# shar:    Shell Archiver  (v1.22)
  888. X#
  889. X#    Run the following text with /bin/sh to create:
  890. X#      _patches
  891. X#
  892. Xsed 's/^X//' << 'SHAR_EOF' > _patches &&
  893. XX*** /u2/dvadura/src/generic/dmake/src-patchlvl1/unix/sysvr3/config.h    Sat Oct  6 12:06:40 1990
  894. XX--- unix/sysvr3/config.h    Mon Oct 22 18:01:13 1990
  895. XX***************
  896. XX*** 44,51 ****
  897. XX--- 44,55 ----
  898. XX   * not have getcwd, but call it getwd instead. */
  899. XX  extern char *getcwd ANSI((char *, int));
  900. XX  
  901. XX+ #ifdef M_XENIX
  902. XX+ #define PORTAR 1
  903. XX+ #else
  904. XX  /* Define setvbuf, SysV doesn't have one */
  905. XX  #define setvbuf(fp, bp, type, len) setbuf( fp, NULL );
  906. XX+ #endif
  907. XX  
  908. XX  /* NCR Tower's don't define size_t */
  909. XX  #ifdef tower
  910. XX*** /u2/dvadura/src/generic/dmake/src-patchlvl1/unix/sysintf.h    Sat Oct  6 12:07:12 1990
  911. XX--- unix/sysintf.h    Mon Oct 22 17:08:18 1990
  912. XX***************
  913. XX*** 3,8 ****
  914. XX--- 3,9 ----
  915. XX  ** System specific code can be found in the config.h files for each
  916. XX  ** of the system specifications.
  917. XX  */
  918. XX+ #include <sys/types.h>
  919. XX  #include <sys/stat.h>
  920. XX  #include <signal.h>
  921. XX  
  922. XX*** /u2/dvadura/src/generic/dmake/src-patchlvl1/sysintf.c    Sat Oct  6 12:04:18 1990
  923. XX--- sysintf.c    Sun Oct 28 23:16:20 1990
  924. XX***************
  925. XX*** 1,4 ****
  926. XX! /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/sysintf.c,v 1.1 90/10/06 12:04:17 dvadura Exp $
  927. XX  -- SYNOPSIS -- system independent interface
  928. XX  -- 
  929. XX  -- DESCRIPTION
  930. XX--- 1,4 ----
  931. XX! /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/sysintf.c,v 1.1 90/10/06 12:04:17 dvadura Exp Locker: dvadura $
  932. XX  -- SYNOPSIS -- system independent interface
  933. XX  -- 
  934. XX  -- DESCRIPTION
  935. XX***************
  936. XX*** 69,76 ****
  937. XX  */
  938. XX  
  939. XX  #include <stdio.h>
  940. XX- #include "extern.h"
  941. XX  #include "sysintf.h"
  942. XX  #include "alloc.h"
  943. XX  
  944. XX  /*
  945. XX--- 69,76 ----
  946. XX  */
  947. XX  
  948. XX  #include <stdio.h>
  949. XX  #include "sysintf.h"
  950. XX+ #include "extern.h"
  951. XX  #include "alloc.h"
  952. XX  
  953. XX  /*
  954. XX***************
  955. XX*** 97,103 ****
  956. XX     if( lib != NIL(char) )
  957. XX        return( seek_arch(basename(name), lib) );
  958. XX     else
  959. XX!       return( (STAT(name, &buf) == -1) ? (time_t)0 : buf.st_mtime );
  960. XX  }
  961. XX  
  962. XX  
  963. XX--- 97,103 ----
  964. XX     if( lib != NIL(char) )
  965. XX        return( seek_arch(basename(name), lib) );
  966. XX     else
  967. XX!       return( (STAT(name, &buf) == -1) ? (time_t)0L : (time_t) buf.st_mtime );
  968. XX  }
  969. XX  
  970. XX  
  971. XX***************
  972. XX*** 245,251 ****
  973. XX--- 245,253 ----
  974. XX  Read_env_string(ename)
  975. XX  char *ename;
  976. XX  {
  977. XX+ #if !defined(_MSC_VER) || _MSC_VER < 600
  978. XX     extern char *getenv();
  979. XX+ #endif
  980. XX     return( getenv(ename) );
  981. XX  }
  982. XX  
  983. XX***************
  984. XX*** 277,283 ****
  985. XX--- 279,287 ----
  986. XX  ReadEnvironment()
  987. XX  {
  988. XX     extern char **Rule_tab;
  989. XX+ #if !defined(_MSC_VER)
  990. XX     extern char **environ;
  991. XX+ #endif
  992. XX     char **rsave;
  993. XX  
  994. XX     rsave    = Rule_tab;
  995. XX*** /u2/dvadura/src/generic/dmake/src-patchlvl1/readme/msdos    Mon Oct  8 13:30:26 1990
  996. XX--- readme/msdos    Mon Oct 29 10:31:02 1990
  997. XX***************
  998. XX*** 1,89 ****
  999. XX! Some notes on the MSDOS implementation of dmake.
  1000. XX  
  1001. XX! Making the binary:
  1002. XX! ------------------
  1003. XX  
  1004. XX!    Turbo-C:  By default the turbo-C (make tcc) script will make a version
  1005. XX!          of the binary that is compiled for an 8088 and up cpu.  Once made
  1006. XX!          you can make a version for a 186 or 286 by modifying
  1007. XX!          msdos/tccdos/config.mk and setting CFLAGS to contain the right
  1008. XX!          flags, comments are supplied in the makefile to do so.
  1009. XX  
  1010. XX!          The contents of the default response files
  1011. XX!          (named in msdos/tccdos/mk*.bat) assume specific locations for
  1012. XX!          your turbo-C libraries, you may need to edit these before actually
  1013. XX!          getting a successful binary linked.
  1014. XX  
  1015. XX!    Microsoft-C 4.0 to 5.1:
  1016. XX!          Is straight forward, just type 'make msc' and the compile will
  1017. XX!          chunk along.
  1018. XX  
  1019. XX!    Microsoft-C 6.0:
  1020. XX!          Is equally easy, just type 'make msc60' and the compile will
  1021. XX!          chunk along.  Once made, if you want to use dmake to compile
  1022. XX!          itself then set the environment variable MSC_VER=6.0, otherwise
  1023. XX!          the compile flags will not be correct.  You may also supply this
  1024. XX!          as an option on the dmake command line.
  1025. XX  
  1026. XX-    Memory Requirements and Swapping:
  1027. XX-          dmake requires quite a bit of memory to run.  As a result
  1028. XX-          a swapping version of dmake is made if you issue the command
  1029. XX-          'make tccswp', 'make mscswp' or 'make msc60swp'.  If you leave
  1030. XX-          the 'swp' off then corresponding (as described above) non-swapping
  1031. XX-          versions are made.
  1032. XX  
  1033. XX!          The swapping code currently only swaps to DISK, I have left hooks
  1034. XX!          in to accomodate XMS and EMS, I have some code that performs the
  1035. XX!          necessary XMS/EMS accesses but have not incorporated it in yet.
  1036. XX!          It appears that a ramdisk seems to work just fine.  If anyone
  1037. XX!          wishes to fill in the hooks please do and I'll be happy to include
  1038. XX!          them in future distributions.
  1039. XX  
  1040. XX!    dmake 'makefile.mk' control variables:
  1041. XX!          Initially dmake is compiled for the compact memory model.
  1042. XX!          Setting MODEL={s,c,m,l} on the command line will select a different
  1043. XX!          memory model.  Setting NOSWAP:=1 on the command line
  1044. XX!          will disable the compile and linking of the swap code.
  1045. XX!          A summary of the available configuration variables follows:
  1046. XX  
  1047. XX!               MODEL={s,c,m,l}  - Select {small, compact, medium, large}
  1048. XX!                        memory model respectively.
  1049. XX!           NOSWAP:=y       - If set, do not compile the dmake
  1050. XX!                        swapping version of spawnvpe.
  1051. XX!           MSC_VER:=6.0       - Must be set if using MSC 6.0 and dmake
  1052. XX!                        is used to make a new version of dmake.
  1053. XX  
  1054. XX!    ^C and stopping a make:
  1055. XX!          Handling of ^C in the swapping version seems to be somewhat
  1056. XX!          broken.  I don't know what is wrong and would be happy to hear
  1057. XX!          of suggestions on how to fix the current mess :-)  If you hit
  1058. XX!          ^C more than once when dmake is executing a child then I think
  1059. XX!          it will hang most machines.  If you hit it only once or not at
  1060. XX!          all then things seem to work fine :-).  I tried to get this right
  1061. XX!          by looking at other code, and making some assumptions about what
  1062. XX!          DOS does... NEVER ASSUME ANYTHING ABOUT WHAT DOS DOES :-)
  1063. XX  
  1064. XX  
  1065. XX  Other notes:
  1066. XX  ------------
  1067. XX! dmake does not care if you are running command.com or some other command
  1068. XX! interpretter, you must however specify the proper values of the environment
  1069. XX! variables SHELL, SHELLFLAGS, GROUPSHELL, and GROUPFLAGS in order for things
  1070. XX! to work correctly.  Read the man page first.
  1071. XX  
  1072. XX! Group recipes under DOS that use command.com as the command interpretter
  1073. XX! require you to set the GROUPSUFFIX macro.
  1074. XX  
  1075. XX! As shipped the startup.mk files for the DOS version try to figure out what
  1076. XX! command interpretter you are using and set things up appropriately.
  1077. XX! Two command interpretters are supported in the shipped startup.mk file,
  1078. XX! command.com, and the MKS Korn shell.
  1079. XX  
  1080. XX! dmake does not contain any builtin commands.  It gets all commands it executes
  1081. XX! from an external file system.  It is therefore most useful if it is used in
  1082. XX! conjunction with an environment similar to that provided by the MKS Tool kit,
  1083. XX! or equivalent.
  1084. XX  
  1085. XX! dmake now supports the MKS argument passing conventions.  The facility is
  1086. XX! enabled by setting .MKSARGS:=1 and is set by default in the startup.mk file
  1087. XX! if an MKS Korn shell is detected as being the active command interpretter.
  1088. XX--- 1,127 ----
  1089. XX! Notes on the MSDOS implementation of dmake.
  1090. XX  
  1091. XX! Bootstrapping the binary:
  1092. XX! -------------------------
  1093. XX!    A make.bat file is provided to bootstrap the binary.  The file contains
  1094. XX!    several targets for bootstrapping and invoking the batch file with no
  1095. XX!    arguments lists the possibilities shown below.
  1096. XX  
  1097. XX!       INDEX:  You must specify one of:
  1098. XX!      tcc      - Turbo C 2.0, compile.
  1099. XX!      tccswp   - Turbo C 2.0 compile of swapping dmake.
  1100. XX!      msc40    - Microsoft C 4.0 compile.
  1101. XX!      msc50    - Microsoft C 5.0 compile.
  1102. XX!      msc51    - Microsoft C 5.1 compile.
  1103. XX!      msc60    - Microsoft C 6.0 compile.
  1104. XX!      msc40swp - Microsoft C 4.0, MASM 5.1 compile of swapping dmake.
  1105. XX!      msc50swp - Microsoft C 5.0, MASM 5.1 compile of swapping dmake.
  1106. XX!      msc51swp - Microsoft C 5.1, MASM 5.1 compile of swapping dmake.
  1107. XX!      msc60swp - Microsoft C 6.0, MASM 5.1 compile of swapping dmake.
  1108. XX  
  1109. XX!    Based on the compiler you have installed and the whether or not you
  1110. XX!    want the swapping version of dmake, you should select the appropriate
  1111. XX!    target and issue 'make.bat target'.
  1112. XX  
  1113. XX!    The batch file runs a second batch script that comes with the distribution
  1114. XX!    which compiles the sources using the appropriate compiler and flags.  The
  1115. XX!    MSC Versions of the batch files should not require any further user
  1116. XX!    intervention during the compile.  The Turbo-C version, as a final step,
  1117. XX!    invokes tlink with two response files.  The second of these response files,
  1118. XX!    named in msdos/tccdos/mk*.bat, contains absolute path names to Turbo-C
  1119. XX!    libraries.  You may need to edit these before getting a successful binary
  1120. XX!    linked.
  1121. XX  
  1122. XX!    By default the batch files make an executable that will run on an 8088
  1123. XX!    cpu and up.  You can change that by making the initial version and then
  1124. XX!    editing the config.mk files found in either msdos/tccdos or msdos/mscdos
  1125. XX!    (depending on compiler you use), and selecting a diferrent cpu type by
  1126. XX!    supplying the appropriate compiler flags.  You then need to remake dmake
  1127. XX!    again but this time use dmake itself, see below.
  1128. XX  
  1129. XX  
  1130. XX! Using dmake to Make itself:
  1131. XX! ---------------------------
  1132. XX!    If you use dmake to make itself you must first set a number of makefile
  1133. XX!    control variables, either through the environment or on the command line.
  1134. XX  
  1135. XX!    The following variables must be set:
  1136. XX  
  1137. XX!     OS           - defines operating system (must be set)
  1138. XX!     OSRELEASE      - particular version of it.
  1139. XX!     OSENVIRNOMENT  - more customization
  1140. XX  
  1141. XX!    These three variables should be defined in your environment.  Valid values
  1142. XX!    for them are listed in the dmake makefile.mk file.  For example, if you
  1143. XX!    are using MSDOS, with Turbo-C then the valid settings are:
  1144. XX  
  1145. XX+     set OS=msdos
  1146. XX+     set OSRELEASE=tccdos
  1147. XX+     set OSENVIRONMENT=
  1148. XX  
  1149. XX+    dmake searches for an initial startup file, you should set the environment
  1150. XX+    variable MAKESTARTUP to contain the full path to the startup file, eg:
  1151. XX+ 
  1152. XX+     set MAKESTARTUP=d:\usr\lib\startup.mk
  1153. XX+ 
  1154. XX+    The dmake makefile has several variables that can be user specified and
  1155. XX+    default to reasonable values if not set.
  1156. XX+ 
  1157. XX+     MODEL   - defines the model to compile, valid values are
  1158. XX+           {s,c,m, or l}, defaults to 'c' (ie. compact) model
  1159. XX+           if unspecified.
  1160. XX+ 
  1161. XX+     MSC_VER - defines the version of Microsoft C in use, should be set to
  1162. XX+           one of 4.0, 5.0, 5.1 or 6.0; defaults to 6.0.
  1163. XX+ 
  1164. XX+     NOSWAP  - If set to 'y', do not compile the dmake swapping version of
  1165. XX+           spawnvpe.  This has the effect of turning off swapping.
  1166. XX+ 
  1167. XX+     DEBUG   - If set to '1' then make the debugging version of dmake, this
  1168. XX+           will also set MODEL to 'l'.
  1169. XX+ 
  1170. XX+    To set the above variables you must specify them on the dmake command line
  1171. XX+    or insert them into the makefile.mk script.
  1172. XX+ 
  1173. XX+ 
  1174. XX+ Memory Requirements and Swapping:
  1175. XX+ ---------------------------------
  1176. XX+    The swapping code currently only swaps to DISK, I have left hooks
  1177. XX+    in to accomodate XMS and EMS, I have some code that performs the
  1178. XX+    necessary XMS/EMS accesses but have not incorporated it in yet.
  1179. XX+    It appears that a ramdisk seems to work just fine.  If anyone
  1180. XX+    wishes to fill in the hooks please do and I'll be happy to include
  1181. XX+    them in future distributions.
  1182. XX+ 
  1183. XX+ 
  1184. XX+ ^C and stopping a make:
  1185. XX+ -----------------------
  1186. XX+    Thanks to the efforts of Len Reed, appears to now work.  I have been unable
  1187. XX+    to hang my machine if it's swapped out and I hit ^C a couple thousand times.
  1188. XX+    It does stop and cleans up nicely.  So I guess it works :-).  Actually, let
  1189. XX+    me know if you encounter problems with this and I'll try to duplicate
  1190. XX+    them.
  1191. XX+ 
  1192. XX+ 
  1193. XX  Other notes:
  1194. XX  ------------
  1195. XX!    dmake does not care if you are running command.com or some other command
  1196. XX!    interpretter, you must however specify the proper values of the environment
  1197. XX!    variables SHELL, SHELLFLAGS, GROUPSHELL, and GROUPFLAGS in order for things
  1198. XX!    to work correctly.  Read the man page first.
  1199. XX  
  1200. XX!    Group recipes under DOS that use command.com as the command interpretter
  1201. XX!    require you to set the GROUPSUFFIX macro.
  1202. XX  
  1203. XX!    As shipped the startup.mk files for the DOS version try to figure out what
  1204. XX!    command interpretter you are using and set things up appropriately.
  1205. SHAR_EOF
  1206. echo "End of part 2, continue with part 3"
  1207. echo "3" > s2_seq_.tmp
  1208. exit 0
  1209.  
  1210.