[comp.os.vms] VMS Makefile part 4 of 8

awp8101@ritcv.UUCP (Andrew W. Potter) (02/09/88)

$Part4:
$ File_is="MKERRS.MSG"
$ Check_Sum_is=386027507
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X!
X! MAKE version 1.1, Jesse Perry [RIT], April 1987
X! mkerrs.msg
X! This file contains the text of the error messages for make.
X!
X
X.title`009MAKE error messages
X.ident`009'Version 1.1'
X
X.facility make, 1 /prefix=mak_
X
X.severity informational
Xnothing`009`009<Nothing to make>
X
X.severity warning
X
X.severity error
Xerrcrebld`009<Cannot create command file '!AD', aborting>/fao=1
Xalloc`009`009<Can't allocate !SL bytes>/fao=1
Xbadinitch`009<Bad first character '!AD' on line !SL>/fao=2
Xchrequired`009<Missing '!AD' in '!AD', line !SL>/fao=3
Xcmdspecexp`009-
V<Error expanding special macro in command line!/!_of target '!AD', line !SL>/fa
Xo=2
Xdepeof`009`009<No dependencies or commands after '!AD', line !SL>/fao=2
Xdepneeded`009<Missing '!AD' on line !SL; inserted at end of line>/fao=2
Xerrindef`009<Error(s) in default rule file !AD, aborting>/fao=1
Xerrinmak`009<Error(s) in makefile !AD, aborting>/fao=1
Xexpandrule`009<Error expanding !AD of rule !AD!/!_for target !AD>/fao=3
Xhow`009`009<Don't know how to make !AD>/fao=1
Xinvblank`009<Blank invalid in target specification, line !SL>/fao=1
Xinvch`009`009<'!AD' invalid in !AD, line !SL>/fao=3
Xmaclendiff`009-
V<Macros have different word counts,!/!_string '!AD', line !SL,!/!_detected at '
X!AD', word count !SL>/fao=4
Xmultmacdef`009<More than one name in macro definition, line !SL>/fao=1
Xnocmd`009`009<No command text on line !SL>/fao=1
Xnodelim`009`009<Missing '!AD' after '!AD' in '!AD', line !SL>/fao=4
Xnodepch`009`009<Expected '!AD' after '!AD', line !SL>/fao=3
Xnotarg`009`009<No target name in statement, line !SL>/fao=1
Xnotextmac`009<No text for macro '!AD', line !SL>/fao=2
Xnotgname`009<No name in target, line !SL>/fao=1
Xsepclash`009-
X<Conflicting separators '!AD' and '!AD'!/!_in '!AD', line !SL>/fao=4
Xspecdef`009`009<Special macro cannot be re-defined, on line !SL>/fao=1
Xspectarg`009<Special macro used in target !AD , line !SL>/fao=2
Xunexpeof`009<End of file not preceded by newline>
Xunrecmac`009<Unknown macro '!AD' used in '!AD', line !SL>/fao=3
Xunrecspec`009<Unknown special macro !AD!AD used in '!AD', line !SL>/fao=4
Xcmdlnerr`009<Error(s) in command line definitions>
Xerrcrembx`009<Unable to create mailbox>
Xerrcresub`009<Unable to create subprocess>
Xerrwrtsub`009<Unable to write to subprocess>
Xerrmbxast`009<Can't enable mailbox read attention AST>
X.end
$ GoSub Convert_File
$ File_is="MKEXIT.C"
$ Check_Sum_is=1729797349
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X/*
XMAKE version 1.1, April 1987
XCopyright (C) 1987 by Jesse Perry.
XMAKE is in the public domain and may be freely distributed,
Xused, and modified, provided this notice is not removed.
X
Xmkexit.c
XThis file contains the exit handler, make_exit(), along with all the
Xcode necessary to trap interrupts and otherwise ensure that the exit
Xhandler will always be called when the program exits.  If this file
Xis compiled for stand-alone operation (by defining the symbol
XAST_STAND_ALONE at compile time) additional code will be included
Xto produce a terminal locking program for testing purposes.
X*/
X
X#include <iodef.h>
X
X#ifdef AST_STAND_ALONE
X
X#define ___`0090`009`009/* blank value for unused arguments */
X#define PASSLEN`00915`009`009/* max size of password */
X#define PASSWD`009"OK_OK"`009`009/* password required to unlock terminal */
X#define ERRSTAT(stat)`009(~(stat) & 1)
X
Xtypedef struct {
X`009int sd_len;
X`009char *sd_str;
X} STR_DESC;
X
X#else
X
X#include "make.h"
X
X#endif
X
Xint make_exit();
X
Xstatic int Tt_chan;
Xstatic int Oldmask, Ex_stat;
Xstatic int Mask = 0x02000000;`009`009/* LIB$M_CLI_CTRLY */
Xstatic int Desblk[4] = { 0, (int)make_exit, 1, &Ex_stat };
X
X#ifdef AST_STAND_ALONE
Xmain()
X{
X`009char *prompt = "\r\nPassword: ";
X`009char password[PASSLEN + 1];
X
X`009/* Set up exit handler and CTRL/Y trapping. */
X
X`009estexhand();
X
X`009/* Read passwords until the correct one is entered. */
X
X`009password[0] = '\0';
X`009while (strcmp(password, PASSWD)) {
X`009`009printf("\nGet it right!\n\n");
X`009`009getpass(password, prompt);
X`009}
X
X`009printf("\nBy Golly you did it.\n\n");
X`009printf("About to call exit ... Exit handler?\n\n");
X}
X
X/* Read password guess using no-echo QIO. */
X
Xgetpass(password, prompt)
Xchar *password, *prompt;
X{
X`009int stat;
X`009struct {
X`009`009unsigned short ri_stat;
X`009`009unsigned short ri_len;
X`009`009unsigned short ri_termstr;
X`009`009unsigned short ri_termlen;
X`009} read_iosb;
X
X`009*password = '\0';
X`009stat = sys$qiow(
X`009    ___,`009`009`009/* default event flag */
X`009    Tt_chan,`009`009`009/* device to read from */
X`009    IO$_READPROMPT | IO$M_NOECHO, /* function code */
X`009    &read_iosb,`009`009`009/* iosb used to get input length */
X`009    ___, ___,`009`009`009/* no completion AST */
X`009    password, PASSLEN,`009`009/* P1, P2; buffer to read into */
X`009    ___, ___,`009`009`009/* P3, P4; no timeout limit */
X`009    prompt, strlen(prompt));`009/* P5, P6; prompt to print */
X`009if (ERRSTAT(stat)) {
X`009`009lib$stop(stat);
X`009}
X`009password[read_iosb.ri_len] = '\0';
X}
X#endif
X
X/* This routine initiates CTRL/C and CTRL/Y trapping and sets
Xup the exit handler routine.  Although CTRL/C and CTRL/Y can
Xbe trapped without setting up an exit handler, this should
Xnot be done, because the exit handler ensures that CTRL/C and
XCTRL/Y interrupts will be re-enabled, regardless of the reason
Xthe program eventually exits. */
X
Xestexhand()
X{
X`009char ttdev[] = "TT";
X`009int intr_handler();
X`009STR_DESC ttname;
X
X`009/* Declare the exit handler. */
X
X`009sys$dclexh(Desblk);
X
X`009/* Tell DCL, "I'll Handle all the CTRL/Ys" */
X
X`009lib$disable_ctrl(&Mask, &Oldmask);
X
X`009/* Assign Tt_chan for terminal AST QIOs.  (Also for
X`009NOECHO read QIOs if AST_STAND_ALONE is defined. */
X
X`009ttname.sd_len = sizeof(ttdev) - 1;
X`009ttname.sd_str = ttdev;
X`009sys$assign(&ttname, &Tt_chan, ___, ___);
X
X`009/* Enable ASTs to be called on CTRL/C and CTRL/Y */
X
X`009catch_intr(IO$M_CTRLCAST, intr_handler);
X`009catch_intr(IO$M_CTRLYAST, intr_handler);
X}`009
X
X/* This is the exit handler for make.  Its main purpose is to ensure
Xthat the sub-process which executes makefile commands is killed when
Xmake exits, and to re-enable CTRL/C and CTRL/Y. */
X
Xmake_exit()
X{
X#ifdef AST_STAND_ALONE
X`009printf("Exit Handler here ... Enabling CRTL/Y and exiting\n");
X#else
X`009/* Close command file being built, if any. */
X
X`009if (Bldfile != NULL) {
X`009`009fclose(Bldfile);
X`009`009Bldfile = NULL;
X`009}
X
X`009/* Kill sub-process. */
X
X`009sub_close();
X#endif
X
X`009/* Re-enable CTRL/Y trapping by DCL.  This is necessary because
X`009CTRL/Y trapping affects the process (not just the current image). */
X
X`009lib$enable_ctrl(&Oldmask, ___);
X
X`009/* Turn off exit control for normal exit. */
X
X`009sys$canexh(Desblk);
X
X`009/* Good-bye. */
X
X`009exit();
X}
X
X/* This routine sets up an interrupt handler AST routine.  The routine
Xcan catch CTRL/C's or CTRL/Y's, according to the value of intr_mask. */
X
Xstatic
Xcatch_intr(intr_mask, intr_rout)
Xint intr_mask;`009/* which interrupt, either IO$M_CTRLCAST or IO$M_CTRLYAST */
Xint (*intr_rout)();`009/* address of routine to call when interrupt occurs */
X{
X`009int stat;
X
X`009stat = sys$qiow(
X`009    ___,`009`009`009/* default event flag */
X`009    Tt_chan,`009`009`009/* channel to terminal */
X`009    IO$_SETMODE | intr_mask,`009/* function code to catch interrupt */
X`009    ___,`009`009`009/* no iosb */
X`009    ___, ___,`009`009`009/* no completion AST */
X`009    intr_rout,`009`009`009/* P1; AST interrupt handler */
X`009    intr_mask,`009`009`009/* P2; mask is argument for handler */
X`009    3,`009`009`009`009/* P3; access mode for AST delivery */
X`009    ___, ___, ___);`009`009/* P4, P5, P6; unused by this QIO */
X`009if (ERRSTAT(stat)) {
X`009`009lib$stop(stat);
X`009}
X}
X
X/* This routine is called when a CTRL/C or CTRL/Y is pressed.  The argument
Xis IO$M_CTRLCAST if CTRL/C was pressed, IO$M_CTRLYAST if CTRL/Y was pressed.
XNotice that this routine is declared static, so it can't be directly called
Xby code outside this source file. */
X
Xstatic
Xintr_handler(intr_mask)
Xint intr_mask;
X{
X`009/* Fix the stack frame. */
X
X`009sys$unwind();
X
X`009/* Re-enable the AST which called this routine. */
X
X`009catch_intr(intr_mask, intr_handler);
X
X`009/* Do whatever seems fun in response to the interrupt. */
X
X#ifdef AST_STAND_ALONE
X`009if (intr_mask == IO$M_CTRLYAST) {
X`009`009printf("**** Really ouch!!! ****\n\n");
X`009} else {
X`009`009printf("**** Ouch ****\n\n");
X`009}
X#else
X`009sub_zap();
X`009make_exit();
X#endif
X}
$ GoSub Convert_File
$ File_is="MKEXT.C"
$ Check_Sum_is=877086634
$ Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X/*
XMAKE version 1.1, April 1987
XCopyright (C) 1987 by Jesse Perry.
XMAKE is in the public domain and may be freely distributed,
Xused, and modified, provided this notice is not removed.
X
Xmkext.c
XThis file contains all external variable definitions.  The variables
Xare declared in make.h.  
X*/
X
X#include "make.h"
X
Xint Update_level;
Xint Num_cmd_sent;
Xchar *Cmdlnmacdef;
Xchar Def_makefile_name[] = "MAKE$DEFNAME";
Xchar Def_rule_name[] = "MAKE$DEFRULE";
Xchar Def_file_type[] = "MAK";
Xchar Def_targ_type[] = "EXE";
Xchar Def_build_name[] = "INSTALL.COM";
Xchar Def_build_type[] = "COM";
Xchar Verbose_prefix[] = "> ";
Xchar Active;
Xchar Created;
Xchar Ignore;
Xchar Silent;
Xchar Touch;
Xchar Verbose;
Xchar Sub_ign_err = FALSE;
Xchar *Curr_targ;
XFILE *Bldfile;
X
Xchar Ctype[128] = {
X/*`0090x00,`0090x01,`0090x02,`0090x03,`0090x04,`0090x05,`0090x06,`0090x07`009*/
X`0090,`0090,`0090,`0090,`0090,`0090,`0090,`0090,
X/*`009'\b',`009'\t',`009'\n',`0090x0B,`009'\f',`009'\r',`0090x0E,`0090x0F`009*/
X`0090,`0090,`009T_,`0090,`0090,`0090,`0090,`0090,
X/*`0090x10,`0090x11,`0090x12,`0090x13,`0090x14,`0090x15,`0090x16,`0090x17`009*/
X`0090,`0090,`0090,`0090,`0090,`0090,`0090,`0090,
X/*`0090x18,`0090x19,`0090x1A,`0090x1B,`0090x1C,`0090x1D,`0090x1E,`0090x1F`009*/
X`0090,`0090,`0090,`0090,`0090,`0090,`0090,`0090,
X/*`009' ',`009'!',`009'"',`009'#',`009'$',`009'%',`009'&',`009'\''`009*/
X`009T_,`0090,`009Q_,`0090,`0090,`0090,`0090,`009Q_,
X/*`009'(',`009')',`009'*',`009'+',`009',',`009'-',`009'.',`009'/'`009*/
X`0090,`0090,`0090,`0090,`0090,`0090,`0090,`0090,
X/*`009'0',`009'1',`009'2',`009'3',`009'4',`009'5',`009'6',`009'7'`009*/
X`0090,`0090,`0090,`0090,`0090,`0090,`0090,`0090,
X/*`009'8',`009'9',`009':',`009';',`009'<',`009'=',`009'>',`009'?'`009*/
X`0090,`0090,`0090,`0090,`0090,`0090,`0090,`0090,
X/*`009'@',`009'A',`009'B',`009'C',`009'D',`009'E',`009'F',`009'G'`009*/
X`0090,`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,
X/*`009'H',`009'I',`009'J',`009'K',`009'L',`009'M',`009'N',`009'O'`009*/
X`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,
X/*`009'P',`009'Q',`009'R',`009'S',`009'T',`009'U',`009'V',`009'W'`009*/
X`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,`009U_,
X/*`009'X',`009'Y',`009'Z',`009'[',`009'\\',`009']',`009'^',`009'_'`009*/
X`009U_,`009U_,`009U_,`0090,`0090,`0090,`0090,`009U_,
X/*`009'``',`009'a',`009'b',`009'c',`009'd',`009'e',`009'f',`009'g'`009*/
X`0090,`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,
X/*`009'h',`009'i',`009'j',`009'k',`009'l',`009'm',`009'n',`009'o'`009*/
X`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,
X/*`009'p',`009'q',`009'r',`009's',`009't',`009'u',`009'v',`009'w'`009*/
X`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,`009L_,
X/*`009'x',`009'y',`009'z',`009'{',`009'|',`009'}',`009'~',`0090x7F`009*/
X`009L_,`009L_,`009L_,`0090,`0090,`0090,`0090,`0090
X};
X
X#ifdef PARSE_DEBUG
X/* Parser state names, for debugging. */
X
Xchar *P_state_name[] = {
X`009"P_START_LINE",
X`009"P_GET_TARGET_LIST",
X`009"P_GET_DEPENDENCY_LIST",
X`009"P_CHECK_MACRO",
X`009"P_EXPAND_TARGET",
X`009"P_GET_CMD",
X`009"P_GET_CMD_FLAG",
X`009"P_GET_MACRO_TEXT",
X};
X#endif
$ GoSub Convert_File
$ Goto Part5