home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume19 / dmake / part25 < prev    next >
Encoding:
Text File  |  1991-05-12  |  40.2 KB  |  1,303 lines

  1. Newsgroups: comp.sources.misc
  2. From: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  3. Subject:  v19i046:  dmake - dmake version 3.7, Part25/37
  4. Message-ID: <1991May12.221448.16372@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 306a3c3521b6b40585130779681e2f4f
  6. Date: Sun, 12 May 1991 22:14:48 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  10. Posting-number: Volume 19, Issue 46
  11. Archive-name: dmake/part25
  12. Supersedes: dmake-3.6: Volume 15, Issue 52-77
  13.  
  14. ---- Cut Here and feed the following to sh ----
  15. #!/bin/sh
  16. # this is dmake.shar.25 (part 25 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file dmake/msdos/spawn.c continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 25; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test -f _shar_wnt_.tmp; then
  33. sed 's/^X//' << 'SHAR_EOF' >> 'dmake/msdos/spawn.c' &&
  34. X          mode = O_BINARY | O_WRONLY | O_CREAT | O_APPEND;
  35. X      }
  36. X      handle = open(file, mode, S_IREAD | S_IWRITE);
  37. X      if (handle < 0) {
  38. X          Fatal( "Could not open -F file");
  39. X      }
  40. X      (void) lseek(handle, 0L, SEEK_END);
  41. X      do_hook_std_writes(handle);
  42. X   }
  43. X   else
  44. X      do_unhook_std_writes();
  45. }
  46. X
  47. X
  48. /*
  49. ** _findexec finds executables on the path.
  50. ** Note that it is pretty simple to add support for other executable types
  51. ** (shell scripts, etc.
  52. **
  53. ** This follows the command.com behavior very closely.
  54. */
  55. static char *
  56. _findexec( s, is_shell )/*
  57. ==========================
  58. X   Cloned closely from code provided by Kent Williams.  Stripped his down to
  59. X   a reduced search since dmake doesn't need to recompute the PATH vector
  60. X   each time it does the search since it cannot alter the path vector once
  61. X   it begins to make recipes.  Also modified it to use findfirst and findnext
  62. X   as provided for dirlib package that I got off the net. */
  63. char *s;
  64. int  *is_shell;
  65. {
  66. X   unsigned found_flags;
  67. X   char     **pathv = NIL(char *);
  68. X   char     *ext    = NIL(char);
  69. X   char     *buf    = NIL(char);
  70. X   char     *p[2];
  71. X   char     *dot_scr;
  72. X   char        *dot;
  73. X
  74. X   p[0] = ""; p[1] = NIL(char);
  75. X   if( strchr("./\\", *s) || s[1] == ':' )
  76. X      pathv = p;
  77. X   else if( (pathv = _getpath()) == NIL(char *) )
  78. X      return( NIL(char) );
  79. X
  80. X   /* Compute the extension we need if any. */
  81. X   if( (dot = strrchr(s,'.')) != NIL(char) &&
  82. X        dot > strrchr(s,'/') && dot > strrchr(s,'\\') )
  83. X      ext = dot+1;
  84. X
  85. X   dot_scr   = _mks_args ? dot_ksh : dot_bat;
  86. X   *is_shell = FALSE;
  87. X
  88. X   for( found_flags = 0; *pathv && !found_flags; pathv++ ) {
  89. X      DTA dta;
  90. X
  91. X      if( !ext ) {
  92. X     char *name;
  93. X     buf = Build_path( *pathv, name=_strjoin(s, ".???", -1, FALSE) );
  94. X     FREE(name);
  95. X      }
  96. X      else
  97. X     buf = Build_path( *pathv, s );
  98. X
  99. X      if( findfirst((char *)strupr(buf), &dta) != NIL(DTA) ) {
  100. X     if( !ext ) {
  101. X        char *dot;
  102. X
  103. X        /* search order is .com .exe (.ksh || .bat)
  104. X         * there has to be a '.' */
  105. X        do {
  106. X           dot = strrchr(dta.name,'.');
  107. X           if(0 == strcmp(dot,dot_com))
  108. X          found_flags |= COM;
  109. X           else if(0 == strcmp(dot,dot_exe))
  110. X          found_flags |= EXE;
  111. X           else if( 0 == strcmp(dot,dot_scr) )
  112. X          found_flags |= SCR;
  113. X        } while( found_flags != ALL && findnext(&dta) != NIL(DTA) );
  114. X
  115. X        if(found_flags & COM)      ext = dot_com;
  116. X        else if(found_flags & EXE) ext = dot_exe;
  117. X        else if(found_flags & SCR) {
  118. X           ext = dot_scr;
  119. X           *is_shell = TRUE;
  120. X        }
  121. X
  122. X        if( found_flags ) {
  123. X           char *name;
  124. X           buf = Build_path( *pathv, name=_strjoin(s,ext,-1,FALSE) );
  125. X           FREE(name);
  126. X           strupr(buf);
  127. X        }
  128. X     }
  129. X     else
  130. X        found_flags++;
  131. X      }
  132. X   }
  133. X
  134. X   return( found_flags ? buf : NIL(char) );
  135. }
  136. X
  137. X
  138. /*
  139. ** getpath turns the DOS path into a char *vector, It is gotten and
  140. ** transformed only once since dmake can't modify the value of PATH while
  141. ** it is making targets.
  142. */
  143. static char **
  144. _getpath()
  145. {
  146. X   static   char **dir = NIL(char *);
  147. X   register char *p;
  148. X
  149. X   if( !dir ) {
  150. X      register char *t;
  151. X      int           i;
  152. X      char          *semi = NIL(char);
  153. X
  154. X      if( (p = getenv("PATH")) == NIL(char) ) p = "";
  155. X      for( i=1, t=p; *t; t++ ) if( *t == ';' ) i++;
  156. X
  157. X      TALLOC(dir, i+1, char *);
  158. X      p   = _strdup(p);
  159. X
  160. X      for( i=0; p; p = semi ? (semi+1):NIL(char),i++ ){
  161. X     if( (semi = strchr(p,';')) != NIL(char) ) *semi = '\0';
  162. X     dir[i] = p;
  163. X      }
  164. X      dir[i]=NIL(char);
  165. X   }
  166. X
  167. X   return( dir );
  168. }
  169. X
  170. X
  171. static char far *
  172. _dos_alloc( size )/*
  173. ====================
  174. X   This routine allocates size paragraphs from DOS.  It changes the memory
  175. X   allocation strategy to allocate from the tail and then changes it back.
  176. X   to using first fit. */
  177. uint16 size;
  178. {
  179. X   union REGS r;
  180. X
  181. X   r.h.ah = 0x48;
  182. X   r.x.bx = size;
  183. X
  184. X   intdos( &r, &r );
  185. X   if( r.x.cflag ) No_ram();
  186. X   
  187. X   return( (char far *) MK_FP(r.x.ax, 0) );
  188. }
  189. SHAR_EOF
  190. chmod 0640 dmake/msdos/spawn.c ||
  191. echo 'restore of dmake/msdos/spawn.c failed'
  192. Wc_c="`wc -c < 'dmake/msdos/spawn.c'`"
  193. test 12750 -eq "$Wc_c" ||
  194.     echo 'dmake/msdos/spawn.c: original size 12750, current size' "$Wc_c"
  195. rm -f _shar_wnt_.tmp
  196. fi
  197. # ============= dmake/msdos/startup.h ==============
  198. if test -f 'dmake/msdos/startup.h' -a X"$1" != X"-c"; then
  199.     echo 'x - skipping dmake/msdos/startup.h (File already exists)'
  200.     rm -f _shar_wnt_.tmp
  201. else
  202. > _shar_wnt_.tmp
  203. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/startup.h' &&
  204. /* This file contains the default value of the MAKESTARTUP variable.
  205. X * You must set the quoted string below to the default path to the startup
  206. X * variable, so that it gets compiled in.  LEAVE ROOTDIR at the front of
  207. X * the path.  This allows the user to customize his environment for dmake
  208. X * by setting up a new ROOTDIR environment variable. */
  209. X
  210. "MAKESTARTUP := $(ROOTDIR)/etc/startup.mk",
  211. SHAR_EOF
  212. chmod 0640 dmake/msdos/startup.h ||
  213. echo 'restore of dmake/msdos/startup.h failed'
  214. Wc_c="`wc -c < 'dmake/msdos/startup.h'`"
  215. test 392 -eq "$Wc_c" ||
  216.     echo 'dmake/msdos/startup.h: original size 392, current size' "$Wc_c"
  217. rm -f _shar_wnt_.tmp
  218. fi
  219. # ============= dmake/msdos/stdarg.h ==============
  220. if test -f 'dmake/msdos/stdarg.h' -a X"$1" != X"-c"; then
  221.     echo 'x - skipping dmake/msdos/stdarg.h (File already exists)'
  222.     rm -f _shar_wnt_.tmp
  223. else
  224. > _shar_wnt_.tmp
  225. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/stdarg.h' &&
  226. /*
  227. X * stdarg.h
  228. X *
  229. X * defines ANSI style macros for accessing arguments of a function which takes
  230. X * a variable number of arguments
  231. X *
  232. X */
  233. X
  234. #if !defined(__STDARG)
  235. #define __STDARG
  236. X
  237. typedef char *va_list;
  238. X
  239. #define va_dcl int va_alist
  240. #define va_start(ap,v)  ap = (va_list)&va_alist
  241. #define va_arg(ap,t)    ((t*)(ap += sizeof(t)))[-1]
  242. #define va_end(ap)      ap = NULL
  243. #endif
  244. SHAR_EOF
  245. chmod 0640 dmake/msdos/stdarg.h ||
  246. echo 'restore of dmake/msdos/stdarg.h failed'
  247. Wc_c="`wc -c < 'dmake/msdos/stdarg.h'`"
  248. test 373 -eq "$Wc_c" ||
  249.     echo 'dmake/msdos/stdarg.h: original size 373, current size' "$Wc_c"
  250. rm -f _shar_wnt_.tmp
  251. fi
  252. # ============= dmake/msdos/switchar.c ==============
  253. if test -f 'dmake/msdos/switchar.c' -a X"$1" != X"-c"; then
  254.     echo 'x - skipping dmake/msdos/switchar.c (File already exists)'
  255.     rm -f _shar_wnt_.tmp
  256. else
  257. > _shar_wnt_.tmp
  258. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/switchar.c' &&
  259. /*
  260. ** return switch char
  261. */
  262. #if defined(OS2) || defined(_MSC_VER)
  263. #include <stdlib.h>
  264. #endif
  265. #if !defined(OS2)
  266. #include <dos.h>
  267. #endif /* !OS2 */
  268. #include <stdio.h>
  269. #include "stdmacs.h"
  270. X
  271. getswitchar()/*
  272. ===============
  273. X   Try the environment first.  If you don't find SWITCHAR there, then use
  274. X   the DOS call.  The call is undocumented, and doesn't work for DOS versions
  275. X   4.0 and up, so the check of the environment will fix that. */
  276. {
  277. #if defined(__MSDOS__) || defined(M_I86)
  278. #if !defined(OS2)
  279. X   union REGS rg;
  280. #endif /* ! OS2 */
  281. X   static char *_env_switchar = NIL(char);
  282. X
  283. X   if( _env_switchar != NIL(char) ||
  284. X       (_env_switchar = (char *)getenv("SWITCHAR")) != NIL(char) )
  285. X      return(*_env_switchar);
  286. X
  287. #if !defined(OS2)
  288. X   rg.h.ah = 0x37;      /* switch char request */
  289. X   rg.h.al = 0;         /* get (not set) */
  290. X
  291. X   intdos(&rg, &rg);
  292. X   return (rg.h.dl);
  293. #endif /* ! OS2 */
  294. #endif /* M_I86 */
  295. X
  296. X   return ('-');
  297. }
  298. SHAR_EOF
  299. chmod 0640 dmake/msdos/switchar.c ||
  300. echo 'restore of dmake/msdos/switchar.c failed'
  301. Wc_c="`wc -c < 'dmake/msdos/switchar.c'`"
  302. test 926 -eq "$Wc_c" ||
  303.     echo 'dmake/msdos/switchar.c: original size 926, current size' "$Wc_c"
  304. rm -f _shar_wnt_.tmp
  305. fi
  306. # ============= dmake/msdos/sysintf.h ==============
  307. if test -f 'dmake/msdos/sysintf.h' -a X"$1" != X"-c"; then
  308.     echo 'x - skipping dmake/msdos/sysintf.h (File already exists)'
  309.     rm -f _shar_wnt_.tmp
  310. else
  311. > _shar_wnt_.tmp
  312. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/sysintf.h' &&
  313. /*
  314. ** assorted bits of system interface
  315. */
  316. X
  317. #define STAT stat
  318. #define VOID_LCACHE(l,m)
  319. #define GETPID _psp
  320. X
  321. extern char * tempnam();
  322. extern char * getcwd();
  323. X
  324. /*
  325. ** standard C items
  326. */
  327. X
  328. /*
  329. ** DOS interface standard items
  330. */
  331. #define    chdir(p) _chdir(p)
  332. X
  333. /*
  334. ** make parameters
  335. */
  336. #define    MAX_PATH_LEN    64
  337. X
  338. SHAR_EOF
  339. chmod 0640 dmake/msdos/sysintf.h ||
  340. echo 'restore of dmake/msdos/sysintf.h failed'
  341. Wc_c="`wc -c < 'dmake/msdos/sysintf.h'`"
  342. test 301 -eq "$Wc_c" ||
  343.     echo 'dmake/msdos/sysintf.h: original size 301, current size' "$Wc_c"
  344. rm -f _shar_wnt_.tmp
  345. fi
  346. # ============= dmake/msdos/tccdos/config.h ==============
  347. if test ! -d 'dmake/msdos/tccdos'; then
  348.     mkdir 'dmake/msdos/tccdos'
  349. fi
  350. if test -f 'dmake/msdos/tccdos/config.h' -a X"$1" != X"-c"; then
  351.     echo 'x - skipping dmake/msdos/tccdos/config.h (File already exists)'
  352.     rm -f _shar_wnt_.tmp
  353. else
  354. > _shar_wnt_.tmp
  355. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/config.h' &&
  356. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/tccdos/config.h,v 1.1 91/05/06 15:26:02 dvadura Exp $
  357. -- SYNOPSIS -- Configurarion include file.
  358. -- 
  359. -- DESCRIPTION
  360. --     There is one of these for each specific machine configuration.
  361. --    It can be used to further tweek the machine specific sources
  362. --    so that they compile.
  363. --
  364. -- AUTHOR
  365. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  366. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  367. --
  368. -- COPYRIGHT
  369. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  370. -- 
  371. --      This program is free software; you can redistribute it and/or
  372. --      modify it under the terms of the GNU General Public License
  373. --      (version 1), as published by the Free Software Foundation, and
  374. --      found in the file 'LICENSE' included with this distribution.
  375. -- 
  376. --      This program is distributed in the hope that it will be useful,
  377. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  378. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  379. --      GNU General Public License for more details.
  380. -- 
  381. --      You should have received a copy of the GNU General Public License
  382. --      along with this program;  if not, write to the Free Software
  383. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  384. --
  385. -- LOG
  386. --     $Log:    config.h,v $
  387. X * Revision 1.1  91/05/06  15:26:02  dvadura
  388. X * dmake Release Version 3.7
  389. X * 
  390. */
  391. X
  392. /* define this for configurations that don't have the coreleft function
  393. X * so that the code compiles.  To my knowledge coreleft exists only on
  394. X * Turbo C, but it is needed here since the function is used in many debug
  395. X * macros. */
  396. /*#define coreleft() 0L*/
  397. extern unsigned int coreleft();
  398. X
  399. #define SIGQUIT    SIGTERM        /* turbo C doesn't understand SIGQUIT */
  400. X
  401. /* Turbo-C understands const declarations. */
  402. #define CONST const
  403. X
  404. #ifndef MSDOS
  405. #   define MSDOS 1
  406. #endif
  407. SHAR_EOF
  408. chmod 0640 dmake/msdos/tccdos/config.h ||
  409. echo 'restore of dmake/msdos/tccdos/config.h failed'
  410. Wc_c="`wc -c < 'dmake/msdos/tccdos/config.h'`"
  411. test 1897 -eq "$Wc_c" ||
  412.     echo 'dmake/msdos/tccdos/config.h: original size 1897, current size' "$Wc_c"
  413. rm -f _shar_wnt_.tmp
  414. fi
  415. # ============= dmake/msdos/tccdos/config.mk ==============
  416. if test -f 'dmake/msdos/tccdos/config.mk' -a X"$1" != X"-c"; then
  417.     echo 'x - skipping dmake/msdos/tccdos/config.mk (File already exists)'
  418.     rm -f _shar_wnt_.tmp
  419. else
  420. > _shar_wnt_.tmp
  421. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/config.mk' &&
  422. # This is the Turbo C 2.0 DOS configuration file for DMAKE
  423. #    It simply modifies the values of SRC, and checks to see if
  424. #    OSENVIRONMENT is defined.  If so it includes the appropriate
  425. #    config.mk file.
  426. #
  427. # It also sets the values of .SOURCE.c and .SOURCE.h to include the local
  428. # directory.
  429. #
  430. osrdir := $(OS)$(DIRSEPSTR)$(OSRELEASE)
  431. X
  432. # Definition of macros for library, and C startup code.
  433. LDLIBS            = d:/cc/tcc/lib/c$(MODEL)
  434. CSTARTUP    = d:/cc/tcc/lib/c0$(MODEL).obj
  435. X
  436. # The following sources are required for TURBO C 2.0
  437. OSR_SRC = tempnam.c utime.c
  438. .SETDIR=$(osrdir) : $(OSR_SRC)
  439. X
  440. SRC += $(OSR_SRC)
  441. .SOURCE.h : $(osrdir)
  442. X
  443. # Local configuration modifications for CFLAGS.  Make sure your turboc.cfg
  444. # file contains a -D__STDC__=1 and -DM_I86=1, if not then uncomment the line
  445. # below!
  446. #CFLAGS += -DM_I86=1 -D__STDC__=1
  447. X
  448. # You can get a smaller executable still, buy adding a -1 to the list of
  449. # flags below, but then you can't run this on an 8086/88 cpu.
  450. #CFLAGS += -1
  451. CFLAGS  += -I$(osrdir) -f- -d -O -N- -w-nod $(C_$(MODEL))
  452. ASFLAGS += -t -mx $(S_$(MODEL))
  453. X
  454. # Debugging information for Turbo-C
  455. DB_CFLAGS  += -v
  456. DB_LDFLAGS += /v
  457. X
  458. # See if we modify anything in the lower levels.
  459. .IF $(OSENVIRONMENT) != $(NULL)
  460. X   .INCLUDE .IGNORE : $(osrdir)$(DIRSEPSTR)$(OSENVIRONMENT)$(DIRSEPSTR)config.mk
  461. .END
  462. X
  463. C_s =
  464. C_m = -mm
  465. C_c = -mc
  466. C_l = -ml
  467. X
  468. S_s = -dmsmall
  469. S_m = -dmmedium
  470. S_c = -dmcompact
  471. S_l = -dmlarge
  472. SHAR_EOF
  473. chmod 0640 dmake/msdos/tccdos/config.mk ||
  474. echo 'restore of dmake/msdos/tccdos/config.mk failed'
  475. Wc_c="`wc -c < 'dmake/msdos/tccdos/config.mk'`"
  476. test 1400 -eq "$Wc_c" ||
  477.     echo 'dmake/msdos/tccdos/config.mk: original size 1400, current size' "$Wc_c"
  478. rm -f _shar_wnt_.tmp
  479. fi
  480. # ============= dmake/msdos/tccdos/lib.rsp ==============
  481. if test -f 'dmake/msdos/tccdos/lib.rsp' -a X"$1" != X"-c"; then
  482.     echo 'x - skipping dmake/msdos/tccdos/lib.rsp (File already exists)'
  483.     rm -f _shar_wnt_.tmp
  484. else
  485. > _shar_wnt_.tmp
  486. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/lib.rsp' &&
  487. d:\cc\tcc\lib\cl
  488. SHAR_EOF
  489. chmod 0640 dmake/msdos/tccdos/lib.rsp ||
  490. echo 'restore of dmake/msdos/tccdos/lib.rsp failed'
  491. Wc_c="`wc -c < 'dmake/msdos/tccdos/lib.rsp'`"
  492. test 17 -eq "$Wc_c" ||
  493.     echo 'dmake/msdos/tccdos/lib.rsp: original size 17, current size' "$Wc_c"
  494. rm -f _shar_wnt_.tmp
  495. fi
  496. # ============= dmake/msdos/tccdos/libswp.rsp ==============
  497. if test -f 'dmake/msdos/tccdos/libswp.rsp' -a X"$1" != X"-c"; then
  498.     echo 'x - skipping dmake/msdos/tccdos/libswp.rsp (File already exists)'
  499.     rm -f _shar_wnt_.tmp
  500. else
  501. > _shar_wnt_.tmp
  502. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/libswp.rsp' &&
  503. d:\cc\tcc\lib\cl
  504. SHAR_EOF
  505. chmod 0640 dmake/msdos/tccdos/libswp.rsp ||
  506. echo 'restore of dmake/msdos/tccdos/libswp.rsp failed'
  507. Wc_c="`wc -c < 'dmake/msdos/tccdos/libswp.rsp'`"
  508. test 17 -eq "$Wc_c" ||
  509.     echo 'dmake/msdos/tccdos/libswp.rsp: original size 17, current size' "$Wc_c"
  510. rm -f _shar_wnt_.tmp
  511. fi
  512. # ============= dmake/msdos/tccdos/mk.bat ==============
  513. if test -f 'dmake/msdos/tccdos/mk.bat' -a X"$1" != X"-c"; then
  514.     echo 'x - skipping dmake/msdos/tccdos/mk.bat (File already exists)'
  515.     rm -f _shar_wnt_.tmp
  516. else
  517. > _shar_wnt_.tmp
  518. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/mk.bat' &&
  519. md objects
  520. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  infer.c
  521. mv infer.obj objects
  522. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  make.c
  523. mv make.obj objects
  524. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  stat.c
  525. mv stat.obj objects
  526. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  expand.c
  527. mv expand.obj objects
  528. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmstring.c
  529. mv dmstring.obj objects
  530. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  hash.c
  531. mv hash.obj objects
  532. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dag.c
  533. mv dag.obj objects
  534. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmake.c
  535. mv dmake.obj objects
  536. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  path.c
  537. mv path.obj objects
  538. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  imacs.c
  539. mv imacs.obj objects
  540. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  sysintf.c
  541. mv sysintf.obj objects
  542. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  parse.c
  543. mv parse.obj objects
  544. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  getinp.c
  545. mv getinp.obj objects
  546. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  quit.c
  547. mv quit.obj objects
  548. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  state.c
  549. mv state.obj objects
  550. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  basename.c
  551. mv basename.obj objects
  552. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmdump.c
  553. mv dmdump.obj objects
  554. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  macparse.c
  555. mv macparse.obj objects
  556. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  rulparse.c
  557. mv rulparse.obj objects
  558. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  percent.c
  559. mv percent.obj objects
  560. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  function.c
  561. mv function.obj objects
  562. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\ruletab.c
  563. mv ruletab.obj objects
  564. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\dirbrk.c
  565. mv dirbrk.obj objects
  566. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\runargv.c
  567. mv runargv.obj objects
  568. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\arlib.c
  569. mv arlib.obj objects
  570. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\_chdir.c
  571. mv _chdir.obj objects
  572. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\switchar.c
  573. mv switchar.obj objects
  574. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\rmprq.c
  575. mv rmprq.obj objects
  576. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tee.c
  577. mv tee.obj objects
  578. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\tempnam.c
  579. mv tempnam.obj objects
  580. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\utime.c
  581. mv utime.obj objects
  582. tlink @\tmp\mkAAA010368,dmake.exe,NUL.MAP,@\tmp\mkBAA010368
  583. copy msdos\tccdos\startup.mk startup.mk
  584. SHAR_EOF
  585. chmod 0640 dmake/msdos/tccdos/mk.bat ||
  586. echo 'restore of dmake/msdos/tccdos/mk.bat failed'
  587. Wc_c="`wc -c < 'dmake/msdos/tccdos/mk.bat'`"
  588. test 2992 -eq "$Wc_c" ||
  589.     echo 'dmake/msdos/tccdos/mk.bat: original size 2992, current size' "$Wc_c"
  590. rm -f _shar_wnt_.tmp
  591. fi
  592. # ============= dmake/msdos/tccdos/mkswp.bat ==============
  593. if test -f 'dmake/msdos/tccdos/mkswp.bat' -a X"$1" != X"-c"; then
  594.     echo 'x - skipping dmake/msdos/tccdos/mkswp.bat (File already exists)'
  595.     rm -f _shar_wnt_.tmp
  596. else
  597. > _shar_wnt_.tmp
  598. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/mkswp.bat' &&
  599. md objects
  600. tasm -t -mx -dmlarge msdos\exec.asm;
  601. mv exec.obj objects
  602. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  infer.c
  603. mv infer.obj objects
  604. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  make.c
  605. mv make.obj objects
  606. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  stat.c
  607. mv stat.obj objects
  608. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  expand.c
  609. mv expand.obj objects
  610. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmstring.c
  611. mv dmstring.obj objects
  612. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  hash.c
  613. mv hash.obj objects
  614. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dag.c
  615. mv dag.obj objects
  616. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmake.c
  617. mv dmake.obj objects
  618. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  path.c
  619. mv path.obj objects
  620. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  imacs.c
  621. mv imacs.obj objects
  622. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  sysintf.c
  623. mv sysintf.obj objects
  624. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  parse.c
  625. mv parse.obj objects
  626. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  getinp.c
  627. mv getinp.obj objects
  628. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  quit.c
  629. mv quit.obj objects
  630. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  state.c
  631. mv state.obj objects
  632. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  basename.c
  633. mv basename.obj objects
  634. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  dmdump.c
  635. mv dmdump.obj objects
  636. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  macparse.c
  637. mv macparse.obj objects
  638. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  rulparse.c
  639. mv rulparse.obj objects
  640. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  percent.c
  641. mv percent.obj objects
  642. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  function.c
  643. mv function.obj objects
  644. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\ruletab.c
  645. mv ruletab.obj objects
  646. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\dirbrk.c
  647. mv dirbrk.obj objects
  648. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\runargv.c
  649. mv runargv.obj objects
  650. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\arlib.c
  651. mv arlib.obj objects
  652. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\_chdir.c
  653. mv _chdir.obj objects
  654. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\switchar.c
  655. mv switchar.obj objects
  656. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\rmprq.c
  657. mv rmprq.obj objects
  658. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\find.c
  659. mv find.obj objects
  660. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\spawn.c
  661. mv spawn.obj objects
  662. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\tempnam.c
  663. mv tempnam.obj objects
  664. tcc -c -I. -Imsdos -Imsdos\tccdos -f- -d -O -N- -w-nod -ml  msdos\tccdos\utime.c
  665. mv utime.obj objects
  666. tlink @\tmp\mkAAA010396,dmake.exe,NUL.MAP,@\tmp\mkBAA010396
  667. copy msdos\tccdos\startup.mk startup.mk
  668. SHAR_EOF
  669. chmod 0640 dmake/msdos/tccdos/mkswp.bat ||
  670. echo 'restore of dmake/msdos/tccdos/mkswp.bat failed'
  671. Wc_c="`wc -c < 'dmake/msdos/tccdos/mkswp.bat'`"
  672. test 3146 -eq "$Wc_c" ||
  673.     echo 'dmake/msdos/tccdos/mkswp.bat: original size 3146, current size' "$Wc_c"
  674. rm -f _shar_wnt_.tmp
  675. fi
  676. # ============= dmake/msdos/tccdos/obj.rsp ==============
  677. if test -f 'dmake/msdos/tccdos/obj.rsp' -a X"$1" != X"-c"; then
  678.     echo 'x - skipping dmake/msdos/tccdos/obj.rsp (File already exists)'
  679.     rm -f _shar_wnt_.tmp
  680. else
  681. > _shar_wnt_.tmp
  682. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/obj.rsp' &&
  683. d:\cc\tcc\lib\c0l.obj+
  684. objects\infer.obj+
  685. objects\make.obj+
  686. objects\stat.obj+
  687. objects\expand.obj+
  688. objects\dmstring.obj+
  689. objects\hash.obj+
  690. objects\dag.obj+
  691. objects\dmake.obj+
  692. objects\path.obj+
  693. objects\imacs.obj+
  694. objects\sysintf.obj+
  695. objects\parse.obj+
  696. objects\getinp.obj+
  697. objects\quit.obj+
  698. objects\state.obj+
  699. objects\basename.obj+
  700. objects\dmdump.obj+
  701. objects\macparse.obj+
  702. objects\rulparse.obj+
  703. objects\percent.obj+
  704. objects\function.obj+
  705. objects\ruletab.obj+
  706. objects\dirbrk.obj+
  707. objects\runargv.obj+
  708. objects\arlib.obj+
  709. objects\_chdir.obj+
  710. objects\switchar.obj+
  711. objects\rmprq.obj+
  712. objects\tee.obj+
  713. objects\tempnam.obj+
  714. objects\utime.obj
  715. SHAR_EOF
  716. chmod 0640 dmake/msdos/tccdos/obj.rsp ||
  717. echo 'restore of dmake/msdos/tccdos/obj.rsp failed'
  718. Wc_c="`wc -c < 'dmake/msdos/tccdos/obj.rsp'`"
  719. test 635 -eq "$Wc_c" ||
  720.     echo 'dmake/msdos/tccdos/obj.rsp: original size 635, current size' "$Wc_c"
  721. rm -f _shar_wnt_.tmp
  722. fi
  723. # ============= dmake/msdos/tccdos/objswp.rsp ==============
  724. if test -f 'dmake/msdos/tccdos/objswp.rsp' -a X"$1" != X"-c"; then
  725.     echo 'x - skipping dmake/msdos/tccdos/objswp.rsp (File already exists)'
  726.     rm -f _shar_wnt_.tmp
  727. else
  728. > _shar_wnt_.tmp
  729. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/objswp.rsp' &&
  730. d:\cc\tcc\lib\c0l.obj+
  731. objects\exec.obj+
  732. objects\infer.obj+
  733. objects\make.obj+
  734. objects\stat.obj+
  735. objects\expand.obj+
  736. objects\dmstring.obj+
  737. objects\hash.obj+
  738. objects\dag.obj+
  739. objects\dmake.obj+
  740. objects\path.obj+
  741. objects\imacs.obj+
  742. objects\sysintf.obj+
  743. objects\parse.obj+
  744. objects\getinp.obj+
  745. objects\quit.obj+
  746. objects\state.obj+
  747. objects\basename.obj+
  748. objects\dmdump.obj+
  749. objects\macparse.obj+
  750. objects\rulparse.obj+
  751. objects\percent.obj+
  752. objects\function.obj+
  753. objects\ruletab.obj+
  754. objects\dirbrk.obj+
  755. objects\runargv.obj+
  756. objects\arlib.obj+
  757. objects\_chdir.obj+
  758. objects\switchar.obj+
  759. objects\rmprq.obj+
  760. objects\find.obj+
  761. objects\spawn.obj+
  762. objects\tempnam.obj+
  763. objects\utime.obj
  764. SHAR_EOF
  765. chmod 0640 dmake/msdos/tccdos/objswp.rsp ||
  766. echo 'restore of dmake/msdos/tccdos/objswp.rsp failed'
  767. Wc_c="`wc -c < 'dmake/msdos/tccdos/objswp.rsp'`"
  768. test 673 -eq "$Wc_c" ||
  769.     echo 'dmake/msdos/tccdos/objswp.rsp: original size 673, current size' "$Wc_c"
  770. rm -f _shar_wnt_.tmp
  771. fi
  772. # ============= dmake/msdos/tccdos/public.h ==============
  773. if test -f 'dmake/msdos/tccdos/public.h' -a X"$1" != X"-c"; then
  774.     echo 'x - skipping dmake/msdos/tccdos/public.h (File already exists)'
  775.     rm -f _shar_wnt_.tmp
  776. else
  777. > _shar_wnt_.tmp
  778. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/public.h' &&
  779. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/tccdos/RCS/public.h,v 1.1 91/05/06 15:26:04 dvadura Exp Locker: dvadura $
  780. -- WARNING  -- This file is AUTOMATICALLY GENERATED DO NOT EDIT IT
  781. --
  782. -- SYNOPSIS -- Local functions exported to be visible by others.
  783. --
  784. -- DESCRIPTION
  785. --      This file is generated by 'genpub'.  Function declarations
  786. --      that appear in this file are extracted by 'genpub' from
  787. --      source files.  Any function in the source file whose definition
  788. --      appears like:
  789. --
  790. --          PUBLIC return_type
  791. --          function( arg_list );
  792. --          type_expr1 arg1;
  793. --          ...
  794. --
  795. --      has its definition extracted and a line of the form:
  796. --
  797. --          return_type function ANSI((type_expr1,type_expr2,...));
  798. --
  799. --      entered into the output file.
  800. --
  801. -- AUTHOR
  802. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  803. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  804. --
  805. -- COPYRIGHT
  806. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  807. -- 
  808. --      This program is free software; you can redistribute it and/or
  809. --      modify it under the terms of the GNU General Public License
  810. --      (version 1), as published by the Free Software Foundation, and
  811. --      found in the file 'LICENSE' included with this distribution.
  812. -- 
  813. --      This program is distributed in the hope that it will be useful,
  814. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  815. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  816. --      GNU General Public License for more details.
  817. -- 
  818. --      You should have received a copy of the GNU General Public License
  819. --      along with this program;  if not, write to the Free Software
  820. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  821. --
  822. -- LOG
  823. --     $Log:    public.h,v $
  824. X * Revision 1.1  91/05/06  15:26:04  dvadura
  825. X * dmake Release Version 3.7
  826. X * 
  827. */
  828. X
  829. #ifndef _DMAKE_PUBLIC_h
  830. #define _DMAKE_PUBLIC_h
  831. X
  832. void Infer_recipe ANSI((CELLPTR, CELLPTR));
  833. int Make_targets ANSI(());
  834. int Exec_commands ANSI((CELLPTR));
  835. void Pop_dir ANSI((int));
  836. void Append_line ANSI((char *, int, FILE *, char *, int, int));
  837. void Stat_target ANSI((CELLPTR, int));
  838. char * Expand ANSI((char *));
  839. char * Apply_edit ANSI((char *, char *, char *, int, int));
  840. void Map_esc ANSI((char *));
  841. char* Apply_modifiers ANSI((int, char *));
  842. char* Tokenize ANSI((char *, char *));
  843. char * _strjoin ANSI((char *, char *, int, int));
  844. char * _stradd ANSI((char *, char *, int));
  845. char * _strapp ANSI((char *, char *));
  846. char * _strdup ANSI((char *));
  847. char * _strpbrk ANSI((char *, char *));
  848. char * _strspn ANSI((char *, char *));
  849. char * _strstr ANSI((char *, char *));
  850. char * _substr ANSI((char *, char *));
  851. uint16 Hash ANSI((char *, uint32 *));
  852. HASHPTR Get_name ANSI((char *, HASHPTR *, int));
  853. HASHPTR Search_table ANSI((HASHPTR *, char *, uint16 *, uint32 *));
  854. HASHPTR Def_macro ANSI((char *, char *, int));
  855. CELLPTR Def_cell ANSI((char *));
  856. LINKPTR Add_prerequisite ANSI((CELLPTR, CELLPTR, int, int));
  857. void Clear_prerequisites ANSI((CELLPTR));
  858. int Test_circle ANSI((CELLPTR, int));
  859. STRINGPTR Def_recipe ANSI((char *, STRINGPTR, int, int));
  860. t_attr Rcp_attribute ANSI((char *));
  861. int main ANSI((int, char **));
  862. FILE * Openfile ANSI((char *, int, int));
  863. FILE * Closefile ANSI(());
  864. FILE * Search_file ANSI((char *, char **));
  865. char * Filename ANSI(());
  866. void No_ram ANSI(());
  867. int Usage ANSI((int));
  868. int Version ANSI(());
  869. char * Get_suffix ANSI((char *));
  870. char * Build_path ANSI((char *, char *));
  871. void Make_rules ANSI(());
  872. void Create_macro_vars ANSI(());
  873. time_t Do_stat ANSI((char *, char *, char **));
  874. int Do_touch ANSI((char *, char *, char **));
  875. void Void_lib_cache ANSI((char *, char *));
  876. time_t Do_time ANSI(());
  877. int Do_cmnd ANSI((char *, int, int, CELLPTR, int, int, int));
  878. char ** Pack_argv ANSI((int, int, char *));
  879. char * Read_env_string ANSI((char *));
  880. int Write_env_string ANSI((char *, char *));
  881. void ReadEnvironment ANSI(());
  882. void Catch_signals ANSI((void (*)()));
  883. void Clear_signals ANSI(());
  884. void Prolog ANSI((int, char* []));
  885. void Epilog ANSI((int));
  886. char * Get_current_dir ANSI(());
  887. int Set_dir ANSI((char*));
  888. char Get_switch_char ANSI(());
  889. FILE* Get_temp ANSI((char **, char *, int));
  890. FILE * Start_temp ANSI((char *, CELLPTR, char **));
  891. void Open_temp_error ANSI((char *, char *));
  892. void Link_temp ANSI((CELLPTR, FILE *, char *));
  893. void Close_temp ANSI((CELLPTR, FILE *));
  894. void Unlink_temp_files ANSI((CELLPTR));
  895. void Handle_result ANSI((int, int, int, CELLPTR));
  896. void Update_time_stamp ANSI((CELLPTR));
  897. void Parse ANSI((FILE *));
  898. int Get_line ANSI((char *, FILE *));
  899. char * Do_comment ANSI((char *, char **, int));
  900. char * Get_token ANSI((TKSTRPTR, char *, int));
  901. void Quit ANSI(());
  902. void Read_state ANSI(());
  903. void Write_state ANSI(());
  904. int Check_state ANSI((CELLPTR, STRINGPTR *, int));
  905. char* basename ANSI((char *));
  906. void Dump ANSI(());
  907. void Dump_recipe ANSI((STRINGPTR));
  908. int Parse_macro ANSI((char *, int));
  909. int Macro_op ANSI((char *));
  910. int Parse_rule_def ANSI((int *));
  911. int Rule_op ANSI((char *));
  912. void Add_recipe_to_list ANSI((char *, int, int));
  913. void Bind_rules_to_targets ANSI((int));
  914. int Set_group_attributes ANSI((char *));
  915. DFALINKPTR Match_dfa ANSI((char *));
  916. void Check_circle_dfa ANSI(());
  917. void Add_nfa ANSI((char *));
  918. char * Exec_function ANSI((char *));
  919. int If_root_path ANSI((char *));
  920. int runargv ANSI((CELLPTR, int, int, int, int, char *));
  921. void Clean_up_processes ANSI(());
  922. int Wait_for_child ANSI((int, int));
  923. time_t seek_arch ANSI((char*, char*));
  924. int touch_arch ANSI((char*, char*));
  925. int _chdir ANSI((char *));
  926. void Remove_prq ANSI((CELLPTR));
  927. void Hook_std_writes ANSI((char *));
  928. X
  929. #endif
  930. SHAR_EOF
  931. chmod 0640 dmake/msdos/tccdos/public.h ||
  932. echo 'restore of dmake/msdos/tccdos/public.h failed'
  933. Wc_c="`wc -c < 'dmake/msdos/tccdos/public.h'`"
  934. test 5622 -eq "$Wc_c" ||
  935.     echo 'dmake/msdos/tccdos/public.h: original size 5622, current size' "$Wc_c"
  936. rm -f _shar_wnt_.tmp
  937. fi
  938. # ============= dmake/msdos/tccdos/startup.mk ==============
  939. if test -f 'dmake/msdos/tccdos/startup.mk' -a X"$1" != X"-c"; then
  940.     echo 'x - skipping dmake/msdos/tccdos/startup.mk (File already exists)'
  941.     rm -f _shar_wnt_.tmp
  942. else
  943. > _shar_wnt_.tmp
  944. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/startup.mk' &&
  945. # MSDOS DMAKE startup file.  Customize to suit your needs.
  946. # Assumes MKS toolkit for the tool commands, and Turbo-C.  Change as req'd.
  947. # See the documentation for a description of internally defined macros.
  948. #
  949. # Disable warnings for macros redefined here that were given
  950. # on the command line.
  951. __.SILENT := $(.SILENT)
  952. .SILENT   := yes
  953. X
  954. # Configuration parameters for DMAKE startup.mk file
  955. # Set these to NON-NULL if you wish to turn the parameter on.
  956. _HAVE_RCS    := yes        # yes => RCS  is installed.
  957. _HAVE_SCCS    :=         # yes => SCCS is installed.
  958. X
  959. # Applicable suffix definitions
  960. A := .lib    # Libraries
  961. E := .exe    # Executables
  962. F := .for    # Fortran
  963. O := .obj    # Objects
  964. P := .pas    # Pascal
  965. S := .asm    # Assembler sources
  966. V :=         # RCS suffix
  967. X
  968. # See if these are defined
  969. TMPDIR := $(ROOTDIR)/tmp
  970. .IMPORT .IGNORE : TMPDIR SHELL COMSPEC
  971. X
  972. # Recipe execution configurations
  973. # First set SHELL, If it is not defined, use COMSPEC, otherwise
  974. # it is assumed to be MKS Korn SHELL.
  975. .IF $(SHELL) == $(NULL)
  976. .IF $(COMSPEC) == $(NULL)
  977. X   SHELL := $(ROOTDIR)/bin/sh$E
  978. .ELSE
  979. X   SHELL := $(COMSPEC)
  980. .END
  981. .END
  982. GROUPSHELL := $(SHELL)
  983. X
  984. # Now set remaining arguments depending on which SHELL we
  985. # are going to use.  COMSPEC (assumed to be command.com) or
  986. # MKS Korn Shell.
  987. .IF $(SHELL)==$(COMSPEC)
  988. X   SHELLFLAGS  := $(SWITCHAR)c
  989. X   GROUPFLAGS  := $(SHELLFLAGS)
  990. X   SHELLMETAS  := *"?<>
  991. X   GROUPSUFFIX := .bat
  992. X   DIRSEPSTR   := \\
  993. X   DIVFILE      = $(TMPFILE:s,/,\)
  994. .ELSE
  995. X   SHELLFLAGS  := -c
  996. X   GROUPFLAGS  := 
  997. X   SHELLMETAS  := *"?<>|()&][$$\#`'
  998. X   GROUPSUFFIX := .ksh
  999. X   .MKSARGS    := yes
  1000. X   DIVFILE      = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}})
  1001. X   DIVSEP_shell_yes := \\\
  1002. X   DIVSEP_shell_no  := \\
  1003. .END
  1004. X
  1005. # Standard C-language command names and flags
  1006. X   CC      := tcc        # C-compiler and flags
  1007. X   CFLAGS  +=
  1008. X
  1009. X   AS      := tasm        # Assembler and flags
  1010. X   ASFLAGS += 
  1011. X
  1012. X   LD       = tlink        # Loader and flags
  1013. X   LDFLAGS +=
  1014. X   LDLIBS   =
  1015. X
  1016. # Definition of $(MAKE) macro for recursive makes.
  1017. X   MAKE = $(MAKECMD) $(MFLAGS)
  1018. X
  1019. # Language and Parser generation Tools and their flags
  1020. X   YACC      := yacc        # standard yacc
  1021. X   YFLAGS +=
  1022. X   YTAB      := ytab        # yacc output files name stem.
  1023. X
  1024. X   LEX      := lex        # standard lex
  1025. X   LFLAGS +=
  1026. X   LEXYY  := lex_yy        # lex output file
  1027. X
  1028. # Other Compilers, Tools and their flags
  1029. X   PC    := tpc            # pascal compiler
  1030. X   RC    := anyf77        # ratfor compiler
  1031. X   FC    := anyf77        # fortran compiler
  1032. X
  1033. X   CO       := co        # check out for RCS
  1034. X   COFLAGS += -q
  1035. X
  1036. X   AR     := ar            # archiver
  1037. X   ARFLAGS+= ruv
  1038. X
  1039. X   RM       := rm        # remove a file command
  1040. X   RMFLAGS +=
  1041. X
  1042. # Implicit generation rules for making inferences.
  1043. # We don't provide .yr or .ye rules here.  They're obsolete.
  1044. # Rules for making *$O
  1045. X   %$O : %.c ; $(CC) $(CFLAGS) -c $<
  1046. X   %$O : %$P ; $(PC) $(PFLAGS) -c $<
  1047. X   %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\);
  1048. X   %$O : %.cl ; class -c $<
  1049. X   %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  1050. X
  1051. # Executables
  1052. X   %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
  1053. X
  1054. # lex and yacc rules
  1055. X   %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  1056. X   %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  1057. X
  1058. # RCS support
  1059. .IF $(_HAVE_RCS)
  1060. X   % : $$(@:d)RCS/$$(@:f)$V;- $(CO) $(COFLAGS) $@
  1061. X   .NOINFER : $$(@:d)RCS/$$(@:f)$V
  1062. .END
  1063. X
  1064. # SCCS support
  1065. .IF $(_HAVE_SCCS)
  1066. X   % : s.% ; get $@
  1067. X   .NOINFER : s.%
  1068. .END
  1069. X
  1070. # Recipe to make archive files.
  1071. %$A :
  1072. [
  1073. X   $(AR) $(ARFLAGS) $@ $?
  1074. X   $(RM) $(RMFLAGS) $?
  1075. ]
  1076. X
  1077. # DMAKE uses this recipe to remove intermediate targets
  1078. .REMOVE :; $(RM) -f $<
  1079. X
  1080. # AUGMAKE extensions for SYSV compatibility
  1081. @B = $(@:b)
  1082. @D = $(@:d)
  1083. @F = $(@:f)
  1084. *B = $(*:b)
  1085. *D = $(*:d)
  1086. *F = $(*:f)
  1087. <B = $(<:b)
  1088. <D = $(<:d)
  1089. <F = $(<:f)
  1090. ?B = $(?:b)
  1091. ?F = $(?:f)
  1092. ?D = $(?:d)
  1093. X
  1094. # Turn warnings back to previous setting.
  1095. .SILENT := $(__.SILENT)
  1096. X
  1097. # Local init file if any, gets parsed before user makefile
  1098. .INCLUDE .IGNORE: "_startup.mk"
  1099. SHAR_EOF
  1100. chmod 0640 dmake/msdos/tccdos/startup.mk ||
  1101. echo 'restore of dmake/msdos/tccdos/startup.mk failed'
  1102. Wc_c="`wc -c < 'dmake/msdos/tccdos/startup.mk'`"
  1103. test 3795 -eq "$Wc_c" ||
  1104.     echo 'dmake/msdos/tccdos/startup.mk: original size 3795, current size' "$Wc_c"
  1105. rm -f _shar_wnt_.tmp
  1106. fi
  1107. # ============= dmake/msdos/tccdos/tempnam.c ==============
  1108. if test -f 'dmake/msdos/tccdos/tempnam.c' -a X"$1" != X"-c"; then
  1109.     echo 'x - skipping dmake/msdos/tccdos/tempnam.c (File already exists)'
  1110.     rm -f _shar_wnt_.tmp
  1111. else
  1112. > _shar_wnt_.tmp
  1113. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/tempnam.c' &&
  1114. /*LINTLIBRARY*/
  1115. #include <stdio.h>
  1116. #include <string.h>
  1117. #include <stdlib.h>
  1118. #include <dos.h>
  1119. X
  1120. #if defined(max)
  1121. #   undef  max
  1122. #endif
  1123. #define max(A,B) (((A)<(B))?(B):(A))
  1124. X
  1125. extern char *mktemp();
  1126. extern int access();
  1127. int _access();
  1128. X
  1129. /* Turbo C stdio.h doesn't define P_tmpdir, so let's do it here */
  1130. /* Under DOS leave the default tmpdir pointing here!        */
  1131. static char *P_tmpdir = "";
  1132. X
  1133. char *
  1134. tempnam(dir, prefix)
  1135. char *dir;        /* use this directory please (if non-NULL) */
  1136. char *prefix;        /* use this (if non-NULL) as filename prefix */
  1137. {
  1138. X   static         int count = 0;
  1139. X   register char *p, *q, *tmpdir;
  1140. X   int            tl=0, dl=0, pl;
  1141. X   char          buf[30];
  1142. X
  1143. X   pl = strlen(P_tmpdir);
  1144. X
  1145. X   if( (tmpdir = getenv("TMPDIR")) != NULL ) tl = strlen(tmpdir);
  1146. X   if( dir != NULL ) dl = strlen(dir);
  1147. X
  1148. X   if( (p = malloc((unsigned)(max(max(dl,tl),pl)+13))) == NULL )
  1149. X     return(NULL);
  1150. X
  1151. X   *p = '\0';
  1152. X
  1153. X   if( (tl == 0) || (_access( strcpy(p, tmpdir), 0) != 0) )
  1154. X     if( (dl == 0) || (_access( strcpy(p, dir), 0) != 0) )
  1155. X    if( _access( strcpy(p, P_tmpdir), 0) != 0 )
  1156. X       if( !prefix )
  1157. X          prefix = "tp";
  1158. X
  1159. X   if(prefix)
  1160. X   {
  1161. X      *(p+strlen(p)+2) = '\0';
  1162. X      (void)strncat(p, prefix, 2);
  1163. X   }
  1164. X
  1165. X   sprintf( buf, "%08x", _psp );
  1166. X   buf[6]='\0';
  1167. X   (void)strcat(p, buf );
  1168. X   sprintf( buf, "%04d", count++ );
  1169. X   q=p+strlen(p)-6;
  1170. X   *q++ = buf[0]; *q++ = buf[1];
  1171. X   *q++ = buf[2]; *q++ = buf[3];
  1172. X
  1173. X   if( (q = strrchr(p,'.')) != NULL ) *q = '\0';
  1174. X
  1175. X   return(p);
  1176. }
  1177. X
  1178. X
  1179. X
  1180. _access( name, flag )
  1181. char *name;
  1182. int  flag;
  1183. {
  1184. X   char *p;
  1185. X   int r;
  1186. X
  1187. X   if( name == NULL || !*name ) return(1);  /* NULL dir means current dir */
  1188. X   r = access( name, flag );
  1189. X   p = name+strlen(name)-1;
  1190. X   if(*p != '/' && *p != '\\') strcat( p, "/" );
  1191. X
  1192. X   return( r );
  1193. }
  1194. SHAR_EOF
  1195. chmod 0640 dmake/msdos/tccdos/tempnam.c ||
  1196. echo 'restore of dmake/msdos/tccdos/tempnam.c failed'
  1197. Wc_c="`wc -c < 'dmake/msdos/tccdos/tempnam.c'`"
  1198. test 1724 -eq "$Wc_c" ||
  1199.     echo 'dmake/msdos/tccdos/tempnam.c: original size 1724, current size' "$Wc_c"
  1200. rm -f _shar_wnt_.tmp
  1201. fi
  1202. # ============= dmake/msdos/tccdos/utime.c ==============
  1203. if test -f 'dmake/msdos/tccdos/utime.c' -a X"$1" != X"-c"; then
  1204.     echo 'x - skipping dmake/msdos/tccdos/utime.c (File already exists)'
  1205.     rm -f _shar_wnt_.tmp
  1206. else
  1207. > _shar_wnt_.tmp
  1208. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tccdos/utime.c' &&
  1209. /*
  1210. ** change access and modify times of file
  1211. */
  1212. #include <sys/stat.h>
  1213. #include <fcntl.h>
  1214. #include <time.h>
  1215. X
  1216. int
  1217. utime(name, timep)/*
  1218. ====================
  1219. X    Broken for turbo C it only sets the file time to the current time by
  1220. X    touching a character in the file */
  1221. char*    name;
  1222. time_t    timep[2];
  1223. {
  1224. X    struct  stat buf;
  1225. X    int    fil;
  1226. X    char    data;
  1227. X
  1228. X    if (stat(name, &buf) != 0)
  1229. X        return (-1);
  1230. X    if (buf.st_size != 0)  {
  1231. X        if ((fil = open(name, O_RDWR, S_IWRITE)) < 0)
  1232. X            return (-1);
  1233. X        if (read(fil, &data, 1) < 1) {
  1234. X            close(fil);
  1235. X            return (-1);
  1236. X        }
  1237. X        lseek(fil, 0L, 0);
  1238. X        if (write(fil, &data, 1) < 1) {
  1239. X            close(fil);
  1240. X            return (-1);
  1241. X        }
  1242. X        close(fil);
  1243. X        return (0);
  1244. X    } else     if ((fil = creat(name, S_IWRITE)) < 0) {
  1245. X        return (-1);
  1246. X    } else {
  1247. X        close(fil);
  1248. X        return (0);
  1249. X    }
  1250. }
  1251. SHAR_EOF
  1252. chmod 0640 dmake/msdos/tccdos/utime.c ||
  1253. echo 'restore of dmake/msdos/tccdos/utime.c failed'
  1254. Wc_c="`wc -c < 'dmake/msdos/tccdos/utime.c'`"
  1255. test 767 -eq "$Wc_c" ||
  1256.     echo 'dmake/msdos/tccdos/utime.c: original size 767, current size' "$Wc_c"
  1257. rm -f _shar_wnt_.tmp
  1258. fi
  1259. # ============= dmake/msdos/tee.c ==============
  1260. if test -f 'dmake/msdos/tee.c' -a X"$1" != X"-c"; then
  1261.     echo 'x - skipping dmake/msdos/tee.c (File already exists)'
  1262.     rm -f _shar_wnt_.tmp
  1263. else
  1264. > _shar_wnt_.tmp
  1265. sed 's/^X//' << 'SHAR_EOF' > 'dmake/msdos/tee.c' &&
  1266. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/RCS/tee.c,v 1.1 91/05/06 15:25:36 dvadura Exp $
  1267. -- SYNOPSIS -- Hook_std_writes() dummy call for non swapping MSDOS versions.
  1268. -- 
  1269. -- DESCRIPTION
  1270. --
  1271. -- AUTHOR
  1272. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  1273. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  1274. --
  1275. -- COPYRIGHT
  1276. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  1277. -- 
  1278. --      This program is free software; you can redistribute it and/or
  1279. --      modify it under the terms of the GNU General Public License
  1280. --      (version 1), as published by the Free Software Foundation, and
  1281. --      found in the file 'LICENSE' included with this distribution.
  1282. -- 
  1283. --      This program is distributed in the hope that it will be useful,
  1284. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  1285. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1286. --      GNU General Public License for more details.
  1287. -- 
  1288. --      You should have received a copy of the GNU General Public License
  1289. --      along with this program;  if not, write to the Free Software
  1290. SHAR_EOF
  1291. true || echo 'restore of dmake/msdos/tee.c failed'
  1292. fi
  1293. echo 'End of part 25, continue with part 26'
  1294. echo 26 > _shar_seq_.tmp
  1295. exit 0
  1296.  
  1297. exit 0 # Just in case...
  1298. -- 
  1299. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1300. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1301. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1302. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1303.