E Update: 8-FEB-1987- Fixed the bug that prevented users with usernames G                     of more than 7 characters from using make. (The bug D                     occured in the routine MKSUB.  Make concatinatesM                     the low order PID to the username to form the processname J                     of the subprocess.  Make died then the SPAWN failed toI                     create the subprocess name of more than 15 characters $                     character) - AWP  2 	8-FEB-1987  Fixed CLD Comment /TOUCH option - AWP  ' 	17-May-1988 Fixed bug in parsing - SAM   H 	9-May-1989  Added '%' Macro to extract the target file-name only. - SAM  B 	11-May-1989 Fixed bug in rules file caused by using '$' for - SAM8 		    invoking macro's.  There is now an internal invoke< 		    macro ('~') and an external invoke macro ('$') command    1                    DIRECTIONS FOR INSTALLING MAKE   K Use BUILD_MAKE.COM to compile and link the MAKE sources, and to produce the ? documentation files MAKE.HLP and MAKE.MEM.  The LINK command in I BUILD_MAKE.COM uses an options file, C_OPTS.OPT, which specifies the name : of the VAXC Run-Time Library.  It assumes that the libraryG "SYS$SHARE:VAXCRTL.EXE" exists. If this is not the case on your system, ! modify C_OPTS.OPT as appropriate.    To install on your system:  @ 1) Modify the file MAKE_STARTUP.COM to correctly point to proper    path to the MAKE directory.  <    MAKE_STARTUP.COM defines three system-wide logical names:C     MAKE$DEFRULE -- this should be the full pathname of the default          rules file, DEFRULE.MAK B     MAKE$DEFNAME -- this should be the default name for makefiles,A     MAKE$DOCUMENT -- this should be the full pathname of the MAKE E         tutorial document, MAKE.MEM .  The help entry MAKE.HLP refers          to this logical name.   ? 2) Modify your site specific startup command file to invoke the     procedure MAKE_STARTUP.COM   @ 3) Install the CLD in the system wide dcltables.  (If you do notD    wish to do this, then tell your MAKE users to include the command<    "SET COMMAND MAKE_HOMEDIR:MAKE" in their LOGIN.COM files)  "    To install the CLD system wide:  ;    $ SET COMMAND /TABLES=SYS$COMMON:[SYSLIB]DCLTABLES.EXE - B                  /OUTPUT=SYS$COMMON:[SYSLIB]DCLTABLES.EXE MAKE.CLD"    $ INSTALL == "$INSTALL/COMMAND"*    $ INSTALL REPLACE SYS$LIBRARY:DCLTABLES  I    You will need to logout and back in to get the new command definitions   3  4) Install the HELP entry in the system help file.   - 	$ LIBRARY/HELP SYS$HELP:HELPLIB.HLB MAKE.HLP   G   This help entry, MAKE.HLP, directs users to mail any questions or bug D   reports to MAKE_MAINT.  Therefore, either create a MAKE_MAINT mailD   alias (In mail: SET FORWARD/USER=MAKE_MAINT), or edit MAKE.RNH to $   remove the reference to this name.  #   MAKE should now be ready for use.       0              PURPOSE OF THIS MAKE IMPLEMENTATION  A The major design goal of this MAKE is to provide VMS users with a A make utility which is as similar as possible to the Unix [Unix is D a trademark of Bell Laboratories] utility of the same name.  To this> end, some of MAKE's features are a bit inconvenient in the VMS@ environment.  In particular, the use of '$' for macro invocation@ requires that all other uses of '$' in a makefile (e.g., as partA of a file or device name) be preceded by '\'.  Similarly, the use A of '@' to suppress printing of a command line requires that a '\' @ precede '@' when it is used to run a command (.COM) file.  (See!B That's not a bug, it's a feature.)  Individual sites may choose toD use other characters (by changing the #define constants INVOKE_MACROA and MC_NO_ECHO in MAKE.H) to avoid this problem, depending on how = much they care whether their MAKE resembles the Unix version.       +                   DISCUSSION OF SOURCE CODE    The sources for MAKE are:   A MAKE.CLD    MAKE.H     MKERRS.MSG   MAKEFILE.MAK   BUILD_MAKE.COM , MKDATE.C    MKEXIT.C   MKEXT.C      MKFILE.C, MKMACRO.C   MKMAIN.C   MKSCAN.C     MKSHOW.C, MKSUB.C     MKUTIL.C   MAKE.RNH     MAKE.RNO  D Compilation instructions are in the makefile, and in BUILD_MAKE.COM.C A comment at the top of each source file describes the main purpose  of the routines in that file.     + The C code follows a number of conventions:   E   o  All defined constants, macros, and typedef'd names are uppercase 9   o  Local variables and function names are all lowercase A   o  Global variables start with a single capital letter, so they @      don't look like either defined constants or local variables(   o  Indentation is by eight column tabs@   o  When a statement is broken across multiple lines, all lines/      after the first are indented by half a tab 9   o  A blank line precedes and follows each comment block A   o  Comments do not use pretty formatting, just the minimum open ;      and close comment pairs, in line with the comment text >   o  Curly braces are always used, even when they enclose only      one statement  G To answer possible complaints, especially about the last two items, let E me point out that the major goals of choosing a style are readability H and ease of modification.  It would be difficult to find a more flexibleH comment style than the one used here.  Certainly none of the more common1 types of comments allow changes nearly so easily:    /*  * This is a  * comment.   */    /* This is a *  * comment.  */    /*\   * This is a  * comment.  \*/   K As for using curly braces when they aren't required, the tiny inconvenience I of typing them in is more than made up for by the guaranteed avoidance of D "dangling else" errors, and the ease of adding new statements later.  K The remaining conventions are mainly for readability.  It seems six of one, J half a dozen of the other whether a space should separate a keyword from aG parenthesized expression, or whether a space should separate a function I name from its parenthesized argument list.  I like the first, but not the 1 second, however, there isn't any real difference.   D Using all-caps for constants is fairly standard.  Using all-caps forD macro names is not; macro names (following the lead of, for example,H putchar()/getchar() ) are usually all lowercase.  I find it very helpfulJ to be able to tell immediately whether something is a function or a macro,H so that I don't waste time searching all the C files for a function nameI which doesn't exist, only to find (eventually) that it is a macro defined I in a .H file.  Similarly, capitalizing the first letter of every external G variable is a great aid in spotting where non-local data is being used.   C Many people prefer four column tabs, rather than eight.  I have two H reasons for favoring eight space tabs.  First, a single tab is easier toF type than four spaces.  If you're using a terminal with adjustable tabH stops, this doesn't matter, but many terminals support only eight columnC tabs.  Second, to answer the idea that four space tabs allow deeper G nesting without going beyond eighty columns:  my own experience is that H when the nesting is deep enough with eight space tabs to push lines pastI eighty columns, it's also getting a bit too deep to be easily understood. G The innermost few levels should probably be replaced by a new function.     C I hope you find MAKE as useful for your purposes as it is for mine. E If you find time hanging heavy on your hands and want something to do F to fill it, you might have a go at re-writing MKMACRO.C, especially toA merge the code for special macros with the code for named macros. E MKFILE.C could also use some work.  In particular it would be nice if B it did not scan a linked list of all the tokens in a makefile, butA rather called make_token() (in MKSCAN.C) each time it needed one.   F To be ideologically correct, I suppose all of the code in MKSCAN.C andH MKFILE.C should be replaced with table-driven code produced by a lexicalF analyser and parser generator such as the Unix utilities lex and yacc.H However, table-driven parsers are notoriously slow.  Also, the syntax ofF makefiles is unlikely to change much or often, so ease of modification is not a big concern.     B Naturally, if you fix bugs or add useful enhancements, I'd love toA hear about it.  I can be reached via BITNET at RITVAXD::JAP5769 .      				Regards,   				-Jesse Perry