home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-01-29 | 40.3 KB | 1,437 lines |
- Newsgroups: comp.sources.misc
- From: dvadura@plg.waterloo.edu (Dennis Vadura)
- Subject: v27i108: dmake - dmake Version 3.8, Part07/41
- Message-ID: <1992Jan28.031346.7149@sparky.imd.sterling.com>
- X-Md4-Signature: 93621952264f40327b8491aa870d552a
- Date: Tue, 28 Jan 1992 03:13:46 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
- Posting-number: Volume 27, Issue 108
- Archive-name: dmake/part07
- Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
- Supersedes: dmake: Volume 19, Issue 22-58
-
- ---- Cut Here and feed the following to sh ----
- # this is dmake.shar.07 (part 7 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file dmake/dbug/malloc/testmlc.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 7; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test -f _shar_wnt_.tmp; then
- sed 's/^X//' << 'SHAR_EOF' >> 'dmake/dbug/malloc/testmlc.c' &&
- #ifndef lint
- static char *SQ_SccsId = "@(#)mtest3.c 1.2 88/08/25";
- #endif
- #include <stdio.h>
- /*
- ** looptest.c -- intensive allocator tester
- **
- ** Usage: looptest
- **
- ** History:
- ** 4-Feb-1987 rtech!daveb
- */
- X
- # ifdef SYS5
- # define random rand
- # else
- # include <sys/vadvise.h>
- # endif
- X
- # include <stdio.h>
- # include <signal.h>
- # include <setjmp.h>
- X
- # define MAXITER 1000000 /* main loop iterations */
- # define MAXOBJS 1000 /* objects in pool */
- # define BIGOBJ 90000 /* max size of a big object */
- # define TINYOBJ 80 /* max size of a small object */
- # define BIGMOD 100 /* 1 in BIGMOD is a BIGOBJ */
- # define STATMOD 10000 /* interation interval for status */
- X
- main( argc, argv )
- int argc;
- char **argv;
- {
- X register int **objs; /* array of objects */
- X register int *sizes; /* array of object sizes */
- X register int n; /* iteration counter */
- X register int i; /* object index */
- X register int size; /* object size */
- X register int r; /* random number */
- X
- X int objmax; /* max size this iteration */
- X int cnt; /* number of allocated objects */
- X int nm = 0; /* number of mallocs */
- X int nre = 0; /* number of reallocs */
- X int nal; /* number of allocated objects */
- X int nfre; /* number of free list objects */
- X long alm; /* memory in allocated objects */
- X long frem; /* memory in free list */
- X long startsize; /* size at loop start */
- X long endsize; /* size at loop exit */
- X long maxiter = 0; /* real max # iterations */
- X
- X extern char end; /* memory before heap */
- X char *calloc();
- X char *malloc();
- X char *sbrk();
- X long atol();
- X
- # ifndef SYS5
- X /* your milage may vary... */
- X vadvise( VA_ANOM );
- # endif
- X
- X if (argc > 1)
- X maxiter = atol (argv[1]);
- X if (maxiter <= 0)
- X maxiter = MAXITER;
- X
- X printf("MAXITER %d MAXOBJS %d ", maxiter, MAXOBJS );
- X printf("BIGOBJ %d, TINYOBJ %d, nbig/ntiny 1/%d\n",
- X BIGOBJ, TINYOBJ, BIGMOD );
- X fflush( stdout );
- X
- X if( NULL == (objs = (int **)calloc( MAXOBJS, sizeof( *objs ) ) ) )
- X {
- X fprintf(stderr, "Can't allocate memory for objs array\n");
- X exit(1);
- X }
- X
- X if( NULL == ( sizes = (int *)calloc( MAXOBJS, sizeof( *sizes ) ) ) )
- X {
- X fprintf(stderr, "Can't allocate memory for sizes array\n");
- X exit(1);
- X }
- X
- X /* as per recent discussion on net.lang.c, calloc does not
- X ** necessarily fill in NULL pointers...
- X */
- X for( i = 0; i < MAXOBJS; i++ )
- X objs[ i ] = NULL;
- X
- X startsize = sbrk(0) - &end;
- X printf( "Memory use at start: %d bytes\n", startsize );
- X fflush(stdout);
- X
- X printf("Starting the test...\n");
- X fflush(stdout);
- X for( n = 0; n < maxiter ; n++ )
- X {
- X if( !(n % STATMOD) )
- X {
- X printf("%d iterations\n", n);
- X fflush(stdout);
- X }
- X
- X /* determine object of interst and it's size */
- X
- X r = random();
- X objmax = ( r % BIGMOD ) ? TINYOBJ : BIGOBJ;
- X size = r % objmax;
- X i = r % (MAXOBJS - 1);
- X
- X /* either replace the object of get a new one */
- X
- X if( objs[ i ] == NULL )
- X {
- X objs[ i ] = (int *)malloc( size );
- X nm++;
- X }
- X else
- X {
- X /* don't keep bigger objects around */
- X if( size > sizes[ i ] )
- X {
- X objs[ i ] = (int *)realloc( objs[ i ], size );
- X nre++;
- X }
- X else
- X {
- X free( objs[ i ] );
- X objs[ i ] = (int *)malloc( size );
- X nm++;
- X }
- X }
- X
- X sizes[ i ] = size;
- X if( objs[ i ] == NULL )
- X {
- X printf("\nCouldn't allocate %d byte object!\n",
- X size );
- X break;
- X }
- X } /* for() */
- X
- X printf( "\n" );
- X cnt = 0;
- X for( i = 0; i < MAXOBJS; i++ )
- X if( objs[ i ] )
- X cnt++;
- X
- X printf( "Did %d iterations, %d objects, %d mallocs, %d reallocs\n",
- X n, cnt, nm, nre );
- X printf( "Memory use at end: %d bytes\n", sbrk(0) - &end );
- X fflush( stdout );
- X
- X /* free all the objects */
- X for( i = 0; i < MAXOBJS; i++ )
- X if( objs[ i ] != NULL )
- X free( objs[ i ] );
- X
- X endsize = sbrk(0) - &end;
- X printf( "Memory use after free: %d bytes\n", endsize );
- X fflush( stdout );
- X
- X if( startsize != endsize )
- X printf("startsize %d != endsize %d\n", startsize, endsize );
- X
- X free( objs );
- X free( sizes );
- X
- X malloc_dump(2);
- X exit( 0 );
- }
- X
- SHAR_EOF
- chmod 0640 dmake/dbug/malloc/testmlc.c ||
- echo 'restore of dmake/dbug/malloc/testmlc.c failed'
- Wc_c="`wc -c < 'dmake/dbug/malloc/testmlc.c'`"
- test 3971 -eq "$Wc_c" ||
- echo 'dmake/dbug/malloc/testmlc.c: original size 3971, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/dbug/malloc/tostring.c ==============
- if test -f 'dmake/dbug/malloc/tostring.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/dbug/malloc/tostring.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/dbug/malloc/tostring.c' &&
- /*
- X * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
- X * You may copy, distribute, and use this software as long as this
- X * copyright statement is not removed.
- X */
- #include "tostring.h"
- X
- /*
- X * Function: tostring()
- X *
- X * Purpose: to convert an integer to an ascii display string
- X *
- X * Arguments: buf - place to put the
- X * val - integer to convert
- X * len - length of output field (0 if just enough to hold data)
- X * base - base for number conversion (only works for base <= 16)
- X * fill - fill char when len > # digits
- X *
- X * Returns: length of string
- X *
- X * Narrative: IF fill character is non-blank
- X * Determine base
- X * If base is HEX
- X * add "0x" to begining of string
- X * IF base is OCTAL
- X * add "0" to begining of string
- X *
- X * While value is greater than zero
- X * use val % base as index into xlation str to get cur char
- X * divide val by base
- X *
- X * Determine fill-in length
- X *
- X * Fill in fill chars
- X *
- X * Copy in number
- X *
- X *
- X * Mod History:
- X * 90/01/24 cpcahil Initial revision.
- X */
- X
- #ifndef lint
- static
- char rcs_hdr[] = "$Id: tostring.c,v 1.1 1992/01/24 03:29:16 dvadura Exp $";
- #endif
- X
- #define T_LEN 10
- X
- int
- tostring(buf,val,len,base,fill)
- X int base;
- X char * buf;
- X char fill;
- X int len;
- X int val;
- X
- {
- X char * bufstart = buf;
- X int i = T_LEN;
- X char * xbuf = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- X char tbuf[T_LEN];
- X
- X /*
- X * if we are filling with non-blanks, make sure the
- X * proper start string is added
- X */
- X if( fill != ' ' )
- X {
- X switch(base)
- X {
- X case B_HEX:
- X *(buf++) = '0';
- X *(buf++) = 'x';
- X if( len )
- X {
- X len -= 2;
- X }
- X break;
- X case B_OCTAL:
- X *(buf++) = fill;
- X if( len )
- X {
- X len--;
- X }
- X break;
- X default:
- X break;
- X }
- X }
- X
- X while( val > 0 )
- X {
- X tbuf[--i] = xbuf[val % base];
- X val = val / base;
- X }
- X
- X if( len )
- X {
- X len -= (T_LEN - i);
- X
- X if( len > 0 )
- X {
- X while(len-- > 0)
- X {
- X *(buf++) = fill;
- X }
- X }
- X else
- X {
- X /*
- X * string is too long so we must truncate
- X * off some characters. We do this the easiest
- X * way by just incrementing i. This means the
- X * most significant digits are lost.
- X */
- X while( len++ < 0 )
- X {
- X i++;
- X }
- X }
- X }
- X
- X while( i < T_LEN )
- X {
- X *(buf++) = tbuf[i++];
- X }
- X
- X return( (int) (buf - bufstart) );
- X
- } /* tostring(... */
- X
- /*
- X * $Log: tostring.c,v $
- X * Revision 1.1 1992/01/24 03:29:16 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- X * Revision 1.4 90/05/11 00:13:11 cpcahil
- X * added copyright statment
- X *
- X * Revision 1.3 90/02/24 21:50:33 cpcahil
- X * lots of lint fixes
- X *
- X * Revision 1.2 90/02/24 17:29:42 cpcahil
- X * changed $Header to $Id so full path wouldnt be included as part of rcs
- X * id string
- X *
- X * Revision 1.1 90/02/22 23:17:44 cpcahil
- X * Initial revision
- X *
- X */
- SHAR_EOF
- chmod 0640 dmake/dbug/malloc/tostring.c ||
- echo 'restore of dmake/dbug/malloc/tostring.c failed'
- Wc_c="`wc -c < 'dmake/dbug/malloc/tostring.c'`"
- test 2807 -eq "$Wc_c" ||
- echo 'dmake/dbug/malloc/tostring.c: original size 2807, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/dbug/malloc/tostring.h ==============
- if test -f 'dmake/dbug/malloc/tostring.h' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/dbug/malloc/tostring.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/dbug/malloc/tostring.h' &&
- /*
- X * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
- X * You may copy, distribute, and use this software as long as this
- X * copyright statement is not removed.
- X */
- /*
- X * $Id: tostring.h,v 1.1 1992/01/24 03:29:17 dvadura Exp $
- X */
- #define B_BIN 2
- #define B_DEC 10
- #define B_HEX 16
- #define B_OCTAL 8
- X
- /*
- X * $Log: tostring.h,v $
- X * Revision 1.1 1992/01/24 03:29:17 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- X * Revision 1.2 90/05/11 00:13:11 cpcahil
- X * added copyright statment
- X *
- X * Revision 1.1 90/02/23 07:09:05 cpcahil
- X * Initial revision
- X *
- X */
- SHAR_EOF
- chmod 0640 dmake/dbug/malloc/tostring.h ||
- echo 'restore of dmake/dbug/malloc/tostring.h failed'
- Wc_c="`wc -c < 'dmake/dbug/malloc/tostring.h'`"
- test 582 -eq "$Wc_c" ||
- echo 'dmake/dbug/malloc/tostring.h: original size 582, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/dmake.c ==============
- if test -f 'dmake/dmake.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/dmake.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/dmake.c' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/dmake.c,v 1.1 1992/01/24 03:26:58 dvadura Exp $
- -- SYNOPSIS -- The main program.
- --
- -- DESCRIPTION
- --
- -- dmake [-#dbug_string] [ options ]
- -- [ macro definitions ] [ target ... ]
- --
- -- This file contains the main command line parser for the
- -- make utility. The valid flags recognized are as follows:
- --
- -- -f file - use file as the makefile
- -- -C file - duplicate console output to file (MSDOS only)
- -- -K file - .KEEP_STATE file
- -- -#dbug_string - dump out debugging info, see below
- -- -v{dfimt} - verbose, print what we are doing, as we do it.
- --
- -- options: (can be catenated, ie -irn == -i -r -n)
- --
- -- -A - enable AUGMAKE special target mapping
- -- -B - enable non-use of TABS to start recipe lines
- -- -c - use non-standard comment scanning
- -- -i - ignore errors
- -- -n - trace and print, do not execute commands
- -- -t - touch, update dates without executing commands
- -- -T - do not apply transitive closure on inference rules
- -- -r - don't use internal rules
- -- -s - do your work silently
- -- -S - force Sequential make, overrides -P
- -- -q - check if target is up to date. Does not
- -- do anything. Returns 0 if up to date, -1
- -- otherwise.
- -- -p - print out a version of the makefile
- -- -P# - set value of MAXPROCESS
- -- -E - define environment strings as macros
- -- -e - as -E but done after parsing makefile
- -- -u - force unconditional update of target
- -- -k - make all independent targets even if errors
- -- -V - print out this make version number
- -- -M - Microsoft make compatibility, (* disabled *)
- -- -h - print out usage info
- -- -x - export macro defs to environment
- --
- -- NOTE: - #ddbug_string is only availabe for versions of dmake that
- -- have been compiled with -DDBUG switch on. Not the case for
- -- distributed versions. Any such versions must be linked
- -- together with a version of Fred Fish's debug code.
- --
- -- NOTE: - in order to compile the code the include file stddef.h
- -- must be shipped with the bundled code.
- --
- -- AUTHOR
- -- Dennis Vadura, dvadura@watdragon.uwaterloo.ca
- -- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
- --
- -- COPYRIGHT
- -- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
- --
- -- This program is free software; you can redistribute it and/or
- -- modify it under the terms of the GNU General Public License
- -- (version 1), as published by the Free Software Foundation, and
- -- found in the file 'LICENSE' included with this distribution.
- --
- -- This program is distributed in the hope that it will be useful,
- -- but WITHOUT ANY WARRANTY; without even the implied warrant of
- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- -- GNU General Public License for more details.
- --
- -- You should have received a copy of the GNU General Public License
- -- along with this program; if not, write to the Free Software
- -- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- --
- -- LOG
- -- $Log: dmake.c,v $
- X * Revision 1.1 1992/01/24 03:26:58 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- */
- X
- /* Set this flag to one, and the global variables in vextern.h will not
- X * be defined as 'extern', instead they will be defined as global vars
- X * when this module is compiled. */
- #define _DEFINE_GLOBALS_ 1
- X
- #include "extern.h"
- #include "patchlvl.h"
- #include "version.h"
- X
- #ifndef MSDOS
- #define USAGE \
- "Usage:\n%s [-ABceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|K} file] [macro[*][+][:]=value ...] [target ...]\n"
- #else
- #define USAGE \
- "Usage:\n%s [-ABceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|C|K} file] [macro[*][+][:]=value ...] [target ...]\n"
- #endif
- X
- #if __STDC__ == 1
- void Fatal(char *fmt, ...);
- void Warning(char *fmt, ...);
- #endif
- X
- static char *sccid = "Copyright (c) 1990,1991 by Dennis Vadura";
- static char _warn = TRUE; /* warnings on by default */
- X
- static void _do_VPATH();
- static void _do_ReadEnvironment();
- static void _do_f_flag ANSI((char, char *, char **));
- X
- PUBLIC int
- main(argc, argv)
- int argc;
- char **argv;
- {
- #ifdef MSDOS
- X char* std_fil_name = NIL(char);
- #endif
- X
- X char* fil_name = NIL(char);
- X char* state_name = NIL(char);
- X char* cmdmacs;
- X char* targets;
- X FILE* mkfil;
- X int ex_val;
- X int m_export;
- X
- X DB_ENTER("main");
- X
- X /* Initialize Global variables to their default values */
- X Prolog(argc, argv);
- X Create_macro_vars();
- X Catch_signals(Quit);
- X
- X Def_macro( "MAKECMD", Pname, M_PRECIOUS|M_NOEXPORT );
- X Pname = basename(Pname);
- X
- X DB_PROCESS(Pname);
- X (void) setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* stdout line buffered */
- X
- X Continue = FALSE;
- X Comment = FALSE;
- X Get_env = FALSE;
- X Force = FALSE;
- X Target = FALSE;
- X If_expand = FALSE;
- X Listing = FALSE;
- X Readenv = FALSE;
- X Rules = TRUE;
- X Trace = FALSE;
- X Touch = FALSE;
- X Check = FALSE;
- X Microsoft = FALSE;
- X Makemkf = FALSE;
- X m_export = FALSE;
- X cmdmacs = NIL(char);
- X targets = NIL(char);
- X
- X Verbose = V_NONE;
- X Transitive = TRUE;
- X Nest_level = 0;
- X Line_number = 0;
- X Suppress_temp_file = FALSE;
- X
- X while( --argc > 0 ) {
- X register char *p;
- X char *q;
- X
- X if( *(p = *++argv) == '-' ) {
- X if( p[1] == '\0' ) Fatal("Missing option letter");
- X
- X /* copy options to Buffer for $(MFLAGS), strip 'f' and 'C'*/
- X q = strchr(Buffer, '\0');
- X while (*p != '\0') {
- X char c = (*q++ = *p++);
- X if( c == 'f' || c == 'C' ) q--;
- X }
- X
- X if( *(q-1) == '-' )
- X q--;
- X else
- X *q++ = ' ';
- X
- X *q = '\0';
- X
- X for( p = *argv+1; *p; p++) switch (*p) {
- X case 'f':
- X _do_f_flag( 'f', *++argv, &fil_name ); argc--;
- X break;
- X
- #if defined(MSDOS) && !defined(OS2)
- X case 'C':
- X _do_f_flag( 'C', *++argv, &std_fil_name ); argc--;
- X Hook_std_writes( std_fil_name );
- X break;
- #endif
- X
- X case 'K':
- X _do_f_flag( 'K', *++argv, &state_name ); argc--;
- X Def_macro(".KEEP_STATE", state_name, M_EXPANDED|M_PRECIOUS);
- X break;
- X
- X case 'k': Continue = TRUE; break;
- X case 'c': Comment = TRUE; break;
- X case 'p': Listing = TRUE; break;
- X case 'r': Rules = FALSE; break;
- X case 'n': Trace = TRUE; break;
- X case 't': Touch = TRUE; break;
- X case 'q': Check = TRUE; break;
- X case 'u': Force = TRUE; break;
- X case 'x': m_export = TRUE; break;
- X case 'T': Transitive = FALSE; break;
- X case 'e': Get_env = 'e'; break;
- X case 'E': Get_env = 'E'; break;
- X
- X case 'V': Version(); Quit(NIL(CELL)); break;
- X case 'A': Def_macro("AUGMAKE", "y", M_EXPANDED); break;
- X case 'B': Def_macro(".NOTABS", "y", M_EXPANDED); break;
- X case 'i': Def_macro(".IGNORE", "y", M_EXPANDED); break;
- X case 's': Def_macro(".SILENT", "y", M_EXPANDED); break;
- X case 'S': Def_macro(".SEQUENTIAL", "y", M_EXPANDED); break;
- X
- X case 'v':
- X if( p[-1] != '-' ) Usage(TRUE);
- X while( p[1] ) switch( *++p ) {
- X case 'd': Verbose |= V_PRINT_DIR; break;
- X case 'f': Verbose |= V_FILE_IO; break;
- X case 'i': Verbose |= V_INFER; break;
- X case 'm': Verbose |= V_MAKE; break;
- X case 't': Verbose |= V_LEAVE_TMP; break;
- X
- X default: Usage(TRUE); break;
- X }
- X if( !Verbose ) Verbose = V_ALL;
- X break;
- X
- X case 'P':
- X if( p[1] ) {
- X Def_macro( "MAXPROCESS", p+1, M_MULTI|M_EXPANDED );
- X p += strlen(p)-1;
- X }
- X else
- X Fatal( "Missing number for -P flag" );
- X break;
- X
- #ifdef DBUG
- X case '#':
- X DB_PUSH(p+1);
- X p += strlen(p)-1;
- X break;
- #endif
- X
- X case 'h': Usage(FALSE); break;
- X case 0: break; /* lone - */
- X default: Usage(TRUE); break;
- X }
- X }
- X else if( (q = strchr(p, '=')) != NIL(char) ) {
- X cmdmacs = _stradd( cmdmacs, _strdup2(p), TRUE );
- X Parse_macro( p, (q[-1]!='+')?M_PRECIOUS:M_DEFAULT );
- X }
- X else {
- X register CELLPTR cp;
- X targets = _stradd( targets, _strdup(p), TRUE );
- X Add_prerequisite(Root, cp = Def_cell(p), FALSE, FALSE);
- X cp->ce_flag |= F_TARGET;
- X cp->ce_attr |= A_FRINGE;
- X Target = TRUE;
- X }
- X }
- X
- X Def_macro( "MAKEMACROS", cmdmacs, M_PRECIOUS|M_NOEXPORT );
- X Def_macro( "MAKETARGETS", targets, M_PRECIOUS|M_NOEXPORT );
- X if( cmdmacs != NIL(char) ) FREE(cmdmacs);
- X if( targets != NIL(char) ) FREE(targets);
- X
- X Def_macro( "MFLAGS", Buffer, M_PRECIOUS|M_NOEXPORT );
- X Def_macro( "%", "$@", M_PRECIOUS|M_NOEXPORT );
- X
- X if( *Buffer ) Def_macro( "MAKEFLAGS", Buffer+1, M_PRECIOUS|M_NOEXPORT );
- X
- X _warn = FALSE; /* disable warnings for builtin rules */
- X ex_val = Target; /* make sure we don't mark any */
- X Target = TRUE; /* of the default rules as */
- X Make_rules(); /* potential targets */
- X _warn = TRUE;
- X
- X if( Rules ) {
- X char *fname;
- X
- X if( (mkfil=Search_file("MAKESTARTUP", &fname)) != NIL(FILE) ) {
- X Parse(mkfil);
- X Def_macro( "MAKESTARTUP", fname, M_EXPANDED|M_MULTI );
- X mkfil = NIL(FILE);
- X }
- X else
- X Fatal( "Configuration file `%s' not found", fname );
- X }
- X
- X Target = ex_val;
- X
- X if( Get_env == 'E' ) _do_ReadEnvironment();
- X
- X if( fil_name != NIL(char) )
- X mkfil = Openfile( fil_name, FALSE, TRUE );
- X else {
- X /* Search .MAKEFILES dependent list looking for a makefile.
- X */
- X register CELLPTR cp;
- X register LINKPTR lp;
- X
- X cp = Def_cell( ".MAKEFILES" );
- X
- X if( (lp = cp->CE_PRQ) != NIL(LINK) ) {
- X int s_n, s_t, s_q;
- X
- X s_n = Trace;
- X s_t = Touch;
- X s_q = Check;
- X
- X Trace = Touch = Check = FALSE;
- X Makemkf = Wait_for_completion = TRUE;
- X mkfil = NIL(FILE);
- X
- X for(; lp != NIL(LINK) && mkfil == NIL(FILE); lp=lp->cl_next) {
- X if( lp->cl_prq->ce_attr & A_FRINGE ) continue;
- X
- X mkfil = Openfile( lp->cl_prq->CE_NAME, FALSE, FALSE );
- X
- X if( mkfil == NIL(FILE) &&
- X Make(lp->cl_prq, NIL(CELL)) != -1 )
- X mkfil = Openfile( lp->cl_prq->CE_NAME, FALSE, FALSE );
- X }
- X
- X Trace = s_n;
- X Touch = s_t;
- X Check = s_q;
- X Makemkf = Wait_for_completion = FALSE;
- X }
- X }
- X
- X if( mkfil != NIL(FILE) ) {
- X char *f = Filename();
- X char *p;
- X
- X if( strcmp(f, "stdin") == 0 ) f = "-";
- X p = _stradd( "-f", f, FALSE );
- X Def_macro( "MAKEFILE", p, M_PRECIOUS|M_NOEXPORT );
- X Parse( mkfil );
- X }
- X else if( !Rules )
- X Fatal( "No `makefile' present" );
- X
- X if( Nest_level ) Fatal( "Missing .END for .IF" );
- X if( Get_env == 'e' ) _do_ReadEnvironment();
- X
- X _do_VPATH(); /* kludge it up with .SOURCE */
- X
- X if( Listing ) Dump(); /* print out the structures */
- X if( Trace ) Glob_attr &= ~A_SILENT; /* make sure we see the trace */
- X
- X if( !Target )
- X Fatal( "No target" );
- X else {
- X Test_circle( Root, TRUE );
- X Check_circle_dfa();
- X }
- X
- X Push_dir( Start_dir, ".SETDIR", (int)(Glob_attr & A_IGNORE ));
- X
- X if( m_export ) {
- X int i;
- X
- X for( i=0; i<HASH_TABLE_SIZE; ++i ) {
- X HASHPTR hp = Macs[i];
- X
- X while( hp ) {
- X if( !(hp->ht_flag & M_NOEXPORT) && hp->ht_value != NIL(char) )
- X if( Write_env_string(hp->ht_name, hp->ht_value) != 0 )
- X Warning( "Could not export %s", hp->ht_name );
- X hp = hp->ht_next;
- X }
- X }
- X }
- X
- X if( Buffer != NIL(char) ) {FREE( Buffer ); Buffer = NIL(char);}
- X if( Trace ) Def_macro(".SEQUENTIAL", "y", M_EXPANDED);
- X if( Glob_attr & A_SEQ ) Def_macro( "MAXPROCESS", "1", M_EXPANDED|M_FORCE );
- X
- X ex_val = Make_targets();
- X
- X Pop_dir( (Glob_attr & A_IGNORE) != 0 );
- X Clear_signals();
- X Epilog(ex_val); /* Does not return -- EVER */
- }
- X
- X
- static void
- _do_f_flag( flag, name, fname )
- char flag;
- char *name;
- char **fname;
- {
- X if( *fname == NIL(char) ) {
- X if( name != NIL(char) ) {
- X *fname = name;
- X } else
- X Fatal("No file name for -%c", flag);
- X } else
- X Fatal("Only one `-%c file' allowed", flag);
- }
- X
- X
- static void
- _do_ReadEnvironment()
- {
- X t_attr saveattr = Glob_attr;
- X
- X Glob_attr |= A_SILENT;
- X ReadEnvironment();
- X Glob_attr = saveattr;
- }
- X
- X
- static void
- _do_VPATH()
- {
- X HASHPTR hp;
- X char *_rl[2];
- X extern char **Rule_tab;
- X
- X hp = GET_MACRO("VPATH");
- X if( hp == NIL(HASH) ) return;
- X
- X _rl[0] = ".SOURCE :^ $(VPATH:s/:/ /)";
- X _rl[1] = NIL(char);
- X
- X Rule_tab = _rl;
- X Parse( NIL(FILE) );
- }
- X
- X
- /* The file table and pointer to the next FREE slot for use by both
- X Openfile and Closefile. Each open stacks the new file onto the open
- X file stack, and a corresponding close will close the passed file, and
- X return the next file on the stack. The maximum number of nested
- X include files is limited by the value of MAX_INC_DEPTH */
- X
- static struct {
- X FILE *file; /* file pointer */
- X char *name; /* name of file */
- X int numb; /* line number */
- } ftab[ MAX_INC_DEPTH ];
- X
- static int next_file_slot = 0;
- X
- /* Set the proper macro value to reflect the depth of the .INCLUDE directives.
- X */
- static void
- _set_inc_depth()
- {
- X char buf[10];
- X sprintf( buf, "%d", next_file_slot );
- X Def_macro( "INCDEPTH", buf, M_MULTI|M_NOEXPORT );
- }
- X
- X
- PUBLIC FILE *
- Openfile(name, mode, err)/*
- ===========================
- X This routine opens a file for input or output depending on mode.
- X If the file name is `-' then it returns standard input.
- X The file is pushed onto the open file stack. */
- char *name;
- int mode;
- int err;
- {
- X FILE *fil;
- X
- X DB_ENTER("Openfile");
- X
- X if( name == NIL(char) || !*name )
- X if( !err )
- X DB_RETURN(NIL(FILE));
- X else
- X Fatal( "Openfile: NIL filename" );
- X
- X if( next_file_slot == MAX_INC_DEPTH )
- X Fatal( "Too many open files. Max nesting level is %d.", MAX_INC_DEPTH);
- X
- X DB_PRINT( "io", ("Opening file [%s], in slot %d", name, next_file_slot) );
- X
- X if( strcmp("-", name) == 0 ) {
- X name = "stdin";
- X fil = stdin;
- X }
- X else
- X fil = fopen( name, mode ? "w":"r" );
- X
- X if( Verbose & V_FILE_IO )
- X printf( "%s: Openning [%s] for %s", Pname, name, mode?"write":"read" );
- X
- X if( fil == NIL(FILE) ) {
- X if( Verbose & V_FILE_IO ) printf( " (fail)\n" );
- X if( err )
- X Fatal( mode ? "Cannot open file %s for write" : "File %s not found",
- X name );
- X }
- X else {
- X if( Verbose & V_FILE_IO ) printf( " (success)\n" );
- X ftab[next_file_slot].file = fil;
- X ftab[next_file_slot].numb = Line_number;
- X ftab[next_file_slot++].name = _strdup(name);
- X Line_number = 0;
- X _set_inc_depth();
- X }
- X
- X DB_RETURN(fil);
- }
- X
- X
- PUBLIC FILE *
- Closefile()/*
- =============
- X This routine is used to close the last file opened. This forces make
- X to open files in a last open first close fashion. It returns the
- X file pointer to the next file on the stack, and NULL if the stack is empty.*/
- {
- X DB_ENTER("Closefile");
- X
- X if( !next_file_slot )
- X DB_RETURN( NIL(FILE) );
- X
- X if( ftab[--next_file_slot].file != stdin ) {
- X DB_PRINT( "io", ("Closing file in slot %d", next_file_slot) );
- X
- X if( Verbose & V_FILE_IO )
- X printf( "%s: Closing [%s]\n", Pname, ftab[next_file_slot].name );
- X
- X fclose( ftab[next_file_slot].file );
- X FREE( ftab[next_file_slot].name );
- X }
- X
- X _set_inc_depth();
- X
- X if( next_file_slot > 0 ) {
- X Line_number = ftab[next_file_slot].numb;
- X DB_RETURN( ftab[next_file_slot-1].file );
- X }
- X else
- X Line_number = 0;
- X
- X DB_RETURN( NIL(FILE) );
- }
- X
- X
- PUBLIC FILE *
- Search_file( macname, rname )
- char *macname;
- char **rname;
- {
- X HASHPTR hp;
- X FILE *fil = NIL(FILE);
- X char *fname;
- X char *ename = NIL(char);
- X
- X /* order of precedence is:
- X *
- X * MACNAME from command line (precious is marked)
- X * ... via MACNAME:=filename definition.
- X * MACNAME from environment
- X * MACNAME from builtin rules (not precious)
- X */
- X
- X if( (hp = GET_MACRO(macname)) != NIL(HASH) )
- X ename = fname = Expand(hp->ht_value);
- X
- X if( hp->ht_flag & M_PRECIOUS ) fil = Openfile(fname, FALSE, FALSE);
- X
- X if( fil == NIL(FILE) ) {
- X fname=Expand(Read_env_string(macname));
- X if( fil = Openfile(fname, FALSE, FALSE) ) FREE(ename);
- X }
- X
- X if( fil == NIL(FILE) && hp != NIL(HASH) )
- X fil = Openfile(fname=ename, FALSE, FALSE);
- X
- X if( rname ) *rname = fname;
- X
- X return(fil);
- }
- X
- X
- PUBLIC char *
- Filename()/*
- ============
- X Return name of file on top of stack */
- {
- X return( next_file_slot==0 ? NIL(char) : ftab[next_file_slot-1].name );
- }
- X
- X
- PUBLIC int
- Nestlevel()/*
- =============
- X Return the file nesting level */
- {
- X return( next_file_slot );
- }
- X
- X
- /*
- ** print error message from variable arg list
- */
- X
- static int errflg = TRUE;
- static int warnflg = FALSE;
- X
- static void
- errargs(fmt, args)
- char *fmt;
- va_list args;
- {
- X int warn = _warn && warnflg && !(Glob_attr & A_SILENT);
- X
- X if( errflg || warn ) {
- X char *f = Filename();
- X
- X fprintf( stderr, "%s: ", Pname );
- X if( f != NIL(char) ) fprintf(stderr, "%s: line %d: ", f, Line_number);
- X
- X if( errflg )
- X fprintf(stderr, "Error -- ");
- X else if( warn )
- X fprintf(stderr, "Warning -- ");
- X
- X vfprintf( stderr, fmt, args );
- X putc( '\n', stderr );
- X if( errflg && !Continue ) Quit( NIL(CELL) );
- X }
- }
- X
- /*
- ** Print error message and abort
- */
- #if __STDC__ == 1
- void
- Fatal(char *fmt, ...)
- #elif defined(_MPW)
- Fatal(char *fmt, va_alist)
- va_dcl
- #else
- int
- Fatal(fmt, va_alist)
- char *fmt;
- va_dcl;
- #endif
- {
- X va_list args;
- X
- X va_start(args, fmt);
- X Continue = FALSE;
- X errargs(fmt, args);
- X va_end(args);
- }
- X
- /*
- ** error message and exit (unless -k)
- */
- #if __STDC__ == 1
- void
- Error (char *fmt, ...)
- #elif defined(_MPW)
- Error(char *fmt, va_alist)
- va_dcl
- #else
- int
- Error(fmt, va_alist)
- char* fmt;
- va_dcl;
- #endif
- {
- X va_list args;
- X
- X va_start(args, fmt);
- X errargs(fmt, args);
- X va_end(args);
- }
- X
- X
- /*
- ** non-fatal message
- */
- #if __STDC__ == 1
- void
- Warning(char *fmt, ...)
- #elif defined(_MPW)
- Error(char *fmt, va_alist)
- va_dcl
- #else
- int
- Warning(fmt, va_alist)
- char *fmt;
- va_dcl;
- #endif
- {
- X va_list args;
- X
- X va_start(args, fmt);
- X warnflg = TRUE;
- X errflg = FALSE;
- X errargs(fmt, args);
- X errflg = TRUE;
- X warnflg = FALSE;
- X va_end(args);
- }
- X
- X
- PUBLIC void
- No_ram()
- {
- X Fatal( "No more memory" );
- }
- X
- X
- PUBLIC
- X
- Usage( eflag )
- int eflag;
- {
- X if( eflag ) {
- X fprintf(stderr, USAGE, Pname);
- X }
- X else {
- X printf(USAGE, Pname);
- X puts(" -P# - set max number of child processes for parallel make");
- X puts(" -f file - use file as the makefile");
- #ifdef MSDOS
- X puts(" -C [+]file - duplicate console output to file, ('+' => append)");
- #endif
- X puts(" -K file - use file as the .KEEP_STATE file");
- X puts(" -v{dfimt} - verbose, indicate what we are doing, (-v => -vdimt)");
- X puts(" d => dump change of directory info only" );
- X puts(" f => dump file open/close info only" );
- X puts(" i => dump inference information only" );
- X puts(" m => dump make of target information only" );
- X puts(" t => keep temporary files when done\n" );
- X
- X puts("Options: (can be catenated, ie -irn == -i -r -n)");
- X puts(" -A - enable AUGMAKE special target mapping");
- X puts(" -B - enable the use of spaces instead of tabs to start recipes");
- X puts(" -c - use non standard comment scanning");
- X puts(" -E - define environment strings as macros");
- X puts(" -e - same as -E but done after parsing makefile");
- X puts(" -h - print out usage info");
- X puts(" -i - ignore errors");
- X puts(" -k - make independent targets, even if errors");
- X puts(" -n - trace and print, do not execute commands");
- X puts(" -p - print out a version of the makefile");
- X puts(" -q - check if target is up to date. Does not do");
- X puts(" anything. Returns 0 if up to date, 1 otherwise");
- X puts(" -r - don't use internal rules");
- X puts(" -s - do your work silently");
- X puts(" -S - disable parallel (force sequential) make, overrides -P");
- X puts(" -t - touch, update time stamps without executing commands");
- X puts(" -T - do not apply transitive closure on inference rules");
- X puts(" -u - force unconditional update of target");
- X puts(" -V - print out version number");
- X puts(" -x - export macro values to environment");
- X }
- X
- X Quit(NIL(CELL));
- }
- X
- X
- PUBLIC
- Version()
- {
- X extern char **Rule_tab;
- X char **p;
- X
- X printf("%s - %s, ", Pname, sccid);
- X printf("Version %s, PL %d\n\n", VERSION, PATCHLEVEL);
- X
- X puts("Default Configuration:");
- X for (p=Rule_tab; *p != NIL(char); p++)
- X printf("\t%s\n", *p);
- }
- SHAR_EOF
- chmod 0640 dmake/dmake.c ||
- echo 'restore of dmake/dmake.c failed'
- Wc_c="`wc -c < 'dmake/dmake.c'`"
- test 20915 -eq "$Wc_c" ||
- echo 'dmake/dmake.c: original size 20915, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/dmake.h ==============
- if test -f 'dmake/dmake.h' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/dmake.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/dmake.h' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/dmake.h,v 1.1 1992/01/24 03:26:50 dvadura Exp $
- -- SYNOPSIS -- global defines for dmake.
- --
- -- DESCRIPTION
- -- All the interesting bits and flags that dmake uses are defined here.
- --
- -- AUTHOR
- -- Dennis Vadura, dvadura@watdragon.uwaterloo.ca
- -- CS DEPT, University of Waterloo, Waterloo, Ont., Canada
- --
- -- COPYRIGHT
- -- Copyright (c) 1990 by Dennis Vadura. All rights reserved.
- --
- -- This program is free software; you can redistribute it and/or
- -- modify it under the terms of the GNU General Public License
- -- (version 1), as published by the Free Software Foundation, and
- -- found in the file 'LICENSE' included with this distribution.
- --
- -- This program is distributed in the hope that it will be useful,
- -- but WITHOUT ANY WARRANTY; without even the implied warrant of
- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- -- GNU General Public License for more details.
- --
- -- You should have received a copy of the GNU General Public License
- -- along with this program; if not, write to the Free Software
- -- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- --
- -- LOG
- -- $Log: dmake.h,v $
- X * Revision 1.1 1992/01/24 03:26:50 dvadura
- X * dmake Version 3.8, Initial revision
- X *
- */
- X
- #ifndef _DMAKE_INCLUDED_
- #define _DMAKE_INCLUDED_
- X
- #define MAX_INC_DEPTH 10 /* max of ten nested include files */
- #define MAX_COND_DEPTH 20 /* max nesting level of conditionals */
- #define ERROR_EXIT_VALUE 255 /* return code of aborted make */
- #define CONTINUATION_CHAR '\\' /* line continuation \<nl> */
- #define DEF_ESCAPE_CHAR '\\' /* escape char for used chars */
- #define ESCAPE_CHAR *Escape_char
- #define COMMENT_CHAR '#' /* start of comment chars */
- #define TGT_DEP_SEP ':' /* separator for targets and dependents */
- #define CONDSTART '.' /* start of conditional token eg .IF */
- #define DEF_MAKE_PNAME "dmake"/* default name to use as name of make */
- X
- X
- /* ............... Hashing function constants ......................... */
- #define HASH_TABLE_SIZE 200 /* See hash.c for description */
- X
- X
- /* Bit flags for cells and macro definitions. */
- #define M_DEFAULT 0x0000 /* default flag value */
- #define M_MARK 0x0001 /* mark for circularity checks */
- #define M_PRECIOUS 0x0002 /* keep macro, same as A_PRE... */
- #define M_MULTI 0x0004 /* multiple redefinitions ok! */
- #define M_EXPANDED 0x0008 /* macro has been assigned */
- #define M_USED 0x0010 /* macro has been expanded */
- #define M_LITERAL 0x0020 /* don't strip w/s on macro def */
- #define M_NOEXPORT 0x0040 /* don't export macro for -x */
- #define M_FORCE 0x0080 /* Force a macro redefinition */
- #define M_VAR_BIT 0x1000 /* macro bit variable */
- #define M_VAR_CHAR 0x2000 /* macro char variable */
- #define M_VAR_STRING 0x4000 /* macro string variable */
- #define M_VAR_INT 0x8000 /* macro integer variable */
- X
- #define M_VAR_MASK 0xf000 /* macro variable mask */
- X
- X
- X
- /* Global and target attribute flag definitions.
- X * If you change the values of these or re-order them make appropriate changes
- X * in dump.c so that the output of dmake -p matches the attribute info for a
- X * target. */
- X
- #define A_DEFAULT 0x00000 /* default flag value */
- #define A_PRECIOUS 0x00001 /* object is precious */
- #define A_SILENT 0x00002 /* don't echo commands */
- #define A_LIBRARY 0x00004 /* target is an archive */
- #define A_EPILOG 0x00008 /* insert shell epilog code */
- #define A_PROLOG 0x00010 /* insert shell prolog code */
- #define A_IGNORE 0x00020 /* ignore errors */
- #define A_SYMBOL 0x00040 /* lib member is a symbol */
- #define A_NOINFER 0x00080 /* no trans closure from cell */
- #define A_UPDATEALL 0x00100 /* all targets of rule modified */
- #define A_SEQ 0x00200 /* sequential make attribute */
- #define A_SETDIR 0x00400 /* cd to dir when making target */
- #define A_SHELL 0x00800 /* run the recipe using a shell */
- #define A_SWAP 0x01000 /* swap on exec. */
- #define A_MKSARGS 0x02000 /* use MKS argument swapping */
- #define A_PHONY 0x04000 /* .PHONY attribute */
- #define A_NOSTATE 0x08000 /* don't track state for me */
- #define MAX_ATTR A_NOSTATE /* highest valid attribute */
- #define A_LIBRARYM 0x10000 /* target is an archive member */
- #define A_FRINGE 0x20000 /* cell is on the fringe */
- #define A_COMPOSITE 0x40000 /* member of lib(targ) name */
- #define A_FFNAME 0x80000 /* if set, free ce_fname in stat*/
- #define A_UPDATED 0x100000 /* Used to mark cell as updated */
- #define A_ROOT 0x200000 /* True if it is a root prereq */
- X
- X
- /* Global and target bit flag definitions */
- X
- #define F_DEFAULT 0x0000 /* default flag value */
- #define F_MARK 0x0001 /* circularity check mark */
- #define F_MULTI 0x0002 /* multiple rules for target */
- #define F_SINGLE 0x0004 /* exec rules one/prerequisite */
- #define F_TARGET 0x0008 /* marks a target */
- #define F_RULES 0x0010 /* indicates target has rules */
- #define F_GROUP 0x0020 /* indicates that rules are to */
- X /* fed to the shell as a group */
- X
- #define F_TRANS 0x0040 /* same as F_STAT not used tgthr*/
- #define F_STAT 0x0040 /* target already stated */
- #define F_VISITED 0x0080 /* target scheduled for make */
- #define F_USED 0x0080 /* used in releparse.c */
- #define F_SPECIAL 0x0100 /* marks a special target */
- #define F_DFA 0x0200 /* bit for marking added DFA */
- #define F_EXPLICIT 0x0400 /* explicit target in makefile */
- #define F_PERCENT 0x0800 /* marks a target as a % rule */
- #define F_REMOVE 0x1000 /* marks an intermediate target */
- #define F_MAGIC 0x2000 /* marks a magic target */
- #define F_INFER 0x4000 /* target is result of inference*/
- #define F_MADE 0x8000 /* target is manufactured */
- X
- X
- /* Definitions for the Parser states */
- #define NORMAL_SCAN 0 /* normal processing state */
- #define RULE_SCAN 1 /* scan of rule text */
- X
- /* definitions for macro operator types */
- #define M_OP_EQ 1 /* macro operation is '=' */
- #define M_OP_CL 2 /* macro operation is ':=' */
- #define M_OP_PL 3 /* macro operation is '+=' */
- #define M_OP_PLCL 4 /* macro operation is '+:='*/
- #define M_OP_DF 5 /* macro operation is '*=' */
- #define M_OP_DFCL 6 /* macro operation is '*:='*/
- X
- /* definitions for rule operator types */
- #define R_OP_CL 1 /* rule operation is ':' */
- #define R_OP_DCL 2 /* rule operation is '::' */
- #define R_OP_BG 4 /* rule operation is ':!' */
- #define R_OP_UP 8 /* rule operation is ':^' */
- #define R_OP_MI 16 /* rule operation is ':-' */
- X
- /* definitions for modifier application in Apply_modifiers in expand.c */
- #define SUFFIX_FLAG 1 /* defines for macro modifier code */
- #define DIRECTORY_FLAG 2
- #define FILE_FLAG 4
- X
- /* special target definitions for use inside dmake */
- #define ST_IF 1
- #define ST_ELSE 2
- #define ST_END 3
- #define ST_REST 4 /* remaining special targets */
- #define ST_INCLUDE 5
- #define ST_SOURCE 7
- #define ST_EXPORT 8
- #define ST_IMPORT 9
- #define ST_ELIF 10
- #define ST_KEEP 11
- X
- /* Flags for controling use of -v switch */
- #define V_NONE 0x00
- #define V_LEAVE_TMP 0x01
- #define V_PRINT_DIR 0x02
- #define V_INFER 0x04
- #define V_MAKE 0x08
- #define V_FILE_IO 0x10
- #define V_ALL (V_LEAVE_TMP | V_PRINT_DIR | V_INFER | V_MAKE |\
- X V_FILE_IO)
- X
- /* Macro definitions for use inside dmake */
- #define SET_TOKEN(A, B) (A)->tk_str = (B); (A)->tk_cchar = *(B);\
- X (A)->tk_quote = 1;
- #define CLEAR_TOKEN(A) *(A)->tk_str = (A)->tk_cchar
- #define GET_MACRO(A) Get_name(A, Macs, FALSE)
- #define iswhite(C) ((C == ' ') || (C == '\t'))
- X
- #endif
- X
- SHAR_EOF
- chmod 0640 dmake/dmake.h ||
- echo 'restore of dmake/dmake.h failed'
- Wc_c="`wc -c < 'dmake/dmake.h'`"
- test 8214 -eq "$Wc_c" ||
- echo 'dmake/dmake.h: original size 8214, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/dmdump.c ==============
- if test -f 'dmake/dmdump.c' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/dmdump.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/dmdump.c' &&
- /* RCS -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/dmdump.c,v 1.1 1992/01/24 03:28:51 dvadura Exp $
- SHAR_EOF
- true || echo 'restore of dmake/dmdump.c failed'
- fi
- echo 'End of part 7, continue with part 8'
- echo 8 > _shar_seq_.tmp
- exit 0
- exit 0 # Just in case...
-